dermotbradley / create-alpine-disk-image

Create cloud-init enabled Alpine disk images for physical machines (PCs & RPIs), VMs, and Cloud servers
GNU General Public License v2.0
93 stars 11 forks source link

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

Closed tomastzn closed 2 years ago

tomastzn commented 2 years ago

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.

dermotbradley commented 2 years ago

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.