Google compute engine 在gce中运行cloudinit脚本

Google compute engine 在gce中运行cloudinit脚本,google-compute-engine,cloud-init,Google Compute Engine,Cloud Init,是否可以在GCE中为ubuntu上的VM实例提供cloud init脚本? i、 运行类似于 gcloud compute instances create my1 --image ubuntu-1404-trusty-v20150316 --metadata-from-file startup-script=my.cloudconfig 似乎部分有效。编写文件似乎很好,但在任何runcmd上似乎都失败了。我想如果你能逃走,就这么做: 在VM元数据中,创建一个名为user data的键,其中包

是否可以在GCE中为ubuntu上的VM实例提供cloud init脚本? i、 运行类似于

gcloud compute instances create my1 --image ubuntu-1404-trusty-v20150316 --metadata-from-file startup-script=my.cloudconfig

似乎部分有效。编写文件似乎很好,但在任何runcmd上似乎都失败了。我想如果你能逃走,就这么做:

在VM元数据中,创建一个名为user data的键,其中包含整个云配置脚本作为文本。当虚拟机出现时,它将被虚拟机拾取

然后,在启动脚本中,粘贴所有放入runcmd的命令

当然,所有这些都可能会给您带来订购问题,但我没有其他办法