Hi,
i want to show all my virtual networks (description and vlanId). I did it like this:
from psphere.client import Client
from psphere.managedobjects import HostSystem, ComputeResource
client = Client("***", "***", "***")
HypervisorList = HostSystem.all(client)
for hv in HypervisorList:
for portgroup in hv.config.network.portgroup:
if str(portgroup.spec.vlanId) != '0':
print portgroup.spec.vlanId, portgroup.spec.name
When i do it like this the script will run for 30 min. How can i directly show all networks? In my case I take the informations from HostSystem... how can I get a list of all networks or if this is not exists a list of all networks of a datacenter?
I hope you can help me :)