Nova names virsh domains based on the id
field stored in the nova.instances
table. For example, on my system, I have a single instance running named imap
:
$ nova list | cut -c1-80
+--------------------------------------+------+--------+------------+-----------
| ID | Name | Status | Task State | Power Stat
+--------------------------------------+------+--------+------------+-----------
| 71d68b44-625e-4aca-81e0-fa02c80da6b3 | imap | ACTIVE | - | Running
+--------------------------------------+------+--------+------------+-----------
I can find this in the database using the uuid:
MariaDB [nova]> select hostname,id from instances where uuid = '71d68b44-625e-4aca-81e0-fa02c80da6b3';
+----------+-----+
| hostname | id |
+----------+-----+
| imap | 287 |
+----------+-----+
I can see that this has id = 287
. The virsh domain will be named
instance-<id_as_hex>
, where id_as_hex
is the id
expressed as a
hexadecimal number. Since decimal 287
= hex 11F
, I would expect
to see instance-11f
. Checking:
$ virsh list
Id Name State
----------------------------------------------------
4 instance-0000011f running
If you have administrative credentials for your nova
environment,
you can use nova show
to see this relationship without mucking about
in the database:
$ nova show 71d68b44-625e-4aca-81e0-fa02c80da6b3
| OS-EXT-SRV-ATTR:host | compute0 |
| OS-EXT-SRV-ATTR:hypervisor_hostname | compute0.example.com |
| OS-EXT-SRV-ATTR:instance_name | instance-0000011f |
Here you can see the OS-EXT-SRV-ATTR:
attributes that include both
the virsh domain name and the hypervisor hostname.