I think this is the flag you want to change and its default:
instance_name_template="instance-%08x"

You should try:
instance_name_template="%(hostname)s"

This is the code that deals with it:
https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/models.py#L203

This is where the name gets set inside XenAPI:
https://github.com/openstack/nova/blob/master/nova/virt/xenapi/vmops.py#L260
Which eventually gets here (i.e. you could just hack this file, if the above 
fails):
https://github.com/openstack/nova/blob/master/nova/virt/xenapi/vm_utils.py#L193

Hope that helps,
John

From: Afef MDHAFFAR [mailto:[email protected]]
Sent: 28 November 2012 18:18
To: John Garbutt
Cc: [email protected]
Subject: Re: [Openstack] how to let the instance name (instance-xxx) equal to 
the hostname of the instance (chosen by the user)??

Hi,

Yes - when you list your vms via xe vm-list, you get the name-label of the 
instance.
The question is how to modify openstack to let the hostname of the created 
instance equal to this name-label?

Thank you,
Afef

2012/11/28 John Garbutt 
<[email protected]<mailto:[email protected]>>
Hi,

Not quick sure which "name" of the instance you are refereeing to.

Do you mean when you open XenCenter it shows you a different name?

Thanks,
John

From: 
[email protected]<mailto:[email protected]>
 
[mailto:openstack-bounces+john.garbutt<mailto:openstack-bounces%2Bjohn.garbutt>[email protected]<mailto:[email protected]>]
 On Behalf Of Afef MDHAFFAR
Sent: 23 November 2012 17:22
To: [email protected]<mailto:[email protected]>
Subject: [Openstack] how to let the instance name (instance-xxx) equal to the 
hostname of the instance (chosen by the user)??

Hi all,

Due to some requirements, I have to modify openstack source code in order to 
let the name of the instance (in Xen Server) equal to the hostname of the 
instance (chosen by the user).
Is it possible to do that by only configuring openstack? If yes, could you 
please guide me to the suitable flag?
If not, could you please guide me to the right python files that need to be 
changed.
I use the folsom release, with XCP as a virtualization technology.

Thank you,
Afef



--
Afef MDHAFFAR
http://www.redcad.org/members/mdhaffar/


_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp

Reply via email to