pyvmomi icon indicating copy to clipboard operation
pyvmomi copied to clipboard

Can not retrieve portgroups from ClusterComputeResource container?

Open xho22 opened this issue 3 years ago • 0 comments

container = vim.ManagedEntity('datacenter-3') # it's a datacenter
view_ref =conn.content.viewManager.CreateContainerView(container=container,type=[vim.DistributedVirtualPortgroup],recursive=True)
print(view_ref.view) # it will show all portgroups in datacenter

container = vim.ManagedEntity('domain-c9') # it's a cluster compute resource
view_ref =conn.content.viewManager.CreateContainerView(container=container,type=[vim.DistributedVirtualPortgroup],recursive=True)
print(view_ref.view) # show nothing

Why can not retrieve portgroups from ClusterComputeResource container? But I found there is a property named network under ClusterComputeResource which to get all portgroups in current cluster.

xho22 avatar Jul 09 '21 03:07 xho22