}
byte[] vnKeyBytes = dvPg.getKey().getBytes();
String vnUuid = UUID.nameUUIDFromBytes(vnKeyBytes).toString();
String vnName = dvPg.getName();
s_logger.info("VN name: " + vnName);
IpPoolIpPoolConfigInfo ipConfigInfo = ipPool.getIpv4Config();
// Find associated isolated secondary VLAN Id
short isolatedVlanId = getIsolatedVlanId(dvPg.getName(), portSetting);
// Find primaryVLAN corresponsing to isolated secondary VLAN
short primaryVlanId = 0;
for (short i=0; i < pvlanMapArray.length; i++) {
if ((short)pvlanMapArray[i].getSecondaryVlanId() != isolatedVlanId)
continue;
if (!pvlanMapArray[i].getPvlanType().equals("isolated"))
continue;
s_logger.info(" PvlanType = " + pvlanMapArray[i].getPvlanType() + " PrimaryVLAN = " + pvlanMapArray[i].getPrimaryVlanId() + " IsolatedVLAN = " + pvlanMapArray[i].getSecondaryVlanId());
primaryVlanId = (short)pvlanMapArray[i].getPrimaryVlanId();
}
// Populate associated VMs
SortedMap<String, VmwareVirtualMachineInfo> vmInfo =
populateVirtualMachineInfo(dvPg);
VmwareVirtualNetworkInfo vnInfo = new
VmwareVirtualNetworkInfo(vnName, isolatedVlanId,
primaryVlanId, vmInfo,
ipConfigInfo.getSubnetAddress(),
ipConfigInfo.getNetmask(),
ipConfigInfo.getGateway());
vnInfos.put(vnUuid, vnInfo);
}
return vnInfos;
}