mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
vpc vr: plugin nics by this order: public/private/guest
This commit is contained in:
parent
627070c5f8
commit
03e65a1266
@ -314,6 +314,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
|||||||
// 2) FORM PLUG NIC COMMANDS
|
// 2) FORM PLUG NIC COMMANDS
|
||||||
final List<Pair<Nic, Network>> guestNics = new ArrayList<Pair<Nic, Network>>();
|
final List<Pair<Nic, Network>> guestNics = new ArrayList<Pair<Nic, Network>>();
|
||||||
final List<Pair<Nic, Network>> publicNics = new ArrayList<Pair<Nic, Network>>();
|
final List<Pair<Nic, Network>> publicNics = new ArrayList<Pair<Nic, Network>>();
|
||||||
|
final List<Pair<Nic, Network>> privateGatewayNics = new ArrayList<Pair<Nic, Network>>();
|
||||||
final Map<String, String> vlanMacAddress = new HashMap<String, String>();
|
final Map<String, String> vlanMacAddress = new HashMap<String, String>();
|
||||||
|
|
||||||
final List<? extends Nic> routerNics = _nicDao.listByVmIdOrderByDeviceId(profile.getId());
|
final List<? extends Nic> routerNics = _nicDao.listByVmIdOrderByDeviceId(profile.getId());
|
||||||
@ -321,7 +322,11 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
|||||||
final Network network = _networkModel.getNetwork(routerNic.getNetworkId());
|
final Network network = _networkModel.getNetwork(routerNic.getNetworkId());
|
||||||
if (network.getTrafficType() == TrafficType.Guest) {
|
if (network.getTrafficType() == TrafficType.Guest) {
|
||||||
final Pair<Nic, Network> guestNic = new Pair<Nic, Network>(routerNic, network);
|
final Pair<Nic, Network> guestNic = new Pair<Nic, Network>(routerNic, network);
|
||||||
|
if (_networkModel.isPrivateGateway(routerNic.getNetworkId())) {
|
||||||
|
privateGatewayNics.add(guestNic);
|
||||||
|
} else {
|
||||||
guestNics.add(guestNic);
|
guestNics.add(guestNic);
|
||||||
|
}
|
||||||
} else if (network.getTrafficType() == TrafficType.Public) {
|
} else if (network.getTrafficType() == TrafficType.Public) {
|
||||||
final Pair<Nic, Network> publicNic = new Pair<Nic, Network>(routerNic, network);
|
final Pair<Nic, Network> publicNic = new Pair<Nic, Network>(routerNic, network);
|
||||||
publicNics.add(publicNic);
|
publicNics.add(publicNic);
|
||||||
@ -375,21 +380,13 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
|||||||
_commandSetupHelper.createVpcAssociatePublicIPCommands(domainRouterVO, sourceNat, cmds, vlanMacAddress);
|
_commandSetupHelper.createVpcAssociatePublicIPCommands(domainRouterVO, sourceNat, cmds, vlanMacAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add VPC router to guest networks
|
// add VPC router to private gateway networks
|
||||||
for (final Pair<Nic, Network> nicNtwk : guestNics) {
|
for (final Pair<Nic, Network> nicNtwk : privateGatewayNics) {
|
||||||
final Nic guestNic = updateNicWithDeviceId(nicNtwk.first().getId(), deviceId);
|
final Nic guestNic = updateNicWithDeviceId(nicNtwk.first().getId(), deviceId);
|
||||||
deviceId ++;
|
deviceId ++;
|
||||||
// plug guest nic
|
// plug guest nic
|
||||||
final PlugNicCommand plugNicCmd = new PlugNicCommand(_nwHelper.getNicTO(domainRouterVO, guestNic.getNetworkId(), null), domainRouterVO.getInstanceName(), domainRouterVO.getType(), details);
|
final PlugNicCommand plugNicCmd = new PlugNicCommand(_nwHelper.getNicTO(domainRouterVO, guestNic.getNetworkId(), null), domainRouterVO.getInstanceName(), domainRouterVO.getType(), details);
|
||||||
cmds.addCommand(plugNicCmd);
|
cmds.addCommand(plugNicCmd);
|
||||||
if (!_networkModel.isPrivateGateway(guestNic.getNetworkId())) {
|
|
||||||
// set guest network
|
|
||||||
final VirtualMachine vm = _vmDao.findById(domainRouterVO.getId());
|
|
||||||
final NicProfile nicProfile = _networkModel.getNicProfile(vm, guestNic.getNetworkId(), null);
|
|
||||||
final SetupGuestNetworkCommand setupCmd = _commandSetupHelper.createSetupGuestNetworkCommand(domainRouterVO, true, nicProfile);
|
|
||||||
cmds.addCommand(setupCmd);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// set private network
|
// set private network
|
||||||
final PrivateIpVO ipVO = _privateIpDao.findByIpAndSourceNetworkId(guestNic.getNetworkId(), guestNic.getIPv4Address());
|
final PrivateIpVO ipVO = _privateIpDao.findByIpAndSourceNetworkId(guestNic.getNetworkId(), guestNic.getIPv4Address());
|
||||||
final Network network = _networkDao.findById(guestNic.getNetworkId());
|
final Network network = _networkDao.findById(guestNic.getNetworkId());
|
||||||
@ -412,6 +409,19 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
|||||||
_commandSetupHelper.createNetworkACLsCommands(networkACLs, domainRouterVO, cmds, ipVO.getNetworkId(), true);
|
_commandSetupHelper.createNetworkACLsCommands(networkACLs, domainRouterVO, cmds, ipVO.getNetworkId(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add VPC router to guest networks
|
||||||
|
for (final Pair<Nic, Network> nicNtwk : guestNics) {
|
||||||
|
final Nic guestNic = updateNicWithDeviceId(nicNtwk.first().getId(), deviceId);
|
||||||
|
deviceId ++;
|
||||||
|
// plug guest nic
|
||||||
|
final PlugNicCommand plugNicCmd = new PlugNicCommand(_nwHelper.getNicTO(domainRouterVO, guestNic.getNetworkId(), null), domainRouterVO.getInstanceName(), domainRouterVO.getType(), details);
|
||||||
|
cmds.addCommand(plugNicCmd);
|
||||||
|
// set guest network
|
||||||
|
final VirtualMachine vm = _vmDao.findById(domainRouterVO.getId());
|
||||||
|
final NicProfile nicProfile = _networkModel.getNicProfile(vm, guestNic.getNetworkId(), null);
|
||||||
|
final SetupGuestNetworkCommand setupCmd = _commandSetupHelper.createSetupGuestNetworkCommand(domainRouterVO, true, nicProfile);
|
||||||
|
cmds.addCommand(setupCmd);
|
||||||
}
|
}
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
s_logger.warn("Failed to add router " + domainRouterVO + " to network due to exception ", ex);
|
s_logger.warn("Failed to add router " + domainRouterVO + " to network due to exception ", ex);
|
||||||
|
|||||||
@ -429,7 +429,7 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
# 6. create new public ip range 1
|
# 6. create new public ip range 1
|
||||||
self.services["publiciprange"]["zoneid"] = self.zone.id
|
self.services["publiciprange"]["zoneid"] = self.zone.id
|
||||||
self.services["publiciprange"]["forvirtualnetwork"] = "true"
|
self.services["publiciprange"]["forvirtualnetwork"] = "true"
|
||||||
random_subnet_number = random.randrange(10,20)
|
random_subnet_number = random.randrange(10,50)
|
||||||
self.services["publiciprange"]["vlan"] = get_free_vlan(
|
self.services["publiciprange"]["vlan"] = get_free_vlan(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
self.zone.id)[1]
|
self.zone.id)[1]
|
||||||
|
|||||||
@ -429,7 +429,7 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
# 6. create new public ip range 1
|
# 6. create new public ip range 1
|
||||||
self.services["publiciprange"]["zoneid"] = self.zone.id
|
self.services["publiciprange"]["zoneid"] = self.zone.id
|
||||||
self.services["publiciprange"]["forvirtualnetwork"] = "true"
|
self.services["publiciprange"]["forvirtualnetwork"] = "true"
|
||||||
random_subnet_number = random.randrange(10,20)
|
random_subnet_number = random.randrange(10,50)
|
||||||
self.services["publiciprange"]["vlan"] = get_free_vlan(
|
self.services["publiciprange"]["vlan"] = get_free_vlan(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
self.zone.id)[1]
|
self.zone.id)[1]
|
||||||
|
|||||||
@ -328,13 +328,13 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> tier 1, eth4 -> tier 2, eth5 -> new ip 6, eth3-> private gateway
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> tier 1, eth4 -> tier 2, eth5 -> new ip 6, eth3-> private gateway
|
||||||
# 24. reboot router
|
# 24. reboot router
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
# 25. restart VPC with cleanup
|
# 25. restart VPC with cleanup
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
# 26. restart VPC with cleanup, makeredundant=true
|
# 26. restart VPC with cleanup, makeredundant=true
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Create new domain1
|
# Create new domain1
|
||||||
@ -479,7 +479,7 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
# 6. create new public ip range 1
|
# 6. create new public ip range 1
|
||||||
self.services["publiciprange"]["zoneid"] = self.zone.id
|
self.services["publiciprange"]["zoneid"] = self.zone.id
|
||||||
self.services["publiciprange"]["forvirtualnetwork"] = "true"
|
self.services["publiciprange"]["forvirtualnetwork"] = "true"
|
||||||
random_subnet_number = random.randrange(10,20)
|
random_subnet_number = random.randrange(10,50)
|
||||||
self.services["publiciprange"]["vlan"] = get_free_vlan(
|
self.services["publiciprange"]["vlan"] = get_free_vlan(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
self.zone.id)[1]
|
self.zone.id)[1]
|
||||||
@ -900,7 +900,7 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
|
|
||||||
# 24. reboot router
|
# 24. reboot router
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
routers = self.get_vpc_routers(self.vpc1.id)
|
routers = self.get_vpc_routers(self.vpc1.id)
|
||||||
if len(routers) > 0:
|
if len(routers) > 0:
|
||||||
router = routers[0]
|
router = routers[0]
|
||||||
@ -914,14 +914,14 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
||||||
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
||||||
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth3", True)
|
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth3", True)
|
||||||
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth4", True)
|
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth4", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
||||||
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth4")
|
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth3")
|
||||||
|
|
||||||
# 25. restart VPC with cleanup
|
# 25. restart VPC with cleanup
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
self.vpc1.restart(self.apiclient, cleanup=True)
|
self.vpc1.restart(self.apiclient, cleanup=True)
|
||||||
routers = self.get_vpc_routers(self.vpc1.id)
|
routers = self.get_vpc_routers(self.vpc1.id)
|
||||||
for router in routers:
|
for router in routers:
|
||||||
@ -931,14 +931,14 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
||||||
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
||||||
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth3", True)
|
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth3", True)
|
||||||
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth4", True)
|
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth4", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
||||||
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth4")
|
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth3")
|
||||||
|
|
||||||
# 26. restart VPC with cleanup, makeredundant=true
|
# 26. restart VPC with cleanup, makeredundant=true
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
self.vpc1.restart(self.apiclient, cleanup=True, makeredundant=True)
|
self.vpc1.restart(self.apiclient, cleanup=True, makeredundant=True)
|
||||||
routers = self.get_vpc_routers(self.vpc1.id)
|
routers = self.get_vpc_routers(self.vpc1.id)
|
||||||
for router in routers:
|
for router in routers:
|
||||||
@ -948,7 +948,7 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
||||||
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
||||||
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth3", True)
|
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth3", True)
|
||||||
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth4", True)
|
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth4", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
||||||
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth4")
|
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth3")
|
||||||
|
|||||||
@ -328,13 +328,13 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> tier 1, eth4 -> tier 2, eth5 -> new ip 6, eth3-> private gateway
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> tier 1, eth4 -> tier 2, eth5 -> new ip 6, eth3-> private gateway
|
||||||
# 24. reboot router
|
# 24. reboot router
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
# 25. restart VPC with cleanup
|
# 25. restart VPC with cleanup
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
# 26. restart VPC with cleanup, makeredundant=true
|
# 26. restart VPC with cleanup, makeredundant=true
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Create new domain1
|
# Create new domain1
|
||||||
@ -479,7 +479,7 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
# 6. create new public ip range 1
|
# 6. create new public ip range 1
|
||||||
self.services["publiciprange"]["zoneid"] = self.zone.id
|
self.services["publiciprange"]["zoneid"] = self.zone.id
|
||||||
self.services["publiciprange"]["forvirtualnetwork"] = "true"
|
self.services["publiciprange"]["forvirtualnetwork"] = "true"
|
||||||
random_subnet_number = random.randrange(10,20)
|
random_subnet_number = random.randrange(10,50)
|
||||||
self.services["publiciprange"]["vlan"] = get_free_vlan(
|
self.services["publiciprange"]["vlan"] = get_free_vlan(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
self.zone.id)[1]
|
self.zone.id)[1]
|
||||||
@ -900,7 +900,7 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
|
|
||||||
# 24. reboot router
|
# 24. reboot router
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
routers = self.get_vpc_routers(self.vpc1.id)
|
routers = self.get_vpc_routers(self.vpc1.id)
|
||||||
if len(routers) > 0:
|
if len(routers) > 0:
|
||||||
router = routers[0]
|
router = routers[0]
|
||||||
@ -914,14 +914,14 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
||||||
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
||||||
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth3", True)
|
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth3", True)
|
||||||
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth4", True)
|
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth4", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
||||||
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth4")
|
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth3")
|
||||||
|
|
||||||
# 25. restart VPC with cleanup
|
# 25. restart VPC with cleanup
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
self.vpc1.restart(self.apiclient, cleanup=True)
|
self.vpc1.restart(self.apiclient, cleanup=True)
|
||||||
routers = self.get_vpc_routers(self.vpc1.id)
|
routers = self.get_vpc_routers(self.vpc1.id)
|
||||||
for router in routers:
|
for router in routers:
|
||||||
@ -931,14 +931,14 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
||||||
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
||||||
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth3", True)
|
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth3", True)
|
||||||
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth4", True)
|
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth4", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
||||||
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth4")
|
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth3")
|
||||||
|
|
||||||
# 26. restart VPC with cleanup, makeredundant=true
|
# 26. restart VPC with cleanup, makeredundant=true
|
||||||
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
# verify the available nics in VR should be "eth0,eth1,eth2,eth3,eth4,eth5,"
|
||||||
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> tier 1, eth4 -> private gateway, eth5 -> tier 2
|
# verify the IPs in VR. eth1 -> source nat IP, eth2 -> new ip 6, eth3 -> private gateway, eth4 -> tier 1, eth5 -> tier 2
|
||||||
self.vpc1.restart(self.apiclient, cleanup=True, makeredundant=True)
|
self.vpc1.restart(self.apiclient, cleanup=True, makeredundant=True)
|
||||||
routers = self.get_vpc_routers(self.vpc1.id)
|
routers = self.get_vpc_routers(self.vpc1.id)
|
||||||
for router in routers:
|
for router in routers:
|
||||||
@ -948,7 +948,7 @@ class TestMultiplePublicIpSubnets(cloudstackTestCase):
|
|||||||
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
self.verify_ip_address_in_router(router, host, controlIp, "eth0", True)
|
||||||
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
self.verify_ip_address_in_router(router, host, sourcenatIp, "eth1", True)
|
||||||
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth2", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth3", True)
|
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth3", True)
|
||||||
self.verify_ip_address_in_router(router, host, private_gateway_ip, "eth4", True)
|
self.verify_ip_address_in_router(router, host, tier1_Ip, "eth4", True)
|
||||||
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
self.verify_ip_address_in_router(router, host, tier2_Ip, "eth5", True)
|
||||||
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth4")
|
self.verify_router_publicnic_state(router, host, "eth1|eth2|eth3")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user