I was just looking for a solution to pass Sunstone ‘VM name’ FQDN to VM and found this thread. For anyone that may need it here is my way:
-
Add custom script in Files with content:
#!/bin/bash
[ -n “$SET_HOSTNAME” ] && hostnamectl set-hostname ${SET_HOSTNAME} -
Enable your custom script in VM template - Context - Files
Add it to ‘Init scripts’ list too -
in VM template - Context - Custom vars add
SET_HOSTNAME = $NAME
-
Create VM in Sunstone and set VM name to FQDN ‘host.domain.com’
After logging into new VM ‘hostnamectl’ will show FQDN in ‘Static hostname’ field
Without the script your hostname will be truncated to just ‘host’