syntax: gcloud compute instances add-metadata <instance-name> --zone <instance-zone> --metadata startup-script='#! /bin/bash hostname <hostname>' Open gcloud shell : gcloud compute instances add-metadata cms --zone us-central1-c --metadata startup-script='#! /bin/bash hostname your.hostname.com' Welcome to Cloud Shell! Type "help" to get started. mshaikdevops@rising-artifact-164906:~$ gcloud compute instances add-metadata cms --zone us-central1-c --metadata startup-script='#! /bin/bash hostname cms.puppethub.in' Updated [https://www.googleapis.com/compute/v1/projects/rising-artifact-164906/zones/us-central1-c/instances/cms]. $ sudo … Continue reading How to make hostname permanent on google cloud engine (GCE)
