Cloud · Image Management · OpenStack

Bundling an OpenStack image from a running Instance at administration level

Sometimes we would need an image directly bundled from a running instance. In that case we can use the following steps to bundle an image.

Find the ID of the instance using the command:


The output will be like

RESERVATION r-0lx3wbp5 18805ef3acf14b5d82e11e552b92d213 default
INSTANCE i-00000009 ami-00000009 test running None (18805ef3acf14b5d82e11e552b92d213, openstack) 0 m1.tiny 2012-08-24T06:14:43.000Z nova monitoring-disabled instance-store

The instance ID is will be in the format i-00000xxx. Make a note of the instance ID.

We need to find the image file relevant to the running instance now. For example if the instance id is  i-00000009 then the relevant image file will be present in the folder /var/lib/nova/instances/instance-00000009

Copy the image file to present folder

cp /var/lib/nova/instances/instance-00000009/disk .

Now convert the file to relevant format

kvm-img convert -O qcow2 disk disk.img

Upload the image to glance

glance add name="Image-from-instance" is_public=true container_format=ovf disk_format=qcow2 <disk.img

Instances can now be started from this image.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s