[Openstack] how to let the instance name (instance-xxx) equal to the hostname of the instance (chosen by the user)??

Sébastien Han han.sebastien at gmail.com
Wed Nov 28 22:08:20 UTC 2012


Hi,

Just tried this, it works but I'd also like to rename
/var/lib/nova/instances/ according to the hostname. At the moment this only
rename (output from nova show):

| OS-EXT-SRV-ATTR:instance_name       | mon-nom

Is it possible?

Cheers!

On Wed, Nov 28, 2012 at 7:31 PM, John Garbutt <John.Garbutt at citrix.com>wrote:

> 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:afef.mdhaffar at gmail.com]
> *Sent:* 28 November 2012 18:18
> *To:* John Garbutt
> *Cc:* openstack at lists.launchpad.net
> *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 <John.Garbutt at citrix.com>****
>
> 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:* openstack-bounces+john.garbutt=citrix.com at lists.launchpad.net[mailto:
> openstack-bounces+john.garbutt=citrix.com at lists.launchpad.net] *On Behalf
> Of *Afef MDHAFFAR
> *Sent:* 23 November 2012 17:22
> *To:* openstack at lists.launchpad.net
> *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     : openstack at lists.launchpad.net
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20121128/33b40d62/attachment.html>


More information about the Openstack mailing list