Instance Template Name not reflection on the instance hostname

Asked by Melicloud

Hi all, we configured a custom instance_name_template like this "--instance_name_template=DC4-%08x-controller1" as a FLAG on the nova.conf file on the controller node and the computes nodes (multinode config).
The hostname gets setted ok on the KVM , if you do a "virsh list" you see it as we spected, BUT, the hostname inside the VM, is like i-0000060 , same as seen on euca-describe-instances.

So, we were wondering if this is a normal behavior, or if is there a way to pass this value to get into the instance ? ( via injection or metadata )

Regards

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vish Ishaya (vishvananda) said :
#1

The hostname for an instance is generated by a method called hostname_factory in compute_api. This is a method that accepts an integer id for an instance and returns a string. By default in the ec2_api it uses ec2_utils.id_to_ec2_id to make the conversion. If you want the hostname to be different, you can define a new method and pass it in when compute API is constructed.

Vish

On Jun 9, 2011, at 4:05 PM, Melicloud wrote:

> New question #160910 on OpenStack Compute (nova):
> https://answers.launchpad.net/nova/+question/160910
>
> Hi all, we configured a custom instance_name_template like this "--instance_name_template=DC4-%08x-controller1" as a FLAG on the nova.conf file on the controller node and the computes nodes (multinode config).
> The hostname gets setted ok on the KVM , if you do a "virsh list" you see it as we spected, BUT, the hostname inside the VM, is like i-0000060 , same as seen on euca-describe-instances.
>
> So, we were wondering if this is a normal behavior, or if is there a way to pass this value to get into the instance ? ( via injection or metadata )
>
> Regards
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Can you help with this problem?

Provide an answer of your own, or ask Melicloud for more information if necessary.

To post a message you must log in.