[openstack-dev] [nova] a question about instance snapshot

Kashyap Chamarthy kchamart at redhat.com
Tue Mar 11 14:45:01 UTC 2014


On Fri, Mar 07, 2014 at 02:29:04AM +0000, Liuji (Jeremy) wrote:
> Hi, all
> 
> Current openstack seems not support to snapshot instance with memory
> and dev states.  I searched the blueprint and found two relational
> blueprint like below.  But these blueprint failed to get in the
> branch.
> 
> [1]: https://blueprints.launchpad.net/nova/+spec/live-snapshots [2]:
> https://blueprints.launchpad.net/nova/+spec/live-snapshot-vms
> 
> In the blueprint[1], there is a comment," We discussed this pretty
> extensively on the mailing list and in a design summit session.  The
> consensus is that this is not a feature we would like to have in nova.
> --russellb " But I can't find the discuss mail about it. I hope to
> know why we think so ?  Without memory snapshot, we can't to provide
> the feature for user to revert a instance to a checkpoint. 

I agree, it's a useful feature.

Speaking from a libvirt/QEMU standpoint, with recent upstream versions,
it's entirely possible to do a live memory and disk snapshot in a single
operation. I think it's a matter of someone adding wiring up the support
in Nova.

In libvirt's parlance, it's called External 'system checkpoint' snapshot
i.e: the guest's disk-state will be saved in one file, its RAM &
device-state will be saved in another new file.

  NOTE: 'system checkpoint' meaning - it captures VM state and disk
  state; VM state meaning - it captures memory and device state (but
  _not_ "disk" state).

 
I just did a quick test  libvirt's virsh:

1. Start the guest:

  $ virsh start ostack-controller
  Domain ostack-controller started

2. List its block device in use:

  $ virsh domblklist ostack-controller
  Target     Source
  ------------------------------------------------
  vda        /var/lib/libvirt/images/ostack-controller.qcow2

3. Take a LIVE external system checkpoint snapshot, specifying both disk
   file _and_ memory file:

  $ virsh snapshot-create-as --domain ostack-controller snap1 \
    --diskspec vda,file=/export/vmimages/disk-snap.qcow2,snapshot=external \
    --memspec file=/export/vmimages/mem-snap.qcow2,snapshot=external \
    --atomic
  Domain snapshot snap1 created

  NOTE: Once the above command is issued, the original disk image of
        ostack-controller will become the backing_file & the new overlay
        image specified (disk-snap.qcow2) will be used to track the new
        changes. Here on, libvirt will use this overlay for further
        write operations (while using the original image as a read-only
        backing_file).

4. List the snapshot: 

  $ virsh snapshot-list ostack-controller
  Name                 Creation Time             State
  ------------------------------------------------------------
  snap1                2014-03-11 20:01:54 +0530 running

5. Optionally, check if the snapshot file we specified (disk-snap.qocw2)
   is indeed the new overlay


That's the versions I used to test the above:

  $ uname -r; rpm -q qemu-system-x86 libvirt
  3.13.4-200.fc20.x86_64
  qemu-system-x86-1.7.0-5.fc21.x86_64
  libvirt-1.2.3-1.fc20.x86_64


Hope that helps.

-- 
/kashyap



More information about the OpenStack-dev mailing list