Hi, sorry if this has been asked before, but I hav...
# vsphere
d
Hi, sorry if this has been asked before, but I haven't been able to find much info on it. I'm trying to provision my cluster through vsphere and I want to be able to give the machines it provisions a different hostname. Currently it just takes {cluster_name}-{pool_name}-{random_pool_id(?)}-{random_id}. I'd prefer if the random ID's were just an incrementing number. I'm having issues with this since these hostnames are longer than the allowed NetBIOS max hostname length.
update: I've found the truncate to 15 characters option under networking in the cluster config, but this didn't seem to do anything.
update2: If I check the the cloud config parameters with
cloud-init query -a
, the hostname property is correctly set to a 15 character string. The local-hostname property however still has the full name.
I fixed it by adding
prefer_fqdn_over_hostname: false
to the cloud config
b
As far as the host names are concerned, if you're creating from the UI, you do get the option of editing the yaml where you can change the names. Whether it works or not I don't know since my system doesn't have DHCP so can't build through the vSphere option - more accurately, there is no client update, so the process doesn't continue.
d
@best-appointment-66450 You can set a hostname prefix, yes, but it still adds a long random ID to every machine. If you set a hostname in the cloud-config it'll just name every machine in the pool the same (DNS does not like this). Tbh I think my current solution still isn't perfect. If I check the cloud-config logs it fails mulitple times at setting the hostname. It still ends up booting with the hostname I want though so I ain't complaining.
👍 1