Under the specific logical network setting(*1), rebooting might cause to return host name of an instance created from Official image of Linux series. Please follow the workaround below if you want to retain changed host name setting.
(It doesn't happen to an instance created from Official image of Windows series.)
(*1) The conditions under which cloud-init is executed at the reboot are as follows.
- There is a resource with the IP address of the default gateway that is set up on the instance.
- A resource with IP address of the instance and default gateway can communicate (IP reachable state).
[Workaround]
1.Change preserve_hostname in cloud.cfg from "false" to "true" in order not to overwrite host name by Cloud-init.
vi /etc/cloud/cloud.cfg
(Before)preserve_hostname: false
(After)preserve_hostname: true
2.Edit host name of instance
vi /etc/hostname
(Edit to desired host name)