Command line interface 停止gcp实例而不考虑区域和分区
我尝试使用停止vm实例 gcloud计算实例停止实例2-1 它抛出一个错误,如下所示: 错误:(gcloud.compute.instances.stop)无法获取资源: -未找到资源“projects/white-stacker-182910/zones/asia-southerast1-a/instances/instance-2-1” 我在asia-southeast-1-b推出了我的实例 我无法阻止特定区域或地带的实例,除了asia-Southeast 1-a 如何停止实例而不考虑区域和分区。 或者如何通过指定实例所在的区域和区域来停止实例。执行以下操作: gcloud配置集计算/区域亚洲-1-a 然后 gcloud计算实例停止实例-2-1 它会起作用的 请参阅:执行以下操作: gcloud配置集计算/区域亚洲-1-a 然后 gcloud计算实例停止实例-2-1 它会起作用的Command line interface 停止gcp实例而不考虑区域和分区,command-line-interface,gcloud,gcp,Command Line Interface,Gcloud,Gcp,我尝试使用停止vm实例 gcloud计算实例停止实例2-1 它抛出一个错误,如下所示: 错误:(gcloud.compute.instances.stop)无法获取资源: -未找到资源“projects/white-stacker-182910/zones/asia-southerast1-a/instances/instance-2-1” 我在asia-southeast-1-b推出了我的实例 我无法阻止特定区域或地带的实例,除了asia-Southeast 1-a 如何停止实例而不考虑区域和
请参阅:您可以通过标志指定区域
gcloud compute instances stop instance-2-1 --zone asia-southeast1-a
或者通过环境变量
CLOUD_SDK_COMPUTE_ZONE=asia-southeast1-a gcloud compute instances stop instance-2-1
当一个终端窗口专用于在一个区域上工作,而另一个终端专用于不同区域时,此功能非常有用
正如Ebins post所提到的,您还可以为zone设置全局属性(它本质上为每个命令添加--zone标志)
在所有/任何区域中停止实例-2-1
gcloud compute instances stop \
$(gcloud compute instances list --filter="name:instance-2-1" --uri)
您可以通过标志指定区域
gcloud compute instances stop instance-2-1 --zone asia-southeast1-a
或者通过环境变量
CLOUD_SDK_COMPUTE_ZONE=asia-southeast1-a gcloud compute instances stop instance-2-1
当一个终端窗口专用于在一个区域上工作,而另一个终端专用于不同区域时,此功能非常有用
正如Ebins post所提到的,您还可以为zone设置全局属性(它本质上为每个命令添加--zone标志)
在所有/任何区域中停止实例-2-1
gcloud compute instances stop \
$(gcloud compute instances list --filter="name:instance-2-1" --uri)