Google Compute Engine:启动脚本未下载

时间:2015-04-06 22:59:20

标签: server google-cloud-storage google-compute-engine google-cloud-platform

我正在使用包含以下元数据的实例模板:

enter image description here

项目访问权限

enter image description here

这相当于以下命令行参数:

gcloud compute --project "myProj" instance-templates create "myProj-template" --machine-type "n1-standard-2" --network "default" --metadata "startup-script-url=gs://my-bucket/startup-script.sh" --scopes "https://www.googleapis.com/auth/devstorage.read_only" --image "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20150316" --boot-disk-type "pd-ssd" --boot-disk-device-name "myProj-template"

但在执行时我遇到以下错误:

google: URL gs://my-bucket/startup-script.sh is not located in Google Storage
google: Downloading url from gs://my-bucket/startup-script.sh to /var/run/google.startup.script using curl
google: Failed to download gs://my-bucket/startup-script.sh
google: AccessDeniedException: 403 Access Not Configured. Please go to the Google Developers Console (https://cloud.google.com/console#/project) for your project, select APIs and Auth and enable the Google Cloud Storage JSON API.
google: curl: (1) Protocol gs not supported or disabled in libcurl
google: Could not download startup script gs://my-bucket/startup-script.sh.

我已确认我的Google云端存储项目已启用API访问权限:

enter image description here

1 个答案:

答案 0 :(得分:2)

我认为错误信息是不言自明的。您需要启用Google云端存储 JSON API。仅从屏幕截图中启用了Google云端存储。