Issue with glance image created from volume

asked 2017-07-12 06:07:59 -0500

Deepa gravatar image

updated 2017-07-14 10:51:28 -0500

We are facing an issue with glance image created from volume Whenever we are converting any instance volume to an image, the next instance we make from that image requires more virtual disk size than the existing disk size it was having when the image was created.

In other words instance disk size should be always more than images virtual disk size.

Getting this error Image * is unacceptable: Image virtual size is 11GB and doesn't fit in a volume of size 10GB.

When checked virtual size of qemu-img info its actualy 10G.

image: *** file format: qcow2 virtual size: 10G (10737418240 bytes) <<<<< disk size: 4.7G cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false

Then i tried to compress it

image: *** file format: qcow2 virtual size: 10G (10737418240 bytes) <<<<<<<<<<<< Virtual disk size didnt change disk size: 2.1G <<<<<<<<<<<<< cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false

http://www.tuxfixer.com/how-to-shrink-openstack-qcow2-image-with-qemu-img/ (http://www.tuxfixer.com/how-to-shrink...)

edit retag flag offensive close merge delete

Comments

1

how do you convert an "instance volume" to an image, and what command produces the error message that the image doesn't fit the volume of size 10GB?

Perhaps the command qemu-img resize yields a better result.

Or: If the original is a volume, clone it with openstack volume create --source.

Bernd Bausch gravatar imageBernd Bausch ( 2017-07-12 07:34:21 -0500 )edit

I am converting an instance volume to image from GUI ,using upload to image option under the volume corresponding to instance.qemu-img resize is not working for qcow2 image ,it needs to be in raw format.

Deepa gravatar imageDeepa ( 2017-07-13 00:29:22 -0500 )edit

imagine the disks in the flavor is 20Gb and we installed Ubuntu using 20Gb as volume size,VM created fine, later after doing some changes to instance i converted this instance os disk to qcow2 image and then again try launching it with flavour disk of 20GB size. this time instance creating got fails

Deepa gravatar imageDeepa ( 2017-07-13 00:30:43 -0500 )edit

Tried to create a volume from Image (Image created from volume of 20G) using command openstack volume create --image **7 --size 20 --availability-zone nova my-new-volume and volume got errored out ,but if i give size more than 20 i am able to create it

Deepa gravatar imageDeepa ( 2017-07-13 00:55:59 -0500 )edit

1, Create instance from "Boot from image, Create new volume" option

2, Convert the volume to image

3, What is the image size you are getting out of it ? --> openstack image show <image id="">

4, Compare it with the size of flavor disk you are going to boot with.

Rajesh Ramachandran gravatar imageRajesh Ramachandran ( 2017-07-16 01:02:12 -0500 )edit