[libvirt] [PATCHv3.5 18/43] snapshot: prevent migration from stranding snapshot data

Eric Blake eblake at redhat.com
Wed Aug 31 01:25:31 UTC 2011


On 08/30/2011 04:10 PM, Eric Blake wrote:
> Migration is another case of stranding metadata.  And since
> snapshot metadata is arbitrarily large, there's no way to
> shoehorn it into the migration cookie of migration v3.

>
> A future patch will make it possible to manually recreate the
> snapshot metadata on the destination.

I'm starting to work on that now, with 
VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE; I'm also adding a flag 
VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT, which can mark a just-redefined 
snapshot as current.  I'll probably stick the redefine earlier in the 
series, then rebase this patch for migration on top of that.

>  But even that is limited,
> since if we delete the snapshot metadata prior to migration,
> then we won't know the name of the current snapshot to pass
> along; and if we delete the snapshot metadata after migration
> and use the v3 migration cookie to pass along the name of the
> current snapshot, then we need a way to bypass the fact that
> this patch refuses migration with snapshot metadata present.

This part of my analysis is still not quite right.  The prohibition on 
snapshot metadata should only be on migration with 
VIR_MIGRATE_UNDEFINE_SOURCE; otherwise, if the domain is persistent, the 
domain remains behind to allow migration of the snapshot data after the 
migration instead of before (besides, transferring snapshot metadata 
before migrating requires the domain to already exist and be persistent 
on the target, whereas transferring snapshot metadata after migration 
allows transferring to either persistent or transient target).  For 
transient domains, and without a migration v4, there is no window of 
time where the domain is accessible on both source and destination to do 
the transfer with both hosts seeing the same metadata; it will be up to 
the management app to save the snapshot dumpxml files pre-migration, 
then to redefine from those files post-migration, and the metadata is 
automatically cleaned up on the source when the last reference to the 
transient domain goes away.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list