XO + cloud-init appending 0 to hostname
-
Wondering if anyone has come across this issue...
I created a template for use with XO/Cloud-init. It works fine for everything.. alsmost.When creating a VM from XO and selecting the template and then I choose a custom cloud-config. This has the following:
#cloud-config hostname: {name}%
Now when I build the VM I get the following:
$ hostname test.domain.com0
It appends a zero to the end of the hostname.
If however, I set the cloud config to:
#cloud-config hostname: test.domain.com
And build the VM, the hostname is set correctly!
Thoughts?
Cheers,
-
Hmm weird Have you already seeing this @fohdeesha ?
Also, we need more info on your XO: XOA or XO from the sources? Are you fully up-to-date?
-
@bradk that's working as expected, the number of the VM is the
%
in the hostname variable. If you want the hostname to be set to the name of the VM, without numbering, just usehostname: {name}
-
-
If it's not clear in our doc, we should probably update it
-
@olivierlambert thinking further it should probably just be completely removed from the example/default, when creating multiple VMs from our "create "VM" page, numbering of all the VM names directly is already achieved, so having another number variable on top of those numbered VM names inside the cloud init config will just end up with the multiple VMs having hostnames like "test00", "test11", "test22", etc
-
What do you think @pdonias ?
-
@olivierlambert No, because
{name}
will be replaced by the main name input (at the top of the form), not the individual names in case of bulk creation. So you should get "test1", "test2", as expected. -
@pdonias yep I can confirm that works as expected, cloud-init uses the base VM name specified in the top of the create VM page, not the numbered VM names that result after creation. Nevermind!