OpenStack Compute (Nova)

UUID used for starting KVM instances is not the same like the internal UUIDs

Reported by Christian Berendt on 2012-01-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Undecided
Christian Berendt

Bug Description

when nova-compute starts an new KVM instance there is a parameter "-uuid". the used value there is not the same like the UUID of the instance in the database. it think it would be helpful to use the same ids so that it's possible to identify a running KVM instance with the corresponding instance data in the database.

example (running with latest development sources on ubuntu 11.10):

| 521673db-112b-4711-9d37-6bfab33305f8 | testing001 | ACTIVE | private=10.0.0.4 |

 7159 ? Sl 0:20 /usr/bin/kvm -S -M pc-0.14 -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name instance-00000003 -uuid 62bffbbc-0c52-a8e4-c4f4-36555071ee8b [...]

Brian Waldon (bcwaldon) wrote :

It would be cleaner, but I'm not sure if it's possible. Are kvm uuids automatically assigned?

Changed in nova:
status: New → Incomplete
Christian Berendt (berendt) wrote :

I think the uuid is set using field "uuid" in the general metadata. At the moment the field "uuid" is not used in the libvirt template (nova/virt/libvirt.xml.template). I think extending the libvirt template with "<uuid>$uuid</uuid>" and defining the variable $uuid should solve the problem. I'll try this tomorrow.

uuid
The content of the uuid element provides a globally unique identifier for the virtual machine. The format must be RFC 4122 compliant, eg 3e3fce45-4f53-4fa7-bb32-11f34168b82b. If omitted when defining/creating a new machine, a random UUID is generated. It is also possible to provide the UUID via a sysinfo specification. Since 0.0.1, sysinfo since 0.8.7

Christian Berendt (berendt) wrote :

using <uuid>${uuid}</uuid> and instance['uuid'] as the value is working fine. i'll commit a patch.

stack@devstack001:~$ nova list
+--------------------------------------+------------+--------+------------------+
| ID | Name | Status | Networks |
+--------------------------------------+------------+--------+------------------+
| b8f85947-2edf-4c4e-9051-393f680d4a61 | testing007 | ACTIVE | private=10.0.0.8 |
+--------------------------------------+------------+--------+------------------+

stack@devstack001:~$ ps ax | grep b8f85947-2edf-4c4e-9051-393f680d4a61
 3013 ? S 0:13 /usr/bin/qemu-system-x86_64 [...] -name instance-00000007 -uuid b8f85947-2edf-4c4e-9051-393f680d4a61 -nodefconfig [...]

Fix proposed to branch: master
Review: https://review.openstack.org/3455

Changed in nova:
assignee: nobody → Christian Berendt (berendt)
status: Incomplete → In Progress

Reviewed: https://review.openstack.org/3455
Committed: http://github.com/openstack/nova/commit/7b5e9079415bcdb7c3514822e1d5cb7c67c267ce
Submitter: Jenkins
Branch: master

commit 7b5e9079415bcdb7c3514822e1d5cb7c67c267ce
Author: Christian Berendt <email address hidden>
Date: Thu Jan 26 09:25:17 2012 +0100

    uses the instance uuid in libvirt by introducing a new variable 'uuid' for the used template instead of using a random uuid in libvirt

    fixes bug 917736

    Change-Id: I1f8ba92878fb01cb25a7007839649e1ef7c4fcdc

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-02-29
Changed in nova:
milestone: none → essex-4
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-4 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers