【发布时间】:2020-10-09 01:35:57
【问题描述】:
我正在尝试查找特定项目中具有特定标签的所有虚拟机。 这行得通
gcloud compute instances list --project myproject --filter="(name=myvm) AND --filter="tags.items~*ngf*"
但是取出VM名称不起作用
gcloud compute instances list --project myproject --filter="tags.items~*ngf*"
错误信息是
ERROR: (gcloud.compute.instances.list) Filter expression RE pattern [*ngf*]: nothing to repeat at position 0
有什么想法吗?我尝试在过滤器中使用标签而不是 tags.items,但这似乎也不起作用。
【问题讨论】:
-
做
gcloud compute instances describe我注意到我用create-with-container和--labels创建的VM 实际上没有我分配的标签。 -
只是提醒您看看这里stackoverflow.com/help/someone-answers,如果您觉得我的回答有用,请考虑支持/接受它,谢谢!