s_logger.debug("dvPg: " + dvPgName +
" Ignoring vm: " + vmName);
continue;
}
// Is it powered on?
VirtualMachineRuntimeInfo vmRuntimeInfo = vm.getRuntime();
VirtualMachinePowerState powerState =
vmRuntimeInfo.getPowerState();
if (powerState != VirtualMachinePowerState.poweredOn) {
s_logger.debug("dvPg: " + dvPgName + " Ignoring vm: " +
vmName + " Power State: " + powerState);
continue;
}
// Extract configuration info
VirtualMachineConfigInfo vmConfigInfo = vm.getConfig();
// Extract MAC address
String vmMac = getVirtualMachineMacAddress(vmConfigInfo,
portGroup);
if (vmMac == null) {
s_logger.error("dvPg: " + dvPgName + " vm: " +
vmName + " MAC Address NOT found");
continue;
}
// Get instance UUID
String instanceUuid = vmConfigInfo.getInstanceUuid();
// Get host information
ManagedObjectReference hmor = vmRuntimeInfo.getHost();
HostSystem host = new HostSystem(
vm.getServerConnection(), hmor);
String hostName = host.getName();
// Get Contrail VRouter virtual machine information from the host
String vrouterIpAddress = getVirtualMachineIpAddress(dvPgName,