[libvirt] [PATCH] sheepdog: allow snapshot

In commit f7c1410b0ee5b878e81f2eddf86c609947a9b27c libvirt devs disable creating snapshot with sheepdog storage and raw image format. This patch allows creating snapshot (without --live flag for now) Vasiliy Tolstov (1): sheepdog: allow snapshot src/qemu/qemu_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.5.0

partially revert f7c1410b0ee5b878e81f2eddf86c609947a9b27c because sheepdog allow to store vm state inside vdi Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru> --- src/qemu/qemu_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 65ccf99..4bc569f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14062,6 +14062,12 @@ qemuDomainSnapshotPrepare(virConnectPtr conn, active) < 0) goto cleanup; + /* sheepdog allow to store memory inside the vdi */ + if (vm->def->disks[i]->src->type == VIR_STORAGE_TYPE_NETWORK && + (vm->def->disks[i]->src->protocol == VIR_STORAGE_NET_PROTOCOL_SHEEPDOG)) { + break; + } + if (vm->def->disks[i]->src->format > 0 && vm->def->disks[i]->src->format != VIR_STORAGE_FILE_QCOW2) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- 2.5.0

2015-11-30 13:45 GMT+03:00 Vasiliy Tolstov <v.tolstov@selfip.ru>:
In commit f7c1410b0ee5b878e81f2eddf86c609947a9b27c libvirt devs disable creating snapshot with sheepdog storage and raw image format. This patch allows creating snapshot (without --live flag for now)
Vasiliy Tolstov (1): sheepdog: allow snapshot
src/qemu/qemu_driver.c | 6 ++++++ 1 file changed, 6 insertions(+)
Next steps is to fix --live flag for snapshot, but i'm not understand message: live snapshot creation is supported only with external checkpoints i'm check the code /* reject the VIR_DOMAIN_SNAPSHOT_CREATE_LIVE flag where not supported */ if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_LIVE && (!virDomainObjIsActive(vm) || def->memory != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL || redefine)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("live snapshot creation is supported only " "with external checkpoints")); goto cleanup; } and have a question: in case of sheepdog storage it allows to save memory (qemu have ability to create full vm snapshot with memory), but if domain have many disks (two sheepdog for example) how fix this code? And on which disk libvirt save the vm state? -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

2015-11-30 14:02 GMT+03:00 Vasiliy Tolstov <v.tolstov@selfip.ru>:
def->memory != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL ||
when i'm remove this line --live flag for snapshot works fine (with sheepdog storage) What is the proper fix for this? Does i need to walk for each disk and check if storage is network and driver sheepdog? -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

2015-11-30 15:57 GMT+03:00 Vasiliy Tolstov <v.tolstov@selfip.ru>:
when i'm remove this line --live flag for snapshot works fine (with sheepdog storage) What is the proper fix for this? Does i need to walk for each disk and check if storage is network and driver sheepdog?
Also as i see when i'm delete snapshot it does not deleted from sheepdog. And storage_driver.h does not have functions to delete snapshot. -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On Mon, Nov 30, 2015 at 16:03:22 +0300, Vasiliy Tolstov wrote:
2015-11-30 15:57 GMT+03:00 Vasiliy Tolstov <v.tolstov@selfip.ru>:
when i'm remove this line --live flag for snapshot works fine (with sheepdog storage) What is the proper fix for this? Does i need to walk for each disk and check if storage is network and driver sheepdog?
Also as i see when i'm delete snapshot it does not deleted from sheepdog. And storage_driver.h does not have functions to delete snapshot.
That's the reason why it's forbidden. Nobody bothered to see if all the operations actually work. Before removing the restrictions, all the backend operations including everything to revert or delete the internal snapshot need to be implemented. Peter

2015-11-30 16:11 GMT+03:00 Peter Krempa <pkrempa@redhat.com>:
That's the reason why it's forbidden. Nobody bothered to see if all the operations actually work. Before removing the restrictions, all the backend operations including everything to revert or delete the internal snapshot need to be implemented.
Thanks, i'm recheck code and this is not libvirt issue. qemu-img does not delete sheepdog snapshot. I'm try to find in qemu code now. Thanks. -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On Mon, Nov 30, 2015 at 14:02:18 +0300, Vasiliy Tolstov wrote:
2015-11-30 13:45 GMT+03:00 Vasiliy Tolstov <v.tolstov@selfip.ru>:
In commit f7c1410b0ee5b878e81f2eddf86c609947a9b27c libvirt devs disable creating snapshot with sheepdog storage and raw image format. This patch allows creating snapshot (without --live flag for now)
Vasiliy Tolstov (1): sheepdog: allow snapshot
src/qemu/qemu_driver.c | 6 ++++++ 1 file changed, 6 insertions(+)
Next steps is to fix --live flag for snapshot, but i'm not understand message: live snapshot creation is supported only with external checkpoints
Checkpoint is a snapshot with ram.
i'm check the code /* reject the VIR_DOMAIN_SNAPSHOT_CREATE_LIVE flag where not supported */ if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_LIVE &&
So a combination of --live which means "do not pause the VM while taking the snapshot" (yes it's documented).
(!virDomainObjIsActive(vm) ||
With an inactive machine ...
def->memory != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL ||
or internal snapshot ... (since qemu pauses itself while taking the snapshot)
redefine)) {
or snapshot redefinition doesn't make sense.
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("live snapshot creation is supported only " "with external checkpoints")); goto cleanup; }
and have a question: in case of sheepdog storage it allows to save memory (qemu have ability to create full vm snapshot with memory), but if domain have many disks (two sheepdog for example) how fix this code? And on which disk libvirt save the vm state?
If you are doing an internal snapshot, the code can't be changed. Internal snapshots do no allow the CPUs to run while taking it. Peter

2015-11-30 16:04 GMT+03:00 Peter Krempa <pkrempa@redhat.com>:
If you are doing an internal snapshot, the code can't be changed. Internal snapshots do no allow the CPUs to run while taking it.
Im try specify internal when doing snapshot, but in case of sheepdog and -memory state saved internally in sheepdog, so --live not works with sheepdog storage. -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru
participants (2)
-
Peter Krempa
-
Vasiliy Tolstov