Custom hostnames for OpenStack nodes

Asked by Rob Neff

Is it possible to tell Fuel to assign a PXE booted server a specific hostname based on its PXE nic mac address?

Is there a database or file I can edit to do this?

Right now, it's very difficult to troubleshoot errors with server names like node-29, node-58 that do not correspond to rack location.

Thanks,
Rob

Question information

Language:
English Edit question
Status:
Answered
For:
Fuel for OpenStack Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Michal Rostecki (mrostecki) said :
#1

You can set specific hostname before PXE provisioning. You can do this by command:

fuel node --node-id <node_id> --hostname <new_hostname>

We currently don't support hostname changes after provisioning.

There's also a blueprint aiming to use names provided via UI as hostnames: https://blueprints.launchpad.net/fuel/+spec/node-naming

Regards,
Michal

Revision history for this message
Michal Rostecki (mrostecki) said :
#2

If you have some not provisioned nodes in which you set names via UI, you can also do:

fuel node | grep ready | while read node; do fuel node --node-id $(awk '{ print $1 }' <<< $node) --hostname $(awk '{ print $5; }' <<< $node); done

Regards,
Michal

Revision history for this message
Michal Rostecki (mrostecki) said :
#3

Sorry, there is a mistake in the snippet above. This should be:

fuel node | grep discover | while read node; do fuel node --node-id $(awk '{ print $1 }' <<< $node) --hostname $(awk '{ print $5; }' <<< $node); done

Can you help with this problem?

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

To post a message you must log in.