Comment 0 for bug 1752711

Revision history for this message
Dan Watkins (oddbloke) wrote :

If I pass in user data like so:

$ cat cfg
#/bin/sh
touch /tmp/foobar

$ gcloud compute instances create aa-$(date +%y%m%d-%H%M) --image-family ubuntu-1710 --image-project ubuntu-os-cloud-devel --metadata-from-file user-data=cfg
...

Then in the instance:

$ ls /tmp/foobar
$ sudo cat /var/lib/cloud/instance/user-data.txt
$ curl "http://metadata.google.internal/computeMetadata/v1/instance/attributes/user-data" -H "Metadata-Flavor: Google"
#/bin/sh
touch /tmp/foobar