[openstack-dev] [Nova][libvirt] Understand why we lookup libvirt domains by instance name

Xav Paice xavpaice at gmail.com
Thu May 21 09:34:20 UTC 2015


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.
>
> Regards,
> Daniel

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.



More information about the OpenStack-dev mailing list