Skip to content

Commit 65cb222

Browse files
miguelaferreiraremibergsma
authored andcommitted
Add private gateway IP to router initialization config
1 parent ef115ab commit 65cb222

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import com.cloud.network.vpc.StaticRouteProfile;
6969
import com.cloud.network.vpc.Vpc;
7070
import com.cloud.network.vpc.VpcGateway;
71+
import com.cloud.network.vpc.VpcGatewayVO;
7172
import com.cloud.network.vpc.VpcManager;
7273
import com.cloud.network.vpc.VpcVO;
7374
import com.cloud.network.vpc.dao.PrivateIpDao;
@@ -260,6 +261,15 @@ public boolean finalizeVirtualMachineProfile(final VirtualMachineProfile profile
260261
if (defaultDns2 != null) {
261262
buf.append(" dns2=").append(defaultDns2);
262263
}
264+
265+
VpcGatewayVO privateGatewayForVpc = _vpcGatewayDao.getPrivateGatewayForVpc(domainRouterVO.getVpcId());
266+
if (privateGatewayForVpc != null) {
267+
String ip4Address = privateGatewayForVpc.getIp4Address();
268+
buf.append(" privategateway=").append(ip4Address);
269+
s_logger.debug("Set privategateway field in cmd_line.json to " + ip4Address);
270+
} else {
271+
buf.append(" privategateway=None");
272+
}
263273
}
264274
}
265275

0 commit comments

Comments
 (0)