Skip to content

Commit 33e2a4d

Browse files
VPC: update default network offering for vpc tier to conserve_mode=1 (#8309)
This PR updates the conserve mode of default vpc tier offering to conserve_mode=1 so we can create both port forwarding and load balancing rules on a public IP in vpc tiers. This fixes #8313
1 parent 16d45f7 commit 33e2a4d

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
ALTER TABLE `cloud`.`mshost` MODIFY COLUMN `state` varchar(25);
2323

24+
UPDATE `cloud`.`network_offerings` SET conserve_mode=1 WHERE name='DefaultIsolatedNetworkOfferingForVpcNetworks';
25+
2426
-- Invalidate existing console_session records
2527
UPDATE `cloud`.`console_session` SET removed=now();
2628
-- Modify acquired column in console_session to datetime type

server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,9 +1809,9 @@ public void validateNtwkOffForVpc(final NetworkOffering guestNtwkOff, final List
18091809
* ("No redunant router support when network belnogs to VPC"); }
18101810
*/
18111811

1812-
// 4) Conserve mode should be off
1812+
// 4) Conserve mode should be off in older versions
18131813
if (guestNtwkOff.isConserveMode()) {
1814-
throw new InvalidParameterValueException("Only networks with conserve mode Off can belong to VPC");
1814+
s_logger.info("Creating a network with conserve mode in VPC");
18151815
}
18161816

18171817
// 5) If Netscaler is LB provider make sure it is in dedicated mode

test/integration/component/test_vpc_network.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,23 +1001,23 @@ def test_10_create_network_with_conserve_mode(self, value):
10011001
# 1. Create a network offering with guest type=Isolated that has all
10021002
# supported Services(Vpn,dhcpdns,UserData, SourceNat,Static NAT,LB
10031003
# and PF,LB,NetworkAcl ) provided by VPCVR and conserve mode is ON
1004-
# 2. Create offering fails since Conserve mode ON isn't allowed within
1005-
# VPC
1004+
# 2. Create offering should succeed since Conserve mode ON is allowed within
1005+
# VPC since https://github.com/apache/cloudstack/pull/8309
10061006
# 3. Repeat test for offering which has Netscaler as external LB
10071007
# provider
10081008
"""
10091009

10101010
self.debug("Creating network offering with conserve mode = ON")
10111011

1012-
with self.assertRaises(Exception):
1012+
try:
10131013
nw = NetworkOffering.create(
10141014
self.apiclient,
10151015
self.services[value],
10161016
conservemode=True
10171017
)
10181018
self.cleanup.append(nw)
1019-
self.debug(
1020-
"Network creation failed as VPC support nw with conserve mode OFF")
1019+
except Exception as e:
1020+
self.warn("Network creation failed in VPC with conserve mode ON")
10211021
return
10221022

10231023

0 commit comments

Comments
 (0)