[openstack-dev] [nova][libvirt] Suspend via virDomainSave() rather than virDomainManagedSave()

Daniel P. Berrange berrange at redhat.com
Mon Jul 7 17:14:58 UTC 2014


On Sun, Jul 06, 2014 at 10:22:44PM -0700, Rafi Khardalian wrote:
> Hi All --
> 
> It seems as though it would be beneficial to use virDomainSave rather than
> virDomainManagedSave for suspending instances.  The primary benefit of
> doing so would be to locate the save files within the instance's dedicated
> directory.  As it stands suspend operations are utilizing ManagedSave,
> which places all save files in a single directory
> (/var/lib/libvirt/qemu/save by default on Ubuntu).  This is the only
> instance-specific state data which lives both outside the instance
> directory and the database.

Yes, that is a bit of an oddity from OpenStack's POV. 

>                              Also, ManagedSave does not consider Libvirt's
> "save_image_format" directive and stores all saves as raw, rather than
> offering the various compression options available when DomainSave is used.

That's not correct. Both APIs use the 'save_image_format' config
parameter in the same way, at least with current libvirt versions.

> ManagedSave is certainly easier but offers less control than what I think
> is desired in this case.  Is there anything I'm missing?  If not, would
> folks be open to this change?

The main difference between Save & ManagedSave, is that with ManagedSave,
any attempt to start the guest will automatically restore from the save
image. So if we changed to use Save, there would need to be a bunch of
work to make sure all relevant code paths use 'virDomainRestore' instead
of virDomainCreate, when there is a save image in the instances directory.

I don't have strong opinion on which is "best" to use really. AFAICT, with
suitable coding, either can be made to satisfy Nova's functional needs.

So to me it probably comes down to a question as to how important it is
to have the save images in the instances directory. You're rationale above
feels mostly to be about "cleanliness" of having everything in one place.
Could there be any functional downsides or upsides to having them in the
instances directory ? eg if the instances directory is on NFS, so does
give us a compelling reason to choose one approach vs the other ?

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



More information about the OpenStack-dev mailing list