Ask Your Question
0

xenserver vm name from Openstack

asked 2014-09-21 21:56:54 -0500

Qiang gravatar image

I am working with Openstack( nova-compute, nova-network) + Xenserver 6.2, we can create the VM in Xenserver from Openstack nova boot command:

root@compute-xen:~#nova boot --flavor m1.tiny --image cirros-0.3.2-x86_64-disk.vhd --nic net-id=d7fa6c25-7200-4a31-a743-8236cae2eb35 --key-name demo-key --availability-zone az-xenserver demo-150-5

In Openstack:

root@compute-xen:~# nova list
+--------------------------------------+------------+---------+------------+-------------+-----------------------------------+
| ID                                   | Name       | Status  | Task State | Power State | Networks                          |
+--------------------------------------+------------+---------+------------+-------------+-----------------------------------+
| d347a79c-8790-4826-a255-673e94ba66e5 | demo-150-3 | ACTIVE  | -          | Running     | xen-vlan150-net=172.16.150.5      |
| 0e878c93-d525-4c3b-8d41-1a2fe20940fa | demo-150-4 | SHUTOFF | -          | Shutdown    | xen-vlan150-net=172.16.150.6      |
| f7a0870b-1879-4c20-a86f-6276f2228990 | demo-150-5 | ACTIVE  | -          | Running     | xen-vlan150-net=172.16.150.7      |

In Xenserver:

[root@xenserver-fskqadde ~]# xl list
Name                                        ID   Mem VCPUs  State   Time(s)
Domain-0                                     0   741     4     r-----     246.2
Ubuntu-14.04-compute-xen-pv                  1  2048     6     -b----     114.9
instance-000000a9                            3   512     1     -b----       3.2
instance-000000ab                            7   512     1     -b----       2.1
[root@xenserver-fskqadde ~]#

Is it possible to configure the vm name in Xenserver as demo-150-5 or f7a0870b-1879-4c20-a86f-6276f2228990 ?

Thanks.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-09-22 08:06:55 -0500

larsks gravatar image

NB: This is based on my experience with the libvirt driver, and I am assuming the Xenserver driver behaves similarly.

It is probably not possible to configure the name given to the Xenserver vm, but assuming that the Xenserver driver beheaves behaves like the libvirt driver, you can find the name used in the Hypervisor by running nova show <uuid> with admin privileges, which should return information like:

| OS-EXT-SRV-ATTR:host                 | my-compute-0        |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | my-compute-0        |
| OS-EXT-SRV-ATTR:instance_name        | instance-00000212   |

The instance_name attribute is what you're looking for.

Note that this information will only be visible to admin users.

edit flag offensive delete link more

Comments

Hi,larsks, Thanks. If the name can be configured to Xenserver would be great.

Qiang gravatar imageQiang ( 2014-09-22 20:49:42 -0500 )edit

I'm not sure what to make of that comment. I am not a Nova developer! :)

larsks gravatar imagelarsks ( 2014-09-22 20:52:27 -0500 )edit
2

answered 2014-10-07 21:13:50 -0500

Qiang gravatar image

In the /etc/nova/nova.conf, add following line to fix it:

instance_name_template = %(uuid)s
or
instance_name_template = %(name)s-%(instance)s-%(uuid)s
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2014-09-21 21:56:54 -0500

Seen: 105 times

Last updated: Oct 07 '14