Yuanzhen Gu
2014-Aug-06 16:06 UTC
Re: [libvirt-users] [libvirt] libvirt external disk-only snapshot will pause the VM?
yes, I got your point, thanks very much Eric. 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? Is there only way that I turn to freeze/thaw functions? and freeze/thaw only for file systems, not for the whole guest, am I right? Thanks a lot! Best, Yuanzhen On Wed, Aug 6, 2014 at 11:35 AM, Eric Blake <eblake@redhat.com> wrote:> On 08/06/2014 08:36 AM, Yuanzhen Gu wrote: > > [please don't top-post on technical lists] > > > Thanks very much Eric! This is exactly what I guessed, I just wondering > > where I could find this piece of code and control the the pause time of > > guest, while the snapshot being taken? thanks ! > > Actually, for new enough qemu (one with the 'transaction' QMP command), > or for a guest where only one disk is being snapshotted, there is no > pause required. See qemuDomainSnapshotCreateDiskActiveExternal in > src/qemu/qemu_driver.c. When a pause is required, it is only for the > fraction of a second required to issue a followup qemu QMP command to > resume the guest, so there is no need for a knob to control the pause > time (it is as already as fast as possible). > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > >
Eric Blake
2014-Aug-06 16:27 UTC
Re: [libvirt-users] [libvirt] libvirt external disk-only snapshot will pause the VM?
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.> > 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.> > 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, ...) However, I honestly don't know why you think you need disk snapshots from the same point in time across multiple VMs, though. 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).> > 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
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 > >
Possibly Parallel 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?