Comment 7 for bug 1375252

Revision history for this message
Yue Zhang (yuezha) wrote : Re: Hostname change is not preserved across reboot on Azure Ubuntu VMs

Cloud-init will reset hostname on every reboot. The hostname is stored in /var/lib/waagent/ovf-env.xml.

You could use the following command to change your hostname.
 sudo sed -e "s/your-old-hostname/your-new-hostname/" -i /var/lib/waagent/ovf-env.xml