Google Compute Engine: how to set hostname permanently?

前端 未结 14 1581
萌比男神i
萌比男神i 2020-12-29 06:32

How do I set the hostname of an instance in GCE permanently? I can set it via hostname,but after reboot it is gone again.

I tried to feed in metadata (hostname:f.q.d

14条回答
  •  借酒劲吻你
    2020-12-29 07:18

    An easy way to fix this is to set up a startup script with custom metadata.

    Key :startup-script 
    Value: 
    #! /bin/bash 
    hostname 
    

提交回复
热议问题