Is this what you're referring to? : when creating an offline Nova
snapshot, the Nova instance's (that's being snapshotted) disk is copied
into a temporary location before uploading it to the the Glance.
Tested with a week's old Nova git and a qcow2 CirrOS image:
$ git describe
2015.1.0rc1-300-g39bbc0d
Test
----
When you run an `image-create` on an offline Nova instance:
$ nova boot --flavor 1 --key_name oskey1 \
--image cirros-0.3.3-x86_64-disk cirrvm
$ nova shutdown cirrvm
$ nova image-create cirrvm snap --poll
A copy of the Nova instance being snapshotted is placed in a temporary
directory (before it is uploaded to Glance):
NOTE: In this case, the above 'convert' command essentially just means
the file called 'disk' is just copied to the "snapshots/tmp2h6al2"
directory, because both the source _and_ destination formats are qcow2
-- so no format conversion is going on.
Where the 'snapshot()' function from nova/virt/libvirt/driver.py is
calling 'snapshot_extract()' from libvirt/imagebackend.py:
Dmitry,
Is this what you're referring to? : when creating an offline Nova
snapshot, the Nova instance's (that's being snapshotted) disk is copied
into a temporary location before uploading it to the the Glance.
Tested with a week's old Nova git and a qcow2 CirrOS image:
$ git describe 1.0rc1- 300-g39bbc0d
2015.
Test
----
When you run an `image-create` on an offline Nova instance:
$ nova boot --flavor 1 --key_name oskey1 \ 0.3.3-x86_ 64-disk cirrvm
--image cirros-
$ nova shutdown cirrvm
$ nova image-create cirrvm snap --poll
A copy of the Nova instance being snapshotted is placed in a temporary
directory (before it is uploaded to Glance):
"qemu-img convert -f qcow2 -O qcow2 \ home/kashyapc/ src/cloud/ data/nova/ instances/ aa20be6e- de39-4a15- 9f95-9844ec9af5 a9/disk \ home/kashyapc/ src/cloud/ data/nova/ instances/ snapshots/ tmp2h6al2/ 1e00639002e2420 ba3747145f06511 d8"
/
/
NOTE: In this case, the above 'convert' command essentially just means tmp2h6al2"
the file called 'disk' is just copied to the "snapshots/
directory, because both the source _and_ destination formats are qcow2
-- so no format conversion is going on.
Where the 'snapshot()' function from nova/virt/ libvirt/ driver. py is extract( )' from libvirt/ imagebackend. py:
calling 'snapshot_
. . . backend. snapshot( instance, source_ format)
1363 snapshot_backend = self.image_
1364 disk_path,
1365 image_type=
. . .
1380 if live_snapshot:
. . . . . .
1385 else: backend. snapshot_ extract( out_path, image_format)
1386 snapshot_
. . .
Where the 'snapshot_ extract( )' calls the 'extract_ snapshot( )' from
libvirt/utils.py:
. . . extract( self, target, out_format): utils.extract_ snapshot( self.path, 'qcow2',
510 def snapshot_
511 libvirt_
512 target,
513 out_format)
. . .
Where the 'extract_ snapshot( )' from libvirt/utils.py, finally executes
the `qemu-img convert` command:
. . .
387 qemu_img_cmd = ('qemu-img', 'convert', '-f', source_fmt, '-O', dest_fmt)
. . .
After this, the converted (i.e. copied) image is uploaded to Glance.