Yuanzhen Gu
2014-Aug-06 17:17 UTC
Re: [libvirt-users] [libvirt] libvirt external disk-only snapshot will pause the VM?
On Wed, Aug 6, 2014 at 12:27 PM, Eric Blake <eblake@redhat.com> wrote:> On 08/06/2014 10:06 AM, Yuanzhen Gu wrote: > > yes, I got your point, thanks very much Eric. > > not entirely, because you still top-posted. > > got it entirely this time, not top-posted.> > > > If I want to take a distributed snapshot, which need pause all the VMs > and > > then take snapshot, how can I control the pause for all the VMs? > > You mean, you have multiple VMs, and want to take a snapshot of all > their storage at the same point in time? Then it is up to you to > manually pause all the guests before taking the snapshot in each of > them. Taking an external disk snapshot works while a guest is paused. >I need take live snapshot for multiple VMs at the same time> > > > > Is there only way that I turn to freeze/thaw functions? > > Guest freeze/thaw (virDomainFSFreeze) only works on a live guest. So > what you will have to do is: > > virDomainFSFreeze(vm1, ...) > virDomainFSFreeze(vm2, ...) > virDomainSuspend(vm1) > virDomainSuspend(vm2) > virDomainSnapshotCreateXML(vm1, ...) > virDomainSnapshotCreateXML(vm2, ...) > virDomainResume(vm1) > virDomainResume(vm2) > virDomainFSThaw(vm1, ...) > virDOmainFSThaw(vm2, ...) >I see, thanks.> > However, I honestly don't know why you think you need disk snapshots > from the same point in time across multiple VMs, though.you suggested that external disk-only snapshot, libvirt will freeze/thaw before/after taking snapshot> Compare it to > bare metal - how would you take a snapshot of multiple hosts? Either > they are independent storage (and it doesn't matter if they are not > precisely at the same point in time), or they are using clustered > storage visible by all hosts in the cluster (but in that case, use your > cluster storage management tools to take the snapshot, rather than > trying to take a point-in-time snapshot of the low-level storage on each > host and coordinating all the hosts to do it at the same point in time). >good question. I'll think about it clear my mind first and then answer it, thanks!> > > > > and freeze/thaw only for file systems, not for the whole guest, am I > right? > > freeze/thaw is for all freezeable file systems on the whole guest, but > it requires guest cooperation. > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > >
Eric Blake
2014-Aug-06 17:23 UTC
Re: [libvirt-users] [libvirt] libvirt external disk-only snapshot will pause the VM?
On 08/06/2014 11:17 AM, Yuanzhen Gu wrote:>> Guest freeze/thaw (virDomainFSFreeze) only works on a live guest. So >> what you will have to do is: >> >> virDomainFSFreeze(vm1, ...) >> virDomainFSFreeze(vm2, ...) >> virDomainSuspend(vm1) >> virDomainSuspend(vm2) >> virDomainSnapshotCreateXML(vm1, ...) >> virDomainSnapshotCreateXML(vm2, ...) >> virDomainResume(vm1) >> virDomainResume(vm2) >> virDomainFSThaw(vm1, ...) >> virDOmainFSThaw(vm2, ...) >> > > I see, thanks. > >> >> However, I honestly don't know why you think you need disk snapshots >> from the same point in time across multiple VMs, though. > > > you suggested that external disk-only snapshot, libvirt will freeze/thaw > before/after taking snapshotFor a single guest, yes, libvirt can handle both the freeze/thaw and any necessary pause/resume of the guest automatically. But as soon as you are coordinating multiple guests, it is up to you do to the coordination. Libvirt handles the case of taking a snapshot when the guest is already frozen and paused, but the burden of doing the three steps in parallel across VMs is now up to you instead of all three steps in a single API call for one VM. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Yuanzhen Gu
2014-Aug-06 17:27 UTC
Re: [libvirt-users] [libvirt] libvirt external disk-only snapshot will pause the VM?
On Wed, Aug 6, 2014 at 1:23 PM, Eric Blake <eblake@redhat.com> wrote:> On 08/06/2014 11:17 AM, Yuanzhen Gu wrote: > > >> Guest freeze/thaw (virDomainFSFreeze) only works on a live guest. So > >> what you will have to do is: > >> > >> virDomainFSFreeze(vm1, ...) > >> virDomainFSFreeze(vm2, ...) > >> virDomainSuspend(vm1) > >> virDomainSuspend(vm2) > >> virDomainSnapshotCreateXML(vm1, ...) > >> virDomainSnapshotCreateXML(vm2, ...) > >> virDomainResume(vm1) > >> virDomainResume(vm2) > >> virDomainFSThaw(vm1, ...) > >> virDOmainFSThaw(vm2, ...) > >> > > > > I see, thanks. > > > >> > >> However, I honestly don't know why you think you need disk snapshots > >> from the same point in time across multiple VMs, though. > > > > > > you suggested that external disk-only snapshot, libvirt will > freeze/thaw > > before/after taking snapshot > > For a single guest, yes, libvirt can handle both the freeze/thaw and any > necessary pause/resume of the guest automatically. But as soon as you > are coordinating multiple guests, it is up to you do to the > coordination. Libvirt handles the case of taking a snapshot when the > guest is already frozen and paused, but the burden of doing the three > steps in parallel across VMs is now up to you instead of all three steps > in a single API call for one VM. >I see, thanks Eric.> > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > >
Maybe Matching Threads
- Re: [libvirt] libvirt external disk-only snapshot will pause the VM?
- Re: [libvirt] libvirt external disk-only snapshot will pause the VM?
- Re: [libvirt] libvirt external disk-only snapshot will pause the VM?
- Re: Problem with the use of domfsfreeze mountpoint option
- Re: [libvirt] libvirt external disk-only snapshot will pause the VM?