所有gcloud计算命令都失败 - 项目的值无效:myproject

时间:2015-11-02 08:51:57

标签: google-compute-engine

我刚刚开始使用Google Compute Engine。我可以使用Web界面创建实例,但控制台无效:

gcloud compute instances create example-instance \
>     --machine-type n1-standard-1 \
>     --image debian-7 \
>     --zone europe-west1-b

ERROR: (gcloud.compute.instances.create) Failed to find image for alias [debian-7] in public image project [debian-cloud].
 - Invalid value for project: myproject

看起来图像可用。

$ gcloud compute images list --project debian-cloud --no-standard-images
NAME                                              PROJECT      ALIAS              DEPRECATED STATUS
backports-debian-7-wheezy-v20150929               debian-cloud debian-7-backports            READY
beta-accounts-backports-debian-7-wheezy-v20150930 debian-cloud                               READY
beta-accounts-debian-8-jessie-v20150930           debian-cloud                               READY
debian-7-wheezy-v20150929                         debian-cloud debian-7                      READY
debian-8-jessie-v20150929                         debian-cloud debian-8                      READY

错误:(gcloud.compute.images.list)有些请求没有成功:   - 项目的值无效:myproject

我得到一个 - 项目的无效值:myproject 消息,几乎我尝试的每个gcloud命令。

我访问https://console.developers.google.com/project?authuser=1时可以看到myproject 从控制台:

$ gcloud config list project
[core]
project = myproject

我该怎么做才能解决这个问题?

1 个答案:

答案 0 :(得分:11)

我的错误。

我混合了project_ 名称并投影 _id

 $ gcloud config set project PROJECT_ID  #(not project name)