错误:gcloud.beta.filestore.instances.create解析[instance]时出错

问题描述

我正在运行此命令以在Google云中创建文件存储

gcloud beta filestore instances create devopscube-nfs-server --location=us-central1-c --tier=STANDARD --file-share=name=devopscubefileserver,capacity=1TB --network=name=default,reserved-ip-range=10.0.0.0/29

我遇到此错误:-

ERROR: (gcloud.beta.filestore.instances.create) Error parsing [instance].
The [instance] resource is not properly specified.
Failed to find attribute [project]. The attribute can be set in the following ways: 
- provide the argument [--project] on the command line
- set the property [core/project]

解决方法

不推荐使用--location标志。使用--zone

您尚未登录google cloud帐户。要登录,请运行此命令。

gcloud auth login `your-gcloud-email'

之后,连接到您正在处理的项目。要使用gcloud在终端中设置项目,请运行以下命令:-

gcloud config set project PROJECT-ID