0

我使用一個實例模板使用下列元數據:谷歌計算引擎:啓動腳本不下載

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. 

我已經證實,我有我的項目谷歌雲存儲啓用API訪問:

enter image description here

回答

2

我認爲電子錯誤信息是不言自明的。您需要Google Cloud Storage JSON已啓用API。僅在您的屏幕截圖中啓用Google雲端存儲。