You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Sanjeev Neelarapu <sa...@citrix.com> on 2013/08/14 13:39:23 UTC

snapshots in kvm

Hi,

This regarding snapshot process in KVM. Does libvirt allow creating snapshots on two disks of a vm at the same time?
I have deployed a vm with root and data disk. Configured recurring snapshot policies on both root disk and data disk and snapshot process triggered on both the disks with difference of 1 sec.
But one of them failed with libvirt exception:
Failed to manage snapshot: org.libvirt.LibvirtException: Timed out during operation: cannot acquire state change lock

Is this expected? If yes could you specify the reason for my understanding?

Thanks,
Sanjeev

RE: snapshots in kvm

Posted by Edison Su <Ed...@citrix.com>.

> -----Original Message-----
> From: Marty Sweet [mailto:msweet.dev@gmail.com]
> Sent: Wednesday, August 14, 2013 4:47 AM
> To: dev@cloudstack.apache.org
> Subject: Re: snapshots in kvm
> 
> Hi Sanjeev,
> 
> As I understand it from a cloudstack prospective it will work per disk.
> This error is returned because the KVM snapshot command (of which i can't
> remember the name of at this time), takes control of the VM state because
> the VM is paused while part of the copy is taking place.
> 
> It may be worth looking into libvirt and KVM to see if multiple volumes can be
> snapshot'ed at the same time and if so suggesting it through the appropriate
> cloudstack channels to be an implemented feature, this would be something
> I would be looking for and willing to implement if its possible on the
> underlying hypervisor and the community agrees.


There are APIs to enable one disk per snapshot: 
http://libvirt.org/formatsnapshot.html
disks
On input, this is an optional listing of specific instructions for disk snapshots; it is needed when making a snapshot of only a subset of the disks associated with a domain,
It says it's enabled since 0.9.5, but I haven't have time to test it yet. Patch is welcome.

> 
> Marty
> 
> On Wednesday, August 14, 2013, Sanjeev Neelarapu wrote:
> 
> > Hi,
> >
> > This regarding snapshot process in KVM. Does libvirt allow creating
> > snapshots on two disks of a vm at the same time?
> > I have deployed a vm with root and data disk. Configured recurring
> > snapshot policies on both root disk and data disk and snapshot process
> > triggered on both the disks with difference of 1 sec.
> > But one of them failed with libvirt exception:
> > Failed to manage snapshot: org.libvirt.LibvirtException: Timed out
> > during
> > operation: cannot acquire state change lock
> >
> > Is this expected? If yes could you specify the reason for my understanding?
> >
> > Thanks,
> > Sanjeev
> >

Re: snapshots in kvm

Posted by Marty Sweet <ms...@gmail.com>.
Hi Sanjeev,

As I understand it from a cloudstack prospective it will work per disk.
This error is returned because the KVM snapshot command (of which i can't
remember the name of at this time), takes control of the VM state
because the VM is paused while part of the copy is taking place.

It may be worth looking into libvirt and KVM to see if multiple volumes can
be snapshot'ed at the same time and if so suggesting it through the
appropriate cloudstack channels to be an implemented feature, this would be
something I would be looking for and willing to implement if its possible
on the underlying hypervisor and the community agrees.

Marty

On Wednesday, August 14, 2013, Sanjeev Neelarapu wrote:

> Hi,
>
> This regarding snapshot process in KVM. Does libvirt allow creating
> snapshots on two disks of a vm at the same time?
> I have deployed a vm with root and data disk. Configured recurring
> snapshot policies on both root disk and data disk and snapshot process
> triggered on both the disks with difference of 1 sec.
> But one of them failed with libvirt exception:
> Failed to manage snapshot: org.libvirt.LibvirtException: Timed out during
> operation: cannot acquire state change lock
>
> Is this expected? If yes could you specify the reason for my understanding?
>
> Thanks,
> Sanjeev
>

Re: snapshots in kvm

Posted by Marty Sweet <ms...@gmail.com>.
It does currently enforce 1 volume at a time, although I have noticed some
buggy behaviour with the feature, for example queuing the next volume but
never doing it, I haven't debugged these issues though.

Marty

On Wednesday, August 14, 2013, Nitin Mehta wrote:

> With the current implementation of snapshots for kvm I think its a bug. It
> should be creating snapshot of only 1 volume belonging to a vm at a time
>
> On 14/08/13 5:10 PM, "Sanjeev Neelarapu" <sanjeev.neelarapu@citrix.com<javascript:;>
> >
> wrote:
>
> >Hi,
> >
> >This regarding snapshot process in KVM. Does libvirt allow creating
> >snapshots on two disks of a vm at the same time?
> >I have deployed a vm with root and data disk. Configured recurring
> >snapshot policies on both root disk and data disk and snapshot process
> >triggered on both the disks with difference of 1 sec.
> >But one of them failed with libvirt exception:
> >Failed to manage snapshot: org.libvirt.LibvirtException: Timed out during
> >operation: cannot acquire state change lock
> >
> >Is this expected? If yes could you specify the reason for my
> >understanding?
> >
> >Thanks,
> >Sanjeev
>
>

Re: snapshots in kvm

Posted by Nitin Mehta <Ni...@citrix.com>.
With the current implementation of snapshots for kvm I think its a bug. It
should be creating snapshot of only 1 volume belonging to a vm at a time

On 14/08/13 5:10 PM, "Sanjeev Neelarapu" <sa...@citrix.com>
wrote:

>Hi,
>
>This regarding snapshot process in KVM. Does libvirt allow creating
>snapshots on two disks of a vm at the same time?
>I have deployed a vm with root and data disk. Configured recurring
>snapshot policies on both root disk and data disk and snapshot process
>triggered on both the disks with difference of 1 sec.
>But one of them failed with libvirt exception:
>Failed to manage snapshot: org.libvirt.LibvirtException: Timed out during
>operation: cannot acquire state change lock
>
>Is this expected? If yes could you specify the reason for my
>understanding?
>
>Thanks,
>Sanjeev