mirror of https://github.com/apache/cloudstack.git
Support mutiple management networks in systemvms (#4678)
* Support mutliple management networks in systemvms Currently only one management.network.cidr is suuported in systemvms Allow supporting comma separated list of cidr's so that multiple networks are reachable from systemvms. * add local gateway Co-authored-by: Rakesh Venkatesh <rakeshv@apache.org>
This commit is contained in:
parent
4e826d504e
commit
831f7cff54
|
|
@ -1254,8 +1254,11 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
|
|||
|
||||
if (nic.getTrafficType() == TrafficType.Management) {
|
||||
String mgmt_cidr = configurationDao.getValue(Config.ManagementNetwork.key());
|
||||
if (NetUtils.isValidIp4Cidr(mgmt_cidr)) {
|
||||
if (NetUtils.isValidCidrList(mgmt_cidr)) {
|
||||
s_logger.debug("Management server cidr list is " + mgmt_cidr);
|
||||
buf.append(" mgmtcidr=").append(mgmt_cidr);
|
||||
} else {
|
||||
s_logger.error("Invalid management cidr list: " + mgmt_cidr);
|
||||
}
|
||||
buf.append(" localgw=").append(dest.getPod().getGateway());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1125,8 +1125,11 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
|
|||
}
|
||||
if (nic.getTrafficType() == TrafficType.Management) {
|
||||
String mgmt_cidr = _configDao.getValue(Config.ManagementNetwork.key());
|
||||
if (NetUtils.isValidIp4Cidr(mgmt_cidr)) {
|
||||
if (NetUtils.isValidCidrList(mgmt_cidr)) {
|
||||
s_logger.debug("Management server cidr list is " + mgmt_cidr);
|
||||
buf.append(" mgmtcidr=").append(mgmt_cidr);
|
||||
} else {
|
||||
s_logger.error("Inavlid management server cidr list: " + mgmt_cidr);
|
||||
}
|
||||
buf.append(" localgw=").append(dest.getPod().getGateway());
|
||||
buf.append(" private.network.device=").append("eth").append(deviceId);
|
||||
|
|
|
|||
|
|
@ -322,7 +322,12 @@ setup_common() {
|
|||
|
||||
if [ -n "$MGMTNET" -a -n "$LOCAL_GW" ]
|
||||
then
|
||||
ip route add $MGMTNET via $LOCAL_GW dev eth1
|
||||
log_it "Received mgmt cidr : $MGMTNET"
|
||||
cidrs=(${MGMTNET//,/ })
|
||||
for cidr in ${cidrs[@]}
|
||||
do
|
||||
ip route add $cidr via $LOCAL_GW dev eth1
|
||||
done
|
||||
fi
|
||||
|
||||
ip route delete default
|
||||
|
|
|
|||
Loading…
Reference in New Issue