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