ERROR: (gcloud.compute.instances.stop) Could not fetch resource
ERROR: (gcloud.compute.instances.stop) Could not fetch resource
我想在特定项目上停止虚拟机实例 运行。我用
gcloud 计算实例停止
我可以停止一个项目的实例。但是当我将当前项目更改为另一个项目时,我无法使用相同的命令停止实例 运行。它显示错误,
gcloud 计算实例停止实例 1-2
错误:(gcloud.compute.instances.start)无法获取资源:
- 未找到资源 'projects/myproject/zones/asia-southeast1-a/instances/instance-1-2'
我使用以下方法设置项目:
gcloud 计算集项目项目名称
当你运行
gcloud compute instances stop instance-1-2
此命令未指定,instance-1-2
缺少项目和区域。由于未在命令行项目(和区域)中指定,因此从属性中推导出来。
请注意,设置项目 属性 的命令不是 gcloud compute set project projectname
,而是 gcloud config set project projectname
。
如果您希望此命令无论 属性 设置如何都有效,您可以使用资源的完整路径
gcloud compute instances stop projects/projectname/zones/asia-southeast1-a/instances/instance-1-2
或者使用命令行标志
gcloud compute instances stop instance-1-2 --project projectname --zone asia-southeast1-a
如果您 运行 命令 gcloud compute instances stop ,
它将停止您已经设置的区域中的实例。
您可以使用以下方法设置区域:gcloud config set compute/zone ZONE
和区域使用:gcloud config set compute/region REGION
其中 ZONE=您要分配的区域和
REGION=您要分配的地区
对于上述情况,执行:
gcloud 配置集 compute/zone ZONE_OF_instance-1-2
然后
gcloud 计算实例停止实例 1-2
我想在特定项目上停止虚拟机实例 运行。我用
gcloud 计算实例停止
我可以停止一个项目的实例。但是当我将当前项目更改为另一个项目时,我无法使用相同的命令停止实例 运行。它显示错误,
gcloud 计算实例停止实例 1-2
错误:(gcloud.compute.instances.start)无法获取资源: - 未找到资源 'projects/myproject/zones/asia-southeast1-a/instances/instance-1-2'
我使用以下方法设置项目: gcloud 计算集项目项目名称
当你运行
gcloud compute instances stop instance-1-2
此命令未指定,instance-1-2
缺少项目和区域。由于未在命令行项目(和区域)中指定,因此从属性中推导出来。
请注意,设置项目 属性 的命令不是 gcloud compute set project projectname
,而是 gcloud config set project projectname
。
如果您希望此命令无论 属性 设置如何都有效,您可以使用资源的完整路径
gcloud compute instances stop projects/projectname/zones/asia-southeast1-a/instances/instance-1-2
或者使用命令行标志
gcloud compute instances stop instance-1-2 --project projectname --zone asia-southeast1-a
如果您 运行 命令 gcloud compute instances stop , 它将停止您已经设置的区域中的实例。
您可以使用以下方法设置区域:gcloud config set compute/zone ZONE
和区域使用:gcloud config set compute/region REGION
其中 ZONE=您要分配的区域和 REGION=您要分配的地区
对于上述情况,执行:
gcloud 配置集 compute/zone ZONE_OF_instance-1-2
然后
gcloud 计算实例停止实例 1-2