Re: [libvirt] [PATCH] sheepdog: allow snapshot

2016-10-12 Thread Vasiliy Tolstov
2016-10-12 5:19 GMT+03:00 Michal Privoznik :
> Unfortunately, I don't have a setup to try this out. The code looks
> okay, however the commit you are referring to says that there might be
> some problems with storing memory into RBD image. So is that the case?
> Because if it is, we might not want to allow this for full snapshots
> with guest memory.


RBD does not support storing memory snapshot, but sheepdog have this
ability from the begining (internally it stores memory like other
objects but with specific flag).
So i add check for sheepdog network protocol.

-- 
Vasiliy Tolstov,
e-mail: v.tols...@selfip.ru

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] sheepdog: allow snapshot

2016-10-11 Thread Michal Privoznik
On 11.10.2016 19:30, Vasiliy Tolstov wrote:
> 2016-09-29 16:00 GMT+03:00 Vasiliy Tolstov :
>> partially revert f7c1410b0ee5b878e81f2eddf86c609947a9b27c because
>> sheepdog allow to store vm state inside vdi
>>
> 
> Sorry, can somebody check this?
> 
>> Signed-off-by: Vasiliy Tolstov 
>> ---
>>  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 db99c414d458..816514d2d909 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -13887,6 +13887,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;
>> +}
>> +

Unfortunately, I don't have a setup to try this out. The code looks
okay, however the commit you are referring to says that there might be
some problems with storing memory into RBD image. So is that the case?
Because if it is, we might not want to allow this for full snapshots
with guest memory.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] sheepdog: allow snapshot

2016-10-11 Thread Vasiliy Tolstov
2016-09-29 16:00 GMT+03:00 Vasiliy Tolstov :
> partially revert f7c1410b0ee5b878e81f2eddf86c609947a9b27c because
> sheepdog allow to store vm state inside vdi
>

Sorry, can somebody check this?

> Signed-off-by: Vasiliy Tolstov 
> ---
>  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 db99c414d458..816514d2d909 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -13887,6 +13887,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.7.4
>
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list



-- 
Vasiliy Tolstov,
e-mail: v.tols...@selfip.ru

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] sheepdog: allow snapshot

2015-11-30 Thread Vasiliy Tolstov
2015-11-30 13:45 GMT+03:00 Vasiliy Tolstov :
> 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.tols...@selfip.ru

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] sheepdog: allow snapshot

2015-11-30 Thread Vasiliy Tolstov
2015-11-30 16:11 GMT+03:00 Peter Krempa :
> 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.tols...@selfip.ru

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] sheepdog: allow snapshot

2015-11-30 Thread Vasiliy Tolstov
2015-11-30 14:02 GMT+03:00 Vasiliy Tolstov :
>  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.tols...@selfip.ru

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] sheepdog: allow snapshot

2015-11-30 Thread Peter Krempa
On Mon, Nov 30, 2015 at 14:02:18 +0300, Vasiliy Tolstov wrote:
> 2015-11-30 13:45 GMT+03:00 Vasiliy Tolstov :
> > 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


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] sheepdog: allow snapshot

2015-11-30 Thread Vasiliy Tolstov
2015-11-30 16:04 GMT+03:00 Peter Krempa :
>
> 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.tols...@selfip.ru

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] sheepdog: allow snapshot

2015-11-30 Thread Vasiliy Tolstov
2015-11-30 15:57 GMT+03:00 Vasiliy Tolstov :
>
> 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.tols...@selfip.ru

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] sheepdog: allow snapshot

2015-11-30 Thread Peter Krempa
On Mon, Nov 30, 2015 at 16:03:22 +0300, Vasiliy Tolstov wrote:
> 2015-11-30 15:57 GMT+03:00 Vasiliy Tolstov :
> >
> > 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


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list