mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
VPC : revert some change
This commit is contained in:
parent
3e5f391c85
commit
e69561b857
@ -106,7 +106,14 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
|
||||
@Override
|
||||
public NicProfile allocate(Network config, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm) throws InsufficientVirtualNetworkCapcityException,
|
||||
InsufficientAddressCapacityException {
|
||||
|
||||
|
||||
if(vm.getHypervisorType() == HypervisorType.VMware && vm.getType() != VirtualMachine.Type.DomainRouter) {
|
||||
NicProfile nicProf = new NicProfile(Nic.ReservationStrategy.Create, null, null, null, null);
|
||||
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
|
||||
nicProf.setMacAddress(mac);
|
||||
return nicProf;
|
||||
}
|
||||
|
||||
if (nic != null) {
|
||||
throw new CloudRuntimeException("Does not support nic specification at this time: " + nic);
|
||||
}
|
||||
@ -130,6 +137,15 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
|
||||
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
|
||||
nic.setMacAddress(mac);
|
||||
return;
|
||||
} else {
|
||||
// in basic mode and in VMware case, control network will be shared with guest network
|
||||
String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());
|
||||
nic.setMacAddress(mac);
|
||||
nic.setIp4Address("0.0.0.0");
|
||||
nic.setNetmask("0.0.0.0");
|
||||
nic.setFormat(AddressFormat.Ip4);
|
||||
nic.setGateway("0.0.0.0");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,7 +158,6 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
|
||||
nic.setNetmask("255.255.0.0");
|
||||
nic.setFormat(AddressFormat.Ip4);
|
||||
nic.setGateway(NetUtils.getLinkLocalGateway());
|
||||
nic.setDeviceId(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -856,6 +856,12 @@ public class ElasticLoadBalancerManagerImpl implements
|
||||
// always add management explicit route, for basic networking setup
|
||||
buf.append(" mgmtcidr=").append(_mgmtCidr);
|
||||
buf.append(" localgw=").append(dest.getPod().getGateway());
|
||||
|
||||
if (dc.getNetworkType() == NetworkType.Basic) {
|
||||
// ask elb vm to setup SSH on guest network
|
||||
buf.append(" sshonguest=true");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
controlNic = nic;
|
||||
|
||||
@ -1210,12 +1210,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
||||
s_logger.error("Didn't support redundant virtual router without public network!");
|
||||
return null;
|
||||
}
|
||||
//Check if control network has to be set on VR
|
||||
boolean controlNetwork = true;
|
||||
if ( dest.getDataCenter().getNetworkType() == NetworkType.Basic ) {
|
||||
// in basic mode, use private network as control network
|
||||
controlNetwork = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//1) Get deployment plan and find out the list of routers
|
||||
boolean isPodBased = (dest.getDataCenter().getNetworkType() == NetworkType.Basic ||
|
||||
@ -1589,6 +1585,13 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
||||
buf.append(" mgmtcidr=").append(_mgmt_cidr);
|
||||
buf.append(" localgw=").append(dest.getPod().getGateway());
|
||||
}
|
||||
|
||||
|
||||
if (dc.getNetworkType() == NetworkType.Basic) {
|
||||
// ask domR to setup SSH on guest network
|
||||
buf.append(" sshonguest=true");
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
//Remove public and guest nics from the profile
|
||||
@ -1704,7 +1707,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
||||
|
||||
NicProfile controlNic = null;
|
||||
|
||||
if( dcVo.getNetworkType() == NetworkType.Basic) {
|
||||
if(profile.getHypervisorType() == HypervisorType.VMware && dcVo.getNetworkType() == NetworkType.Basic) {
|
||||
// TODO this is a ugly to test hypervisor type here
|
||||
// for basic network mode, we will use the guest NIC for control NIC
|
||||
for (NicProfile nic : profile.getNics()) {
|
||||
if (nic.getTrafficType() == TrafficType.Guest && nic.getIp4Address() != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user