I've set up a CentOS 7.1 instance as my first experience with GCE. Everything is going quite smoothly and I've worked out how to do most things like setting up SSH keys, etc. but one thing still has me stumped: setting the hostname.
If I use the "hostnamectl set-hostname" command to set the hostname from a shell, everything's fine and it takes. However, upon reboot, I've discovered that the GCE startup script sets the transient hostname back to "instance-1":
[lesbell@instance-1 ~]$ sudo hostnamectl status
  Static hostname:
svalbard.lesbell.com.auTransient hostname: instance-1
        Icon name: computer-vm
          Chassis: vm
Which leads me to ask: what's the canonically correct way (i.e. the way Google intends) to set the hostname? I don't think it can be from the instance name, since an instance name can only consist of letters, digits and hyphens. Is it set from some other metadata somewhere? Or should I hack the startup script (but then it might get rewritten again later)? Or just add my own startup script? Or something else entirely?
--- Les