mirror of https://github.com/apache/cloudstack.git
CS-14937 System VMs and Router VMs does not come up after upgrading from 3.0 to Bonita
Enabling virtual NIC association with distributed vNetwork only in Nexus dvSwitch is enabled.
This commit is contained in:
parent
d879d370e0
commit
9dbf4ae956
|
|
@ -1473,11 +1473,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
String dvSwitchUuid;
|
||||
ManagedObjectReference dcMor = hyperHost.getHyperHostDatacenter();
|
||||
DatacenterMO dataCenterMo = new DatacenterMO(context, dcMor);
|
||||
}
|
||||
|
||||
VirtualDevice nic;
|
||||
int nicMask = 0;
|
||||
|
|
@ -1486,12 +1482,19 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
s_logger.info("Prepare NIC device based on NicTO: " + _gson.toJson(nicTo));
|
||||
|
||||
Pair<ManagedObjectReference, String> networkInfo = prepareNetworkFromNicInfo(vmMo.getRunningHost(), nicTo);
|
||||
|
||||
ManagedObjectReference dvsMor = dataCenterMo.getDvSwitchMor(networkInfo.first());
|
||||
dvSwitchUuid = dataCenterMo.getDvSwitchUuid(dvsMor);
|
||||
s_logger.info("Preparing NIC device on dvSwitch : " + dvSwitchUuid);
|
||||
|
||||
nic = VmwareHelper.prepareDvNicDevice(vmMo, networkInfo.first(), nicDeviceType, networkInfo.second(), dvSwitchUuid, nicTo.getMac(), i, i + 1, true, true);
|
||||
if (mgr.getNexusVSwitchGlobalParameter()) {
|
||||
String dvSwitchUuid;
|
||||
ManagedObjectReference dcMor = hyperHost.getHyperHostDatacenter();
|
||||
DatacenterMO dataCenterMo = new DatacenterMO(context, dcMor);
|
||||
ManagedObjectReference dvsMor = dataCenterMo.getDvSwitchMor(networkInfo.first());
|
||||
dvSwitchUuid = dataCenterMo.getDvSwitchUuid(dvsMor);
|
||||
s_logger.info("Preparing NIC device on dvSwitch : " + dvSwitchUuid);
|
||||
nic = VmwareHelper.prepareDvNicDevice(vmMo, networkInfo.first(), nicDeviceType, networkInfo.second(), dvSwitchUuid, nicTo.getMac(), i, i + 1, true, true);
|
||||
} else {
|
||||
s_logger.info("Preparing NIC device on network " + networkInfo.second());
|
||||
nic = VmwareHelper.prepareNicDevice(vmMo, networkInfo.first(), nicDeviceType, networkInfo.second(), nicTo.getMac(), i, i + 1, true, true);
|
||||
}
|
||||
|
||||
deviceConfigSpecArray[i] = new VirtualDeviceConfigSpec();
|
||||
deviceConfigSpecArray[i].setDevice(nic);
|
||||
deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add);
|
||||
|
|
|
|||
Loading…
Reference in New Issue