Create micro-bosh with 'rake stemcell2[infrastructure,manifest,tar]'

116 views
Skip to first unread message

Mike

unread,
Sep 4, 2012, 3:48:10 PM9/4/12
to bosh...@cloudfoundry.org
Hi,

I'm working in a new CPI for BOSH, it is my understanding that the way to go is to use the micro bosh to install a bosh.

To do so I must, and I did, create an agent that I must embed in the stemcells. Must I add this agent to the micro-bosh?

If so, I understand the parameters of infrastructure and manifest (MF file). But what is that tar path that I must add?

Thanks.

Mike.

Martin Englund

unread,
Sep 4, 2012, 4:35:13 PM9/4/12
to bosh...@cloudfoundry.org
Hi Mike!

On Tue, Sep 4, 2012 at 4:48 PM, Mike <impres...@gmail.com> wrote:

> I'm working in a new CPI for BOSH, it is my understanding that the way to go
> is to use the micro bosh to install a bosh.
>
> To do so I must, and I did, create an agent that I must embed in the
> stemcells. Must I add this agent to the micro-bosh?
>
Yes, if you want to be able to use micro bosh on the new cloud you're
adding support for, you need to build a micro bosh for it.

> If so, I understand the parameters of infrastructure and manifest (MF file).
> But what is that tar path that I must add?
>
The tarball you generate with:
git clone g...@github.com:cloudfoundry/bosh-release.git
cd bosh-release
bosh create release --with-tarball
which will output a .tgz in the dev_release directory

Good luck and let me know if you run into any problems...

cheers,
/Martin
--
Martin Englund, Staff Engineer, Cloud Foundry, VMware Inc.
"The question is not if you are paranoid, it is if you are paranoid enough."

Mike

unread,
Sep 4, 2012, 5:12:46 PM9/4/12
to bosh...@cloudfoundry.org
Thanks for your response.

I checked out the code and ran the command but this is the output

Building aws_registry...
  Final version: Error 500: Package `aws_registry' has a glob that resolves to an empty file list: bosh/aws_registry/**/*

Any ideas on where to look to solve it?

Thanks!

Martin Englund

unread,
Sep 4, 2012, 5:21:21 PM9/4/12
to bosh...@cloudfoundry.org
Ah, you need to run:
git submodule update --init
in the bosh-release directory
before you run
bosh create release --with-tarball

/M
--

Mike

unread,
Sep 4, 2012, 5:40:19 PM9/4/12
to bosh...@cloudfoundry.org
That did the trick.

It created the stemcell but added the aws_registry, should I add a job that add my registry?

Thanks!

Martin Englund

unread,
Sep 4, 2012, 5:51:28 PM9/4/12
to bosh...@cloudfoundry.org
On Tue, Sep 4, 2012 at 6:40 PM, Mike <impres...@gmail.com> wrote:

> It created the stemcell but added the aws_registry, should I add a job that
> add my registry?
>
Yes, you need to create a package and a job for your registry, and you
should also take a look at the jobs/micro_aws directory, as you'll
need to create a similar one for your cloud. This is the job that will
get setup for the micro bosh stemcell you create (based on the cpi you
pass the build command).

Mike

unread,
Sep 4, 2012, 5:52:55 PM9/4/12
to bosh...@cloudfoundry.org
Just as I suppose thank you Martin!

Mike

unread,
Sep 4, 2012, 6:53:52 PM9/4/12
to bosh...@cloudfoundry.org
So I created my package and micro_example, I execute the bosh create release --with-tarball and then in the bosh/agent I execute the rake stemcell2:micro[example,manifest,tar]. Or I can create a release based on the micro_example?

Thanks!

Martin Englund

unread,
Sep 4, 2012, 7:33:46 PM9/4/12
to bosh...@cloudfoundry.org
Did you also create a micro_example job?

when you run, it should be something like this:
cd ~/bosh-release
bosh create release --with-tarball
cd ~/bosh/agent
rake stemcell2:micro[example,~/manifest.yml,~/bosh-release/dev_releases/xxx-1.1-dev.tgz]

/M
--

Mike

unread,
Sep 4, 2012, 7:38:34 PM9/4/12
to bosh...@cloudfoundry.org
Yes, and the tgz and manifest are created well. In the manifest I still can see the aws_registry and vsphere along with mine. I expect that to be ok.

But when I issue the rake stemcell2 with the yml that created the bosh-release as manifest it fails   due unknown CPI (mine). I'm still on it.

Also should I add the installation of git?

#[12460] INFO: Starting agent 0.6.4...
#[12460] INFO: Skipping configuration step (use '-c' argument to configure on start) 
#[12460] INFO: Message processors: {"migrate_disk"=>Bosh::Agent::Message::MigrateDisk, "list_disk"=>Bosh::Agent::Message::ListDisk, "mount_disk"=>Bosh::Agent::Message::MountDisk, "unmount_disk"=>Bosh::Agent::Message::UnmountDisk, "state"=>Bosh::Agent::Message::State, "drain"=>Bosh::Agent::Message::Drain, "apply"=>Bosh::Agent::Message::Apply, "compile_package"=>Bosh::Agent::Message::CompilePackage, "fetch_logs"=>Bosh::Agent::Message::FetchLogs, "ssh"=>Bosh::Agent::Message::Ssh, "ping"=>Bosh::Agent::Message::Ping, "noop"=>Bosh::Agent::Message::Noop, "start"=>Bosh::Agent::Message::Start, "stop"=>Bosh::Agent::Message::Stop, "prepare_network_change"=>Bosh::Agent::Message::PrepareNetworkChange, "release_apply_spec"=>Bosh::Agent::Message::ReleaseApplySpec}
>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on localhost:6969, CTRL+C to stop
sh: git: not found
sh: git: not found
sh: git: not found
sh: git: not found
Error: argument --cpi unknown CPI example


Thank you!


On Tuesday, 4 September 2012 21:48:10 UTC+2, Mike wrote:

Martin Englund

unread,
Sep 4, 2012, 7:42:29 PM9/4/12
to bosh...@cloudfoundry.org
ah, you need to edit the file package_compiler/bin/package_compiler
and change the line:
CPIS = %w[aws openstack vsphere example]

/M

Mike

unread,
Sep 4, 2012, 7:51:21 PM9/4/12
to bosh...@cloudfoundry.org
That was it, I'm now executing.

One error I missed before was cp: cannot stat `/var/tmp/bosh/agent-0.6.4-31017/work/work/chroot//var/vcap/micro/apply_spec.yml': No such file or directory

I guess it is related.

Thanks!

Martin Englund

unread,
Sep 4, 2012, 7:55:33 PM9/4/12
to bosh...@cloudfoundry.org
On Tue, Sep 4, 2012 at 8:51 PM, Mike <impres...@gmail.com> wrote:
> That was it, I'm now executing.
>
Yay!

> One error I missed before was cp: cannot stat
> `/var/tmp/bosh/agent-0.6.4-31017/work/work/chroot//var/vcap/micro/apply_spec.yml':
> No such file or directory
>
> I guess it is related.
>
Right, the compiler outputs an apply_spec.yml which is referenced in
agent/misc/stemcell2/stages/bosh_micro/apply.sh

Mike

unread,
Sep 4, 2012, 8:04:45 PM9/4/12
to bosh...@cloudfoundry.org
Now it completes the process but I think something is wrong with my register looks like the credentials. And it states that no CPI specified.

I, [2012-09-05T00:01:03.893143 #27215]  INFO -- : Compiling /var/vcap/bosh/src/micro_bosh/release.yml with tarball /var/vcap/bosh/src/micro_bosh/release.tgz
127.0.0.1 - - [05/Sep/2012 00:01:03] "POST /agent HTTP/1.1" 401 - 0.0002
#[27208] INFO: Message: {"method"=>"ping", "arguments"=>[], "reply_to"=>"Bosh::Agent::HTTPClient"}
127.0.0.1 - vcap [05/Sep/2012 00:01:03] "POST /agent HTTP/1.1" 200 17 0.0055
WARNING: no CPI specified
D, [2012-09-05T00:01:03.908171 #27215] DEBUG -- : untaring /var/vcap/bosh/src/micro_bosh/release.tgz into /tmp/d20120905-27215-1r5g03w
D, [2012-09-05T00:01:05.070129 #27215] DEBUG -- : stored micro job as 1b79f7f0-dc1e-407e-b3f4-68785c5f92a3
D, [2012-09-05T00:01:05.070688 #27215] DEBUG -- : untaring /tmp/d20120905-27215-1r5g03w/jobs/micro_abiquo.tgz into /tmp/d20120905-27215-1n45z9o
D, [2012-09-05T00:01:05.078148 #27215] DEBUG -- : compiling package nats
D, [2012-09-05T00:01:05.078289 #27215] DEBUG -- : compiling dependency ruby
127.0.0.1 - - [05/Sep/2012 00:01:05] "POST /agent HTTP/1.1" 401 - 0.0001
#[27208] INFO: Message: {"method"=>"compile_package", "arguments"=>["c6526a78-9645-4d30-98d4-08e8affe461f", "sha1", "ruby", 1, {}], "reply_to"=>"Bosh::Agent::HTTPClient"}
127.0.0.1 - vcap [05/Sep/2012 00:01:05] "POST /agent HTTP/1.1" 200 85 0.0018
127.0.0.1 - - [05/Sep/2012 00:01:06] "POST /agent HTTP/1.1" 401 - 0.0004
#[27208] INFO: Message: {"method"=>"get_task", "arguments"=>["d904031e-9aaf-470d-aca4-084ef76e90c9"], "reply_to"=>"Bosh::Agent::HTTPClient"}
127.0.0.1 - vcap [05/Sep/2012 00:01:06] "POST /agent HTTP/1.1" 200 85 0.0020
127.0.0.1 - - [05/Sep/2012 00:01:07] "POST /agent HTTP/1.1" 401 - 0.0003

Thanks

Martin Englund

unread,
Sep 4, 2012, 8:10:29 PM9/4/12
to bosh...@cloudfoundry.org
you need to update compiler.rb:prep_spec and add a section for your
CPI so that it modifies the apply_spec...

/M
--

Mike

unread,
Sep 5, 2012, 11:00:24 AM9/5/12
to bosh...@cloudfoundry.org
Hi,

I0m getting now this error:

sh: git: not found
I, [2012-09-05T09:48:57.959155 #16997]  INFO -- : Compiling /var/vcap/bosh/src/micro_bosh/release.yml with tarball /var/vcap/bosh/src/micro_bosh/release.tgz
127.0.0.1 - - [05/Sep/2012 09:48:57] "POST /agent HTTP/1.1" 401 - 0.0002
#[16990] INFO: Message: {"method"=>"ping", "arguments"=>[], "reply_to"=>"Bosh::Agent::HTTPClient"}
127.0.0.1 - vcap [05/Sep/2012 09:48:57] "POST /agent HTTP/1.1" 200 17 0.0055
D, [2012-09-05T09:48:57.970993 #16997] DEBUG -- : untaring /var/vcap/bosh/src/micro_bosh/release.tgz into /tmp/d20120905-16997-149ds25
D, [2012-09-05T09:48:59.100844 #16997] DEBUG -- : stored micro job as f925d4d4-24fa-4237-bf66-4c6f471f0aa5
D, [2012-09-05T09:48:59.101176 #16997] DEBUG -- : untaring /tmp/d20120905-16997-149ds25/jobs/micro_abiquo.tgz into /tmp/d20120905-16997-10m2bix
D, [2012-09-05T09:48:59.108800 #16997] DEBUG -- : compiling package nats
D, [2012-09-05T09:48:59.109063 #16997] DEBUG -- : compiling dependency ruby
127.0.0.1 - - [05/Sep/2012 09:48:59] "POST /agent HTTP/1.1" 401 - 0.0002
#[16990] INFO: Message: {"method"=>"compile_package", "arguments"=>["d90743b1-37fd-40d5-bbd3-d762e4d360d8", "sha1", "ruby", 1, {}], "reply_to"=>"Bosh::Agent::HTTPClient"}
127.0.0.1 - vcap [05/Sep/2012 09:48:59] "POST /agent HTTP/1.1" 200 85 0.0028
127.0.0.1 - - [05/Sep/2012 09:49:00] "POST /agent HTTP/1.1" 401 - 0.0002
#[16990] INFO: Message: {"method"=>"get_task", "arguments"=>["03d0046e-12c1-4421-a499-11a421634432"], "reply_to"=>"Bosh::Agent::HTTPClient"}
127.0.0.1 - vcap [05/Sep/2012 09:49:00] "POST /agent HTTP/1.1" 200 85 0.0017
127.0.0.1 - - [05/Sep/2012 09:49:01] "POST /agent HTTP/1.1" 401 - 0.0002
#[16990] INFO: Message: {"method"=>"get_task", "arguments"=>["03d0046e-12c1-4421-a499-11a421634432"], "reply_to"=>"Bosh::Agent::HTTPClient"}
127.0.0.1 - vcap [05/Sep/2012 09:49:01] "POST /agent HTTP/1.1" 200 85 0.0011
127.0.0.1 - - [05/Sep/2012 09:49:02] "POST /agent HTTP/1.1" 401 - 0.0002

But looks not related with the subject.

Thank you for your help.

Martin Englund

unread,
Sep 5, 2012, 2:26:54 PM9/5/12
to bosh...@cloudfoundry.org
Mike,

"sh: git: not found" can be ignored, it is just a warning from the
debootstrap command

/M

Alan Sun

unread,
Nov 9, 2012, 1:34:35 AM11/9/12
to bosh...@cloudfoundry.org
Hi Mike,
I've been working on the new CPI thing just like you did. Now i'm stuck in the registry part. What's going on with your own registry now? 


在 2012年9月5日星期三UTC+8上午3时48分10秒,Mike写道:
Reply all
Reply to author
Forward
0 new messages