The following reproduces (but produces an instance which I can't SSH in to; I had to capture the boot disk to discover this):
``` $ cat << EOF > cfg bootcmd: - touch /tmp/cloud-init-works EOF gcloud compute instances create aa-$(date +%y%m%d-%H%M) --image daily-ubuntu-alan-1710-artful-v20170915a --image-project ubuntu-os-cloud-devel --metadata-from-file user-data=cfg ```
The following reproduces (but produces an instance which I can't SSH in to; I had to capture the boot disk to discover this):
``` init-works alan-1710- artful- v20170915a --image-project ubuntu- os-cloud- devel --metadata- from-file user-data=cfg
$ cat << EOF > cfg
bootcmd:
- touch /tmp/cloud-
EOF
gcloud compute instances create aa-$(date +%y%m%d-%H%M) --image daily-ubuntu-
```