ankurcha / stemcell

[DEAD] A command line tool to create new Bosh stemcells
https://github.com/cloudfoundry/bosh
MIT License
7 stars 4 forks source link

Error: Final stage of stemcell creation. #13

Closed harikrishna1210 closed 11 years ago

harikrishna1210 commented 11 years ago

Hi, I got this error at final stage of the stemcell creation.Can you suggest me please what thing gone wrong.

Command:

/root/creation/stemcell/bin/stemcell build ubuntu --name=bosh-stemcell --prefix=~/creation/usage --architecture=x86_64 --infrastructure=vsphere --target=~/creation/final --agent-src-path=~/bosh/bosh_agent --agent-version=1.5.0.pre2 --iso=~/creation/usage/iso/ubuntu-10.04-server-amd64.iso --iso-md5=8ee25c78f4c66610b6872a05ee9ad81b --gui=true --definitions-dir=~/creation/usage/definations --log-level=DEBUG

It's executed properly and shown preview vm window and able to see the operations going on,finally it's executed all most 3 hours,exited with this below errors.

Error:

   Executing command: 
The box bosh-stemcell was build successfully!
You can now login to the box with:
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 7222 -l vcap 127.0.0.1
D, [2013-03-01T17:56:20.317132 #10526] DEBUG -- : true
I, [2013-03-01T17:56:22.557832 #10526]  INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out 
D, [2013-03-01T17:56:22.558062 #10526] DEBUG -- : Failed to download /var/vcap/bosh/stemcell_dpkg_l.out
I, [2013-03-01T17:56:24.558329 #10526]  INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out 
D, [2013-03-01T17:56:24.558759 #10526] DEBUG -- : Failed to download /var/vcap/bosh/stemcell_dpkg_l.out
I, [2013-03-01T17:56:26.559123 #10526]  INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out 
D, [2013-03-01T17:56:26.559552 #10526] DEBUG -- : Failed to download /var/vcap/bosh/stemcell_dpkg_l.out
I, [2013-03-01T17:56:28.559861 #10526]  INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out 
D, [2013-03-01T17:56:28.560297 #10526] DEBUG -- : Failed to download /var/vcap/bosh/stemcell_dpkg_l.out
I, [2013-03-01T17:56:30.560636 #10526]  INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out 
D, [2013-03-01T17:56:30.561067 #10526] DEBUG -- : Failed to download /var/vcap/bosh/stemcell_dpkg_l.out
I, [2013-03-01T17:56:30.561204 #10526]  INFO -- : Export built VM bosh-stemcell to /root/creation/usage
[bosh-stemcell] Vagrant requires the box to be shutdown, before it can export
[bosh-stemcell] Sudo also needs to work for user vcap
[bosh-stemcell] Performing a clean shutdown now.
[bosh-stemcell] Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
[bosh-stemcell] Executing command: echo 'shutdown -P now' > /tmp/shutdown.sh
[bosh-stemcell] Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
[bosh-stemcell] Executing command: chmod +x /tmp/shutdown.sh
[bosh-stemcell] Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
[bosh-stemcell] Executing command: echo 'c1oudc0w'|sudo -S /bin/bash '/tmp/shutdown.sh'
[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] 
[bosh-stemcell] Machine bosh-stemcell is powered off cleanly
[bosh-stemcell] Executing vagrant voodoo:
[bosh-stemcell] vagrant package --base 'bosh-stemcell' --output 'bosh-stemcell.box'

[bosh-stemcell] 
[bosh-stemcell] To import it into vagrant type:
[bosh-stemcell] vagrant box add 'bosh-stemcell' 'bosh-stemcell.box'
[bosh-stemcell] 
[bosh-stemcell] To use it:
[bosh-stemcell] vagrant init 'bosh-stemcell'
[bosh-stemcell] vagrant up
[bosh-stemcell] vagrant ssh
D, [2013-03-01T17:58:13.361266 #10526] DEBUG -- : true
/root/creation/stemcell/lib/stemcell/builder.rb:245:in `sh': Unable to unpack .box file (RuntimeError)
    from /root/creation/stemcell/lib/stemcell/builder.rb:136:in `block in generate_image'
    from /root/creation/stemcell/lib/stemcell/builder.rb:135:in `chdir'
    from /root/creation/stemcell/lib/stemcell/builder.rb:135:in `generate_image'
    from /root/creation/stemcell/lib/stemcell/builder.rb:120:in `package_stemcell'
    from /root/creation/stemcell/lib/stemcell/builder.rb:154:in `run'
    from /root/creation/stemcell/bin/stemcell:46:in `ubuntu'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor.rb:344:in `dispatch'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/invocation.rb:109:in `invoke'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor.rb:214:in `block in subcommand'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor.rb:344:in `dispatch'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/base.rb:434:in `start'
    from /root/creation/stemcell/bin/stemcell:142:in `<main>'

Note: I under stood it's final stage of the stemcell creation,Please help me what to do here.I given name of the stemcell as bosh_stemcell.What is username and password of this virtual machine,I didn't given any thing.I tried username and password as "bosh-stemcell" it's saying incorrect login.Can you please tell me what is the username and password of virtual machine.

Thanks, Hari.

ankurcha commented 11 years ago

The default username is vcap and password is c1oudc0w

ankurcha commented 11 years ago

I have never seen this particular error. I will attempt to reproduce this.

harikrishna1210 commented 11 years ago

hi, Did you got any clue please send me reply,Then i will follow that steps for creation of stemcell.

ankurcha commented 11 years ago

I haven't been able to reproduce this error. I have been able to build stemcells about 15 times since this bug was opened. Any chance there is some other process that is interacting or you running out of disk space? This step is simply untaring the .box file, nothing special.

harikrishna1210 commented 11 years ago

Sorry,I am not getting about this line "Any chance there is some other process that is interacting or you running out of disk space?",I am not running any process,I am running this stemcell creation process in ubuntu12.04LTS Desktop,I have 90 GB Storage in my system for ubuntu.In case i able to login into inside the virtual machine,Is there any possibility to do remaining steps,means directly creation of the stemcell tgz file.Now i have vm with name bosh-stemcell,Once again i executed the stemcell command with same name,It will take the existing one or it will start from beginning on words?

ankurcha commented 11 years ago

My point was, is there a possibility that something else was running on the machine and was messing up the final steps. It seems like there is nothing. You are correct though, the process has ended and if want you could essentially export the vm to ovf and package the vmdk and ovf file with a valid stemcell.MF into a tar.gz file.

Is this happening consistently?

harikrishna1210 commented 11 years ago

Means "My point was, is there a possibility that something else was running on the machine and was messing up the final steps" that process is in host OS or guest OS(Means in newly created virtual machine).In newly created vm is there any check is there,Means certain files as check list then i will check that files in newly created vm then we will know it's created properly or not.

And can you please tell me where you are executing the stemcell creation steps(which OS) and for which OS you created stemcell (centos/ubuntu) in your trails. Can you give me your stemcell creation command.This below command i am using for stemcell creation.Can you please check this command is right.

/root/creation/stemcell/bin/stemcell build ubuntu --name=bosh-stemcell --prefix=~/creation/usage --architecture=x86_64 --infrastructure=vsphere --target=~/creation/final --agent-src-path=~/bosh/bosh_agent --agent-version=1.5.0.pre2 --iso=~/creation/usage/iso/ubuntu-10.04-server-amd64.iso --iso-md5=8ee25c78f4c66610b6872a05ee9ad81b --gui=true --definitions-dir=~/creation/usage/definations --log-level=DEBUG

i have vm with name bosh-stemcell,Once again i executed the stemcell command with same name,It will take the existing one or it will start from beginning on words?

harikrishna1210 commented 11 years ago

Today i will try to create stemcell for the centos also i will see what happen,Till now i tried for ubuntu.If any problem is there i will send a mail and follow up you.I am from "INDIA" that's why times are little inconvenient for me to follow up.Now here 6 AM.

harikrishna1210 commented 11 years ago

I executed same command and posting more output:

Done with /usr/src/vmware-tools-vmci-modules-2.6.32-21-server_9.0.3.0-2_amd64.deb .
+ module-assistant install vmware-tools-vmci-modules-source
Selecting previously deselected package vmware-tools-vmci-modules-2.6.32-21-server.
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 95%
(Reading database ... 46527 files and directories currently installed.)
Unpacking vmware-tools-vmci-modules-2.6.32-21-server (from .../vmware-tools-vmci-modules-2.6.32-21-server_9.0.3.0-2_amd64.deb) ...
Setting up vmware-tools-vmci-modules-2.6.32-21-server (9.0.3.0-2) ...
update-initramfs: Generating /boot/initrd.img-2.6.32-21-server
vmci start/running

Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
Executing command: 
Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
Executing command: echo 'c1oudc0w'|sudo -S /bin/bash './network-cleanup.sh'
+ echo 'cleaning up dhcp leases'
cleaning up dhcp leases
+ rm /var/lib/dhcp3/dhclient.eth0.leases /var/lib/dhcp3/dhclient.leases
+ echo 'cleaning up udev rules'
cleaning up udev rules
+ rm /etc/udev/rules.d/70-persistent-net.rules
+ mkdir /etc/udev/rules.d/70-persistent-net.rules
+ rm -rf /dev/.udev/
+ rm /lib/udev/rules.d/75-persistent-net-generator.rules
+ echo 'Adding a 2 sec delay to the interface up, to make the dhclient happy'
Adding a 2 sec delay to the interface up, to make the dhclient happy
+ echo 'pre-up sleep 2'
Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
Executing command: 
Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
Executing command: echo 'c1oudc0w'|sudo -S /bin/bash './zero-disk.sh'
+ apt-get clean
+ apt-get autoremove
Reading package lists... 0%
Reading package lists... 23%
Reading package lists... Done
Building dependency tree... 0%
Building dependency tree... 50%
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 91 not upgraded.
+ dd if=/dev/zero of=/EMPTY bs=1M

dd: writing `/EMPTY': No space left on device
7728+0 records in
7727+0 records out
8103129088 bytes (8.1 GB) copied, 142.575 s, 56.8 MB/s
+ rm -f /EMPTY
Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
Executing command: 
Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
Executing command: echo 'c1oudc0w'|sudo -S /bin/bash './harden.sh'
+ find / -xdev -perm +6000 -a -type f -a -not '(' -name sudo -o -name su -o -name sudoedit ')' -exec chmod ug-s '{}' ';'
Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
Executing command: 
Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
Executing command: echo 'c1oudc0w'|sudo -S /bin/bash './postinstall.sh'
+ source _variables.sh
++ bosh_app_dir=/var/vcap
++ bosh_dir=/var/vcap/bosh
++ bosh_users_password=c1owdc0w
++ system_parameters_infrastructure=vsphere
+++ pwd
++ SRC_DIR=/home/vcap
++ '[' '!' -d /var/vcap/bosh ']'
+ cp /home/vcap/_sysstat /etc/default/sysstat
+ cp /home/vcap/_60-bosh-sysctl.conf /etc/sysctl.d/60-bosh-sysctl.conf
+ chmod 0644 /etc/sysctl.d/60-bosh-sysctl.conf
+ mkdir -p /var/vcap/bosh/log
+ cp /home/vcap/_ntpdate /var/vcap/bosh/bin/ntpdate
+ chmod 0755 /var/vcap/bosh/bin/ntpdate
+ echo '0,15,30,45 * * * * /var/vcap/bosh/bin/ntpdate'
+ crontab -u root /tmp/ntpdate.cron
+ rm /tmp/ntpdate.cron
+ echo -n vsphere
+ dpkg -l
+ rm -f _60-bosh-sysctl.conf _monitrc _ntpdate _sysstat _empty_state.yml _variables.sh _helpers.sh _bosh_agent.tar
+ rm -f timestamp.sh apt-upgrade.sh sudo.sh setup-bosh.sh base-stemcell.sh monit.sh ruby.sh bosh_agent.sh vmware-tools.sh network-cleanup.sh
+ rm -f zero-disk.sh harden.sh postinstall.sh VBoxGuestAdditions_4.2.6.iso '*.gem'
+ mkdir -p /etc/local/runonce.d/ran
+ cp /home/vcap/_runonce /usr/local/bin/runonce
+ chmod +x /usr/local/bin/runonce
+ /usr/local/bin/runonce 'rm -f /etc/ssh/ssh_host_*'
logname: no login name
+ /usr/local/bin/runonce 'dpkg-reconfigure -fnoninteractive -pcritical openssh-server'
logname: no login name
Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
Executing command: 
The box bosh-stemcell was build successfully!
You can now login to the box with:
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 7222 -l vcap 127.0.0.1
D, [2013-03-06T14:10:53.145636 #24050] DEBUG -- : true
I, [2013-03-06T14:10:55.384075 #24050]  INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out 
D, [2013-03-06T14:10:55.384459 #24050] DEBUG -- : Failed to download /var/vcap/bosh/stemcell_dpkg_l.out
I, [2013-03-06T14:10:57.384782 #24050]  INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out 
D, [2013-03-06T14:10:57.385244 #24050] DEBUG -- : Failed to download /var/vcap/bosh/stemcell_dpkg_l.out
I, [2013-03-06T14:10:59.385526 #24050]  INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out 
D, [2013-03-06T14:10:59.385932 #24050] DEBUG -- : Failed to download /var/vcap/bosh/stemcell_dpkg_l.out
I, [2013-03-06T14:11:01.386148 #24050]  INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out 
D, [2013-03-06T14:11:01.386324 #24050] DEBUG -- : Failed to download /var/vcap/bosh/stemcell_dpkg_l.out
I, [2013-03-06T14:11:03.386483 #24050]  INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out 
D, [2013-03-06T14:11:03.386725 #24050] DEBUG -- : Failed to download /var/vcap/bosh/stemcell_dpkg_l.out
I, [2013-03-06T14:11:03.386805 #24050]  INFO -- : Export built VM bosh-stemcell to /root/creation/usage
[bosh-stemcell] Vagrant requires the box to be shutdown, before it can export
[bosh-stemcell] Sudo also needs to work for user vcap
[bosh-stemcell] Performing a clean shutdown now.
[bosh-stemcell] Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
[bosh-stemcell] Executing command: echo 'shutdown -P now' > /tmp/shutdown.sh
[bosh-stemcell] Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
[bosh-stemcell] Executing command: chmod +x /tmp/shutdown.sh
[bosh-stemcell] Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec
.
[bosh-stemcell] Executing command: echo 'c1oudc0w'|sudo -S /bin/bash '/tmp/shutdown.sh'
[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] 
[bosh-stemcell] Machine bosh-stemcell is powered off cleanly
[bosh-stemcell] Executing vagrant voodoo:
[bosh-stemcell] vagrant package --base 'bosh-stemcell' --output 'bosh-stemcell.box'
[bosh-stemcell] 
[bosh-stemcell] To import it into vagrant type:
[bosh-stemcell] vagrant box add 'bosh-stemcell' 'bosh-stemcell.box'
[bosh-stemcell] 
[bosh-stemcell] To use it:
[bosh-stemcell] vagrant init 'bosh-stemcell'
[bosh-stemcell] vagrant up
[bosh-stemcell] vagrant ssh
D, [2013-03-01T17:58:13.361266 #10526] DEBUG -- : true
/root/creation/stemcell/lib/stemcell/builder.rb:245:in `sh': Unable to unpack .box file (RuntimeError)
    from /root/creation/stemcell/lib/stemcell/builder.rb:136:in `block in generate_image'
    from /root/creation/stemcell/lib/stemcell/builder.rb:135:in `chdir'
    from /root/creation/stemcell/lib/stemcell/builder.rb:135:in `generate_image'
    from /root/creation/stemcell/lib/stemcell/builder.rb:120:in `package_stemcell'
    from /root/creation/stemcell/lib/stemcell/builder.rb:154:in `run'
    from /root/creation/stemcell/bin/stemcell:46:in `ubuntu'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor.rb:344:in `dispatch'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/invocation.rb:109:in `invoke'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor.rb:214:in `block in subcommand'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor.rb:344:in `dispatch'
    from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/base.rb:434:in `start'
    from /root/creation/stemcell/bin/stemcell:142:in `<main>'
harikrishna1210 commented 11 years ago

Hi,

By observing above log i came to two assumptions: 1)After execution "postinstall.sh", scp not able download "stemcell_dpkg_l.out" file. 2)properly creating bosh-stemcell.box file in prefix folder and unable unpack.When tried to extract in terminal also what command you used in the code.It giving error,posting that error,May be please check this one it will help us to resole this issue.

tar -xzf bosh-stemcell.box gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now

If found any root cause please give me reply,It's help allot to me. I will wait for your reply.

Thanks, Hari.

ankurcha commented 11 years ago

That's interesting. If the vm is still running can you try to ssh into it. Use ssh -p 7222 -l vcap 127.0.0.1 and c1oudc0w as password.

harikrishna1210 commented 11 years ago

Hi, yaaaa,it's working.Day before yesterday i rebooted my system and yesterday came and opened.Then i did like below. vboxmanage startvm 'bosh-stemcell' Then it's opened this vm in oracle virtual box and i able to login at this place and i executed my host terminal like below,That one also worked. ssh -p 7222 vcap@127.0.0.1 and c1oudc0w as password.

After login i able to see /var/vcap/bosh folder and /var/vcap/bosh/stemcell_dpkg_l.out" and when stemcell execution time i logged in into vm i saw lot of shell scripts placed in /home/vcap foleder aslo.

Thanks, Hari.

harikrishna1210 commented 11 years ago

HI, what can i do now,Can i take new stemcell repo code and try once again same steps or any thing else can i do now.Please suggest me what need to be done at this point of time.

Thanks, Hari.

ankurcha commented 11 years ago

You should be good to take the current head from the repo and it will be pretty solid. I think we are pretty near the first release.

harikrishna1210 commented 11 years ago

Ok,I will check with new code.But was doubt about these steps.

1) /usr/local/bin/runonce "rm -f /etc/ssh/ssh_host_*" This above step has to delete the file start with ssh_host__,But it's not deleting.Manually executed it's deleting properly. rm -f /etc/ssh/ssh_host__ /usr/local/bin/runonce "dpkg-reconfigure -fnoninteractive -pcritical openssh-server" Can you check it once these steps are right.

2)Tool supporting for cent os also,Till now I used for ubuntu only. 3)What's the reason today after started the vm,tried to connect the vm,Getting below error.

ssh -p 7222 vcap@127.0.0.01
ssh: connect to host 127.0.0.01 port 7222: Connection refused

4)If any thing is gone wrong ,I will post the issue and get back to you

Thanks for your help.

Thanks, Hari.

ankurcha commented 11 years ago

The commands are correct. The /usr/local/bin/runonce script executes the command exactly once when the machine is restarted. This is done so that the hostkey is deleted once vm is initialized for the first time. This means that if you manually try doing an ssh i.e. without using bosh_agent to reconfigure the system. Things will just fail.

/usr/local/bin/runonce "rm -f /etc/ssh/ssh_host_*" Deletes the old SSH host key /usr/local/bin/runonce "dpkg-reconfigure -fnoninteractive -pcritical openssh-server" Regenerates a new SSH host key

If you want to ssh into the box after you have created the stemcell. Perform the reboot and login via the console. Then you should be able to ssh into the box with the default username and password.

harikrishna1210 commented 11 years ago

Ok, Now started execution stemcell command from new code,After completion of this i will send status. Thanks, Hari.

harikrishna1210 commented 11 years ago

Hi, I executed every thing freshly,now the code is giving only one error.

Error:

Executing command: The box bosh-stemcell was build successfully! You can now login to the box with: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 7222 -l vcap 127.0.0.1 D, [2013-03-07T15:06:04.639973 #5384] DEBUG -- : true I, [2013-03-07T15:06:04.911573 #5384] INFO -- : Copying vcap:c1oudc0w@127.0.0.1:7222 /var/vcap/bosh/stemcell_dpkg_l.out > /root/creation/usage/stemcell_dpkg_l.out I, [2013-03-07T15:06:05.149383 #5384] INFO -- : Export built VM bosh-stemcell to /root/creation/usage [bosh-stemcell] Vagrant requires the box to be shutdown, before it can export [bosh-stemcell] Sudo also needs to work for user vcap [bosh-stemcell] Performing a clean shutdown now. [bosh-stemcell] Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec . [bosh-stemcell] Executing command: echo 'shutdown -P now' > /tmp/shutdown.sh [bosh-stemcell] Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec . [bosh-stemcell] Executing command: chmod +x /tmp/shutdown.sh [bosh-stemcell] Waiting for ssh login on 127.0.0.1 with user vcap to sshd on port => 7222 to work, timeout=10000 sec . [bosh-stemcell] Executing command: echo 'c1oudc0w'|sudo -S /bin/bash '/tmp/shutdown.sh' [bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] .[bosh-stemcell] [bosh-stemcell] Machine bosh-stemcell is powered off cleanly [bosh-stemcell] Executing vagrant voodoo: [bosh-stemcell] vagrant package --base 'bosh-stemcell' --output 'bosh-stemcell.box' [bosh-stemcell] [bosh-stemcell] To import it into vagrant type: [bosh-stemcell] vagrant box add 'bosh-stemcell' 'bosh-stemcell.box' [bosh-stemcell] [bosh-stemcell] To use it: [bosh-stemcell] vagrant init 'bosh-stemcell' [bosh-stemcell] vagrant up [bosh-stemcell] vagrant ssh D, [2013-03-07T15:07:50.202402 #5384] DEBUG -- : true

gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now /root/creation/stemcell/lib/stemcell/builder.rb:245:in sh': Unable to unpack .box file (RuntimeError) from /root/creation/stemcell/lib/stemcell/builder.rb:136:inblock in generate_image' from /root/creation/stemcell/lib/stemcell/builder.rb:135:in chdir' from /root/creation/stemcell/lib/stemcell/builder.rb:135:ingenerate_image' from /root/creation/stemcell/lib/stemcell/builder.rb:120:in package_stemcell' from /root/creation/stemcell/lib/stemcell/builder.rb:154:inrun' from /root/creation/stemcell/bin/stemcell:43:in ubuntu' from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/task.rb:27:inrun' from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/invocation.rb:120:in invoke_task' from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor.rb:344:indispatch' from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/invocation.rb:109:in invoke' from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor.rb:214:inblock in subcommand' from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/task.rb:27:in run' from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/invocation.rb:120:ininvoke_task' from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor.rb:344:in dispatch' from /root/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/thor-0.17.0/lib/thor/base.rb:434:instart' from /root/creation/stemcell/bin/stemcell:139:in `

'

Note: Only this is failing,You are trying unpack the the "bosh-semcell.box" file,But it's giving error.Can you check once this part of code it self and tell me what it's going wrong.I will wait for your reply.

Thanks, Hari.

harikrishna1210 commented 11 years ago

Hi, You can change to the code,like below it's worked for me.

tar -xvf bosh-stemcell.box insted of tar -xzf bosh-stemcell.box

See O/P:

tar xvf bosh-stemcell.box 
box-disk1.vmdk
Vagrantfile
box.ovf

Thanks, Hari.

harikrishna1210 commented 11 years ago

Hi, Thanks for giving your valuable support in resolving issues.Finally able to create ubuntu stemcell.I think for centos also we can able to create,after trail get back to you with status.

Thanks, Hari.

ankurcha commented 11 years ago

Thanks. Fix has been pushed.