Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

upload keys to local machine in to .euca directory

Bundle & upload to Eucalyptus my VM 'from within'
* copy private key & certificate to some directory you do NOT want to distribute those with the VM image. Make sure you do not leve them somewhere else on VM - the whole world will hack you later

sudo mkdir /mnt/eucaBuild/
* copy there euca2-yourName-e3e764-cert.pem euca2-yourName-e3f64-pk.pem cloud-cert.pem eucars.csh
* set enviromental variables by source eucars.csh

* setup working directory for the bundle which will be excluded from the bundle

sudo mkdir /image

* Bundle local VM , will take 1-2 hours ..., you may need to specify the kernel & ramdisk (values below worked in November 2010). For the 64-bit VM is generated below:
>sudo euca-bundle-vol -c $EC2_CERT -k $EC2_PRIVATE_KEY -u $EC2_USER_ID --ec2cert $EUCALYPTUS_CERT -d /image -e /image --no-inherit -r x86_64 --kernel eki-AEC117E0 --ramdisk eri-175C1933 --fstab /mnt/eucaBuild/euca-vfstab
For 32-bit image change kernel to:
>sudo euca-bundle-vol -c $EC2_CERT -k $EC2_PRIVATE_KEY -u $EC2_USER_ID --ec2cert $EUCALYPTUS_CERT -d /image -e /image --no-inherit -r i386 --kernel eki-B15217F6 --ramdisk eri-19791933
OUTPUT:
....
Part: image.part.245
Part: image.part.246
Part: image.part.247
Generating manifest

* uplad bundle to Eucalyptus with name 'star-vm-SL10c-ubuntu-i386', will take many hours depending on connection & total size
> sudo euca-upload-bundle -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY --url $S3_URL --ec2cert $EUCALYPTUS_CERT -m /image/image.manifest.xml -b star-vm-SL10c-ubuntu-64bit
OUTPUT:
....
Uploading part: image.part.246
Uploading part: image.part.247
Uploaded image as star-vm-SL10c-ubuntu-i386/image.manifest.xml

* register 'star-vm-SL10c-ubuntu-i386' with Eucalyptus
> euca-register -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY --url $EC2_URL star-vm-SL10c-ubuntu-64bit/image.manifest.xml
OUTPUT:
IMAGE emi-344D1244

Potential problems:

  • synchronization of local clock, can be fixed with command
    > sudo ntpdate hickory.nersc.gov
  • check if key-pair generation succeded, list content of 'balewski-euca.private'  if it does not look like a valid key and you can't find the old key you can remove the old public key from Eucalyptus using command euca-delete-keypair
  • if you can't ssh to a custom made VM and see the error
    ssh: connect to host 128.55.56.63 port 22: Connection refused
    verify the ssh server is running on a local copy on this VM by typing:
    ssh localhost
    If you see the same error install ssh server- on Ubuntu do:
    sudo apt-get install openssh-server openssh-client
  • ssh fails:  check content of the console:  euca-get-console-output 'image-id'

...

USE of existing images : http://magellan.nersc.gov/?page_id=564

...