背景:我们的vCenter群集的策略之一是(几乎)每个虚拟机都有一个“过期date”。 这是注释面板中的自定义字段,主要是提醒联系虚拟机的所有者,并validation系统是否仍然相关。
我的问题 :通过特定注记字段对一组VM进行sorting的最佳方法是什么? 有没有工具,VMWare提供了通过他们的注释摘要查看虚拟机? 还是有更好的方法来完成追踪VM寿命的目标?
Powercli很容易处理。 http://www.vmware.com/support/developer/PowerCLI/
get-vm | get-annotation -customattribute $my_annotation | sort -property value
或者如果您想导出到csv并使用那里的数据:
get-vm | get-annotation -customattribute $my_annotation | select annotatedentity, name, value | export-csv -notypeinformation