Windows deployment with cloud-init does not set hostname

donalddk

Active Member
Sep 4, 2019
5
0
41
44
Hi

I am deploying windows with a template. It sets IP-address etc and that works.

But it does not set the windows hostname. As far as i can see the hostname should be set to the same value as the VM name.

Anyone seen the same?

I use this script for deploying.

VMID=$(pvesh get /cluster/nextid)

VMNAME=name

VLAN=vlan

IP=x.x.x.x

IPPREFIX=24

GATEWAY=x.x.x.x

DNS1=x.x.x.x

DNS2=x.x.x.x

echo Deploying VM with ID $VMID and name $VMNAME

pvesh create /nodes/pro01/qemu/117/clone --newid $VMID --name $VMNAME

pvesh set /nodes/pro01/qemu/$VMID/config --net0 virtio,bridge=vmbr0,tag=$VLAN

qm set $VMID --ipconfig0 ip=$IP/$IPPREFIX,gw=$GATEWAY --nameserver $DNS1,$DNS2

qm start $VMID
 
Hi

I am deploying windows with a template. It sets IP-address etc and that works.

But it does not set the windows hostname. As far as i can see the hostname should be set to the same value as the VM name.

Anyone seen the same?

I use this script for deploying.

VMID=$(pvesh get /cluster/nextid)

VMNAME=name

VLAN=vlan

IP=x.x.x.x

IPPREFIX=24

GATEWAY=x.x.x.x

DNS1=x.x.x.x

DNS2=x.x.x.x

echo Deploying VM with ID $VMID and name $VMNAME

pvesh create /nodes/pro01/qemu/117/clone --newid $VMID --name $VMNAME

pvesh set /nodes/pro01/qemu/$VMID/config --net0 virtio,bridge=vmbr0,tag=$VLAN

qm set $VMID --ipconfig0 ip=$IP/$IPPREFIX,gw=$GATEWAY --nameserver $DNS1,$DNS2

qm start $VMID


Yes, I can see the same problem. Since the OPENSTACK\LATEST\USER_DATA file has been created correctly I guess it's a problem inside Windows application cloudbase-init.