Skip to content

Commit 9b22133

Browse files
With basic zone and VMware hypervisor, VR fails to start since eth1 is getting empty instead of a private IP.
Though VMware does not support security groups, but in a basic zone with VMware and no isolation VMs should be able to deploy.
1 parent cd6f0cb commit 9b22133

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed

server/src/main/java/com/cloud/network/guru/ControlNetworkGuru.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,11 @@ public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, De
138138
// we have to get management/private ip for the control nic for vmware/hyperv due ssh issues.
139139
HypervisorType hType = vm.getHypervisorType();
140140
if (((hType == HypervisorType.VMware) || (hType == HypervisorType.Hyperv)) && isRouterVm(vm)) {
141-
if (dest.getDataCenter().getNetworkType() != NetworkType.Basic) {
142-
super.reserve(nic, config, vm, dest, context);
141+
super.reserve(nic, config, vm, dest, context);
143142

144-
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
145-
nic.setMacAddress(mac);
146-
return;
147-
} else {
148-
// in basic mode and in VMware case, control network will be shared with guest network
149-
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
150-
nic.setMacAddress(mac);
151-
nic.setIPv4Address("0.0.0.0");
152-
nic.setIPv4Netmask("0.0.0.0");
153-
nic.setFormat(AddressFormat.Ip4);
154-
nic.setIPv4Gateway("0.0.0.0");
155-
return;
156-
}
143+
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
144+
nic.setMacAddress(mac);
145+
return;
157146
}
158147

159148
String ip = _dcDao.allocateLinkLocalIpAddress(dest.getDataCenter().getId(), dest.getPod().getId(), nic.getId(), context.getReservationId());

server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,19 +1760,9 @@ protected NicProfile getControlNic(final VirtualMachineProfile profile) {
17601760
final DomainRouterVO router = _routerDao.findById(profile.getId());
17611761
final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
17621762
NicProfile controlNic = null;
1763-
if (profile.getHypervisorType() == HypervisorType.VMware && dcVo.getNetworkType() == NetworkType.Basic) {
1764-
// TODO this is a ugly to test hypervisor type here
1765-
// for basic network mode, we will use the guest NIC for control NIC
1766-
for (final NicProfile nic : profile.getNics()) {
1767-
if (nic.getTrafficType() == TrafficType.Guest && nic.getIPv4Address() != null) {
1768-
controlNic = nic;
1769-
}
1770-
}
1771-
} else {
1772-
for (final NicProfile nic : profile.getNics()) {
1773-
if (nic.getTrafficType() == TrafficType.Control && nic.getIPv4Address() != null) {
1774-
controlNic = nic;
1775-
}
1763+
for (final NicProfile nic : profile.getNics()) {
1764+
if (nic.getTrafficType() == TrafficType.Control && nic.getIPv4Address() != null) {
1765+
controlNic = nic;
17761766
}
17771767
}
17781768
return controlNic;

0 commit comments

Comments
 (0)