1 Answers
Per documentation, it should be --metadata-from-file=startup-script
, but you have --metadata-from-file=FILE
. Additionally, documentation states that the path to the script should be relative, which in your case should be worker-startup-script.sh
. You provided an absolute path of /home/anandppatil431983/worker-startup-script.sh
.
This is what worked for me:
gcloud compute instances create lab-instance --machine-type=f1-micro --metadata=lab-logs-bucket=gs://lab-bucket-challenge-accepted --metadata-from-file startup-script=worker-startup-script.sh --scopes storage-rw
Note: I set the region and zone beforehand by running
gcloud config set compute/region us-west
andgcloud config set compute/zone us-west2-b
.