[ovirt-users] cloud init hostname from pools

Paul paul at kenla.nl
Mon Jun 19 14:16:05 UTC 2017


Hi,

 

I would like to automatically set the hostname of a VM to be the same as the
ovirt machine name seen in the portal.

This can be done by creating a template and activating cloud-init in the
initial run tab. 

A new VM named "test" based in this template is created and the hostname is
"test", works perfect!

 

But when I create a pool (i.e. "testpool") based on this template I get
machines with names "testpool-1", "testpool-2", etc. but the machine name is
not present in the metadata and cannot be set as hostname. This is probably
due to the fact that the machine names are auto generated by the oVirt Pool.

 

Is this expected/desired behavior for cloud-init from pools? 

If so, what would be the best way to retrieve the machine name (as seen in
the portal) and manually set it to be hostname via cloud-init (i.e. runcmd -
hostnamectl set-hostname $(hostname))

 

Kind regards,

 

Paul

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20170619/09d5e606/attachment.html>


More information about the Users mailing list