google-cloud-platform - GCP:通过 gcloud 命令列出但未描述的实例
问题描述
以下怎么可能?
➢ gcloud compute instances list
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
my-instance-1 us-east4-a n1-standard-8 10.16.22.11 RUNNING
my-instance-2 us-east4-a n1-standard-8 10.16.22.12 RUNNING
my-instance-3 us-east4-a n1-standard-8 10.16.22.13 RUNNING
(.venv)
~/Workspace/staging-env-configs workablestg9 ✔ 1h40m
➢ gcloud compute instances describe my-instance-1
ERROR: (gcloud.compute.instances.describe) Could not fetch resource:
- The resource 'projects/my-project/zones/us-central1-b/instances/my-instance-1' was not found
(.venv)
解决方案
如果您的实例在默认区域“us-central1-b”中运行,您可以简单地执行gcloud compute instances describe <instance-name>
但是,如果您的实例未在默认区域中运行,您还必须提供该区域,以便您执行以下操作:
gcloud compute instances describe my-instance-1 --zone us-east4-a
如果您查看输出:“资源 'projects/my-project/zones/us-central1-b/instances/my-instance-1'” 您可以清楚地看到它正在您的默认区域 us-central1-b 中查找
推荐阅读
- android - 如何嵌入不直接相关的 Room 实体?
- python - 如何使用 Scrapy 使用 Ajax 无限滚动抓取网站
- python - 访问嵌套字典中的数据?Python
- php - WooCommerce:将自定义元添加为隐藏的订单项元以供内部使用
- javascript - 如何在 bar chart.js 的工具提示中显示多个值?
- sql - Postgres 中用于查找最后一个值的聚合
- grails - 如何将 HttpServletRequest JSON 入站数据从控制器传递到服务方法
- python - Python 的键盘中断不会中止 Rust 功能(PyO3)
- r - 使用 dplyr 将多个值设置为 NA
- python - 从 Python 列表中提取特定文本