[Openstack] Bundle running instance?

2011-08-31 Thread Darren Govoni

Hi,
  Is there a tutorial somewhere showing how to re-bundle a running 
instance (e.g. ubuntu)

and register it as a new image in openstack?

thanks,
Darren

___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] Bundle running instance?

2011-08-31 Thread Wayne A. Walls
I think this is probably the best place to start:
http://docs.openstack.org/cactus/openstack-compute/admin/content/creating-a
-linux-image.html
If you find anything that is inaccurate in your efforts, ping
a...@openstack.org and she can get that updated :)

Cheers,


Wayne

On 8/31/11 8:16 AM, Darren Govoni dar...@ontrenet.com wrote:

Hi,
   Is there a tutorial somewhere showing how to re-bundle a running
instance (e.g. ubuntu)
and register it as a new image in openstack?

thanks,
Darren

___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] Bundle running instance?

2011-08-31 Thread Pedro Navarro Pérez
What about the image management in starter guide:

http://docs.openstack.org/cactus/openstack-compute/starter/content/Creating_a_Linux_Image_-_Ubuntu_Fedora-d1e1287.html

On Wed, Aug 31, 2011 at 3:16 PM, Darren Govoni dar...@ontrenet.com wrote:
 Hi,
  Is there a tutorial somewhere showing how to re-bundle a running instance
 (e.g. ubuntu)
 and register it as a new image in openstack?

 thanks,
 Darren

 ___
 Mailing list: https://launchpad.net/~openstack
 Post to     : openstack@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~openstack
 More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] Bundle running instance?

2011-08-31 Thread Wayne A. Walls
Just realized you asked about a running image, not a new one.  Apologies
on that.  I used this script in the past to accomplish bundling a running
instance.  It is likely outdated, but it will give you a good premise to
start:

#!/bin/sh

#words words words
#this is a script for easy image creation

. /root/creds/novarc
SYSTEM=$(uname -r)
read -p Please enter your bucket/container name: BUCKET_NAME

euca-bundle-vol --no-inherit -d /tmp/image -e /mnt, /tmp
losetup /dev/loop3 /tmp/image/image.img
mount /dev/loop3 /mnt
sed -i 
's/^UUID=[a-z0-9]\{8\}-[a-z0-9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]\{
12\}[\t]* \//\/dev\/vda1\t\//1' /mnt/etc/fstab
sed -i 
's/^UUID=[a-z0-9]\{8\}-[a-z0-9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]\{
12\}[\t]* none/\/mnt\/swap.file\tnone/1' /mnt/etc/fstab
cp /mnt/etc/network/interfaces /mnt/root/interfaces.bak
cat  /mnt/etc/network/interfaces  INTERFACE_UPDATE
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
INTERFACE_UPDATE
 

dd if=/dev/zero of=/mnt/swap.file bs=1024 count=512000
sleep 1
mkswap /mnt/swap.file
sleep 1
umount /mnt

euca-bundle-image -i /boot/initrd.img-$SYSTEM -d /tmp/ramdisk --ramdisk
true

euca-bundle-image -i /boot/vmlinuz-$SYSTEM -d /tmp/kernel --kernel true
euca-upload-bundle -m /tmp/kernel/vmlinuz-$SYSTEM.manifest.xml -b
$BUCKET_NAME
euca-upload-bundle -m /tmp/ramdisk/initrd.img-$SYSTEM.manifest.xml -b
$BUCKET_NAME
KERNEL_IMAGE=$(euca-register $BUCKET_NAME/vmlinuz-$SYSTEM.manifest.xml |
awk '{print $2}')
RAMDISK_IMAGE=$(euca-register $BUCKET_NAME/initrd.img-$SYSTEM.manifest.xml
| awk '{print $2}')
euca-bundle-image -i /tmp/image/image.img --kernel $KERNEL_IMAGE --ramdisk
$RAMDISK_IMAGE -d /tmp/imagebuild
euca-upload-bundle -m /tmp/imagebuild/image.img.manifest.xml -b
$BUCKET_NAME
AMI_IMAGE=$(euca-register $BUCKET_NAME/image.img.manifest.xml | awk
'{print $2}'); echo Image is decrypting and untarring for usage.

sleep 180

euca-run-instances $AMI_IMAGE



On 8/31/11 8:16 AM, Darren Govoni dar...@ontrenet.com wrote:

Hi,
   Is there a tutorial somewhere showing how to re-bundle a running
instance (e.g. ubuntu)
and register it as a new image in openstack?

thanks,
Darren

___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] Bundle running instance?

2011-08-31 Thread Darren Govoni

Much appreciated! I will give it a try.

On 08/31/2011 10:46 AM, Wayne A. Walls wrote:

Just realized you asked about a running image, not a new one.  Apologies
on that.  I used this script in the past to accomplish bundling a running
instance.  It is likely outdated, but it will give you a good premise to
start:

#!/bin/sh

#words words words
#this is a script for easy image creation

. /root/creds/novarc
SYSTEM=$(uname -r)
read -p Please enter your bucket/container name: BUCKET_NAME

euca-bundle-vol --no-inherit -d /tmp/image -e /mnt, /tmp
losetup /dev/loop3 /tmp/image/image.img
mount /dev/loop3 /mnt
sed -i
's/^UUID=[a-z0-9]\{8\}-[a-z0-9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]\{
12\}[\t]* \//\/dev\/vda1\t\//1' /mnt/etc/fstab
sed -i
's/^UUID=[a-z0-9]\{8\}-[a-z0-9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]\{
12\}[\t]* none/\/mnt\/swap.file\tnone/1' /mnt/etc/fstab
cp /mnt/etc/network/interfaces /mnt/root/interfaces.bak
cat  /mnt/etc/network/interfaces  INTERFACE_UPDATE
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
INTERFACE_UPDATE


dd if=/dev/zero of=/mnt/swap.file bs=1024 count=512000
sleep 1
mkswap /mnt/swap.file
sleep 1
umount /mnt

euca-bundle-image -i /boot/initrd.img-$SYSTEM -d /tmp/ramdisk --ramdisk
true

euca-bundle-image -i /boot/vmlinuz-$SYSTEM -d /tmp/kernel --kernel true
euca-upload-bundle -m /tmp/kernel/vmlinuz-$SYSTEM.manifest.xml -b
$BUCKET_NAME
euca-upload-bundle -m /tmp/ramdisk/initrd.img-$SYSTEM.manifest.xml -b
$BUCKET_NAME
KERNEL_IMAGE=$(euca-register $BUCKET_NAME/vmlinuz-$SYSTEM.manifest.xml |
awk '{print $2}')
RAMDISK_IMAGE=$(euca-register $BUCKET_NAME/initrd.img-$SYSTEM.manifest.xml
| awk '{print $2}')
euca-bundle-image -i /tmp/image/image.img --kernel $KERNEL_IMAGE --ramdisk
$RAMDISK_IMAGE -d /tmp/imagebuild
euca-upload-bundle -m /tmp/imagebuild/image.img.manifest.xml -b
$BUCKET_NAME
AMI_IMAGE=$(euca-register $BUCKET_NAME/image.img.manifest.xml | awk
'{print $2}'); echo Image is decrypting and untarring for usage.

sleep 180

euca-run-instances $AMI_IMAGE



On 8/31/11 8:16 AM, Darren Govonidar...@ontrenet.com  wrote:


Hi,
   Is there a tutorial somewhere showing how to re-bundle a running
instance (e.g. ubuntu)
and register it as a new image in openstack?

thanks,
Darren

___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp





___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp


Re: [Openstack] Bundle running instance?

2011-08-31 Thread Everett Toews
We have a similar script at

https://github.com/canarie/vm-toolkit/blob/master/bundle/vmbundle.py

that tries to take the pain out of bundling a running instance for our more
naive users.

Everett

On Wed, Aug 31, 2011 at 8:48 AM, Darren Govoni dar...@ontrenet.com wrote:

 Much appreciated! I will give it a try.


 On 08/31/2011 10:46 AM, Wayne A. Walls wrote:

 Just realized you asked about a running image, not a new one.  Apologies
 on that.  I used this script in the past to accomplish bundling a running
 instance.  It is likely outdated, but it will give you a good premise to
 start:

 #!/bin/sh

 #words words words
 #this is a script for easy image creation

 . /root/creds/novarc
 SYSTEM=$(uname -r)
 read -p Please enter your bucket/container name: BUCKET_NAME

 euca-bundle-vol --no-inherit -d /tmp/image -e /mnt, /tmp
 losetup /dev/loop3 /tmp/image/image.img
 mount /dev/loop3 /mnt
 sed -i
 's/^UUID=[a-z0-9]\{8\}-[a-z0-**9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]**
 \{4\}-[a-z0-9]\{
 12\}[\t]* \//\/dev\/vda1\t\//1' /mnt/etc/fstab
 sed -i
 's/^UUID=[a-z0-9]\{8\}-[a-z0-**9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]**
 \{4\}-[a-z0-9]\{
 12\}[\t]* none/\/mnt\/swap.file\tnone/1' /mnt/etc/fstab
 cp /mnt/etc/network/interfaces /mnt/root/interfaces.bak
 cat  /mnt/etc/network/interfaces  INTERFACE_UPDATE
 # The loopback network interface
 auto lo
 iface lo inet loopback

 # The primary network interface
 auto eth0
 iface eth0 inet dhcp
 INTERFACE_UPDATE


 dd if=/dev/zero of=/mnt/swap.file bs=1024 count=512000
 sleep 1
 mkswap /mnt/swap.file
 sleep 1
 umount /mnt

 euca-bundle-image -i /boot/initrd.img-$SYSTEM -d /tmp/ramdisk --ramdisk
 true

 euca-bundle-image -i /boot/vmlinuz-$SYSTEM -d /tmp/kernel --kernel true
 euca-upload-bundle -m /tmp/kernel/vmlinuz-$SYSTEM.**manifest.xml -b
 $BUCKET_NAME
 euca-upload-bundle -m /tmp/ramdisk/initrd.img-$**SYSTEM.manifest.xml -b
 $BUCKET_NAME
 KERNEL_IMAGE=$(euca-register $BUCKET_NAME/vmlinuz-$SYSTEM.**manifest.xml
 |
 awk '{print $2}')
 RAMDISK_IMAGE=$(euca-register $BUCKET_NAME/initrd.img-$**
 SYSTEM.manifest.xml
 | awk '{print $2}')
 euca-bundle-image -i /tmp/image/image.img --kernel $KERNEL_IMAGE --ramdisk
 $RAMDISK_IMAGE -d /tmp/imagebuild
 euca-upload-bundle -m /tmp/imagebuild/image.img.**manifest.xml -b
 $BUCKET_NAME
 AMI_IMAGE=$(euca-register $BUCKET_NAME/image.img.**manifest.xml | awk
 '{print $2}'); echo Image is decrypting and untarring for usage.

 sleep 180

 euca-run-instances $AMI_IMAGE



 On 8/31/11 8:16 AM, Darren Govonidar...@ontrenet.com  wrote:

  Hi,
   Is there a tutorial somewhere showing how to re-bundle a running
 instance (e.g. ubuntu)
 and register it as a new image in openstack?

 thanks,
 Darren

 __**_
 Mailing list: 
 https://launchpad.net/~**openstackhttps://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : 
 https://launchpad.net/~**openstackhttps://launchpad.net/~openstack
 More help   : 
 https://help.launchpad.net/**ListHelphttps://help.launchpad.net/ListHelp




 __**_
 Mailing list: 
 https://launchpad.net/~**openstackhttps://launchpad.net/~openstack
 Post to : openstack@lists.launchpad.net
 Unsubscribe : 
 https://launchpad.net/~**openstackhttps://launchpad.net/~openstack
 More help   : 
 https://help.launchpad.net/**ListHelphttps://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp