[openstack-dev] [Nova][libvirt] Understand why we lookup libvirt domains by instance name
Daniel P. Berrange
berrange at redhat.com
Thu May 21 10:13:31 UTC 2015
On Thu, May 21, 2015 at 09:34:20PM +1200, Xav Paice wrote:
> On 21/05/15 21:23, Daniel P. Berrange wrote:
> > On Wed, May 20, 2015 at 03:01:50PM -0700, Michael Still wrote:
> >> I note that we use instance.name to lookup the libvirt domain a bunch
> >> in the driver. I'm wondering why we don't just use instance.uuid all
> >> the time -- the code for that already exists. Is there a good reason
> >> to not move to always using the uuid?
> >>
> >> I ask because instance.name is not guaranteed to be unique depending
> >> on how weird the nova deployment is.
> > Agreed, there's no benefit to using name - internally libvirt will always
> > prefer to use the UUID itself too.
> >
> > These days though, there is only a single place in nova libvirt driver
> > that needs updating - the nova.virt.libvirt.host.Host class get_domain()
> > method just needs to be switched to use uuid.
>
> Just a comment from an ops point of view - it would be miles easier when
> trying to troubleshoot, if the instance name was the uuid anyway. I
> totally agree on using instance.uuid, just to comment that I find it a
> little painful sometimes that instance names don't match the uuid of the
> instance, but the directory structure does. Just a bit of confusion to
> avoid at 2am when something isn't working.
You do know you can configure the instance name used...
eg in nova.conf
instance_name_template='inst-%(uuid)s'
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