I use govc to create resources in VMware. Before creating a new resource pool I want to verify if a resource pool exists with the same name. Running govc pool.info on an existing pool returns information about the existing pool and the command exits with a value of 0.
Executing the same command on a non existing resource pool returns nothing, but also exits with a value of 0.
➜ govc pool.info existing-pool
Name: existing-pool
Path: /TEST/host/server/Resources/existing-pool
CPU Usage: 0MHz (0.0%)
CPU Shares: normal
CPU Reservation: 0MHz (expandable=true)
CPU Limit: -1MHz
Mem Usage: 0MB (0.0%)
Mem Shares: normal
Mem Reservation: 0MB (expandable=true)
Mem Limit: -1MB
➜ echo $?
0
➜ govc pool.info test
➜ echo $?
0
How do you verify existing resource pools?