azurehostnameazure-vm-scale-set

How to set hostname of an instance in azure scale set?


I have a scale set with 1 VM. I want to set the hostname of the VM to a static-hostname. I have tried to change the hostname using a custom extension. The hostname is changed, but it is not reachable from other VMs, unless it is rebooted.

Can the hostname be changed and be reachable without a reboot?


Solution

  • I added the following command and the end of my custom extension script and it worked.

    'dhclient'