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:
euca-describe-instances
The output will be like
RESERVATION r-0lx3wbp5 18805ef3acf14b5d82e11e552b92d213 default INSTANCE i-00000009 ami-00000009 10.0.0.227 test running None (18805ef3acf14b5d82e11e552b92d213, openstack) 0 m1.tiny 2012-08-24T06:14:43.000Z nova monitoring-disabled 10.0.0.227 192.168.4.36 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.