}
public SortedMap<String, VmwareVirtualNetworkInfo>
populateVirtualNetworkInfo() throws Exception {
// Search contrailDvSwitch
VmwareDistributedVirtualSwitch contrailDvs =
(VmwareDistributedVirtualSwitch)
inventoryNavigator.searchManagedEntity(
"VmwareDistributedVirtualSwitch",
contrailDvSwitchName);
if (contrailDvs == null) {
s_logger.error("dvSwitch: " + contrailDvSwitchName +
" NOT configured");
return null;
}
// Extract distributed virtual port groups
DistributedVirtualPortgroup[] dvPgs = contrailDvs.getPortgroup();
if (dvPgs == null || dvPgs.length == 0) {
s_logger.error("dvSwitch: " + contrailDvSwitchName +
" Distributed portgroups NOT configured");
return null;
}
// Extract IP Pools
Datacenter contrailDC = (Datacenter) inventoryNavigator.
searchManagedEntity(
"Datacenter",
contrailDataCenterName);
IpPool[] ipPools = ipPoolManager.queryIpPools(contrailDC);
if (ipPools == null || ipPools.length == 0) {
s_logger.error("dvSwitch: " + contrailDvSwitchName +
" Datacenter: " + contrailDC.getName() + " IP Pools NOT " +
"configured");
return null;
}
// Extract private vlan entries for the virtual switch
VMwareDVSConfigInfo dvsConfigInfo = (VMwareDVSConfigInfo) contrailDvs.getConfig();
if (dvsConfigInfo == null) {
s_logger.error("dvSwitch: " + contrailDvSwitchName +
" Datacenter: " + contrailDC.getName() + " ConfigInfo " +
"is empty");
return null;