dermotbradley/create-alpine-disk-image

Option '--short-hostname' does not appear to be working for vmware virtual type

Closed this issue · 1 comments

Created script with following options:

./create-alpine-disk-image --script-filename ../create-alpine-image-uefi-grub.sh --bootloader grub --boottype uefi --virtual vmware --timezone 'America/Toronto' --ssh-public-key ../user_id_rsa.pub --username someuser --password passw0rd --release 3.15 --insecure --short-hostname alpine-linux --os-device-media disk --os-device-type scsi --images-directory alpine-linux-images --image-filename alpine-linux-v3.15-vmware-eufi.img --cpu-vendor intel

Converted the image to vmdk type with following command:

qemu-img convert -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 alpine-linux-v3.15-vmware-eufi.img alpine-linux-v3.15-vmware-eufi.vmdk

Booted up a VM on ESXI host with the generated disk image the host name was localhost.

It seems the the option is either being ignored or the default cloud-init is overwriting it at boot time.

Hi. As the help mentioned this option is only intended for physical machines (where it is used to create the user-data.yaml contents in the cidata partition).

For non-physical machines the hostname is set via user-data provided by whatever mechanism the relevant DataSource uses (ISO, metadata server, etc).

I will add some logic to give an error if this option is specified for a non-physical machine.