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.garb...@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.mdhaf...@gmail.com] > *Sent:* 28 November 2012 18:18 > *To:* John Garbutt > *Cc:* openstack@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.garb...@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....@lists.launchpad.net[mailto: > openstack-bounces+john.garbutt=citrix....@lists.launchpad.net] *On Behalf > Of *Afef MDHAFFAR > *Sent:* 23 November 2012 17:22 > *To:* openstack@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@lists.launchpad.net > Unsubscribe : https://launchpad.net/~openstack > More help : https://help.launchpad.net/ListHelp > >
_______________________________________________ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp