Skip to content

Commit 03da8cb

Browse files
server: fix conserve_mode of DefaultIsolatedNetworkOfferingForVpcNetworks (#11133)
* server: fix conserve_mode of DefaultIsolatedNetworkOfferingForVpcNetworks * test: update test_network_acl.py to test conserve mode * Update test/integration/smoke/test_network_acl.py Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
1 parent 0b381d4 commit 03da8cb

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,3 +754,6 @@ SET `cs`.`domain_id` = (
754754
FROM `cloud`.`account` `acc`
755755
WHERE `acc`.`id` = `cs`.`account_id`
756756
);
757+
758+
-- Re-apply VPC: update default network offering for vpc tier to conserve_mode=1 (#8309)
759+
UPDATE `cloud`.`network_offerings` SET conserve_mode = 1 WHERE name = 'DefaultIsolatedNetworkOfferingForVpcNetworks';

server/src/main/java/com/cloud/server/ConfigurationServerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
11191119
NetworkOfferingVO defaultNetworkOfferingForVpcNetworks =
11201120
new NetworkOfferingVO(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworks,
11211121
"Offering for Isolated Vpc networks with Source Nat service enabled", TrafficType.Guest, false, false, null, null, true, Availability.Optional,
1122-
null, Network.GuestType.Isolated, false, false, false, false, true, true);
1122+
null, Network.GuestType.Isolated, true, false, false, false, true, true);
11231123

11241124
defaultNetworkOfferingForVpcNetworks.setState(NetworkOffering.State.Enabled);
11251125
defaultNetworkOfferingForVpcNetworks.setSupportsVmAutoScaling(true);

test/integration/smoke/test_network_acl.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,32 @@ def test_network_acl(self):
125125
self.assertTrue(vm.state == 'Running', "VM is not running")
126126
self.debug("VM %s deployed in VPC %s" %(vm.id, vpc.id))
127127

128+
# 6) Acquire a Public IP, and add Load Balancing Rule
129+
public_ip = PublicIPAddress.create(
130+
self.apiclient,
131+
zoneid=self.zone.id,
132+
accountid=self.account.name,
133+
domainid=self.domain.id,
134+
vpcid=vpc.id
135+
)
136+
LoadBalancerRule.create(
137+
self.apiclient,
138+
self.services["lbrule"],
139+
ipaddressid=public_ip.ipaddress.id,
140+
accountid=self.account.name,
141+
vpcid=vpc.id,
142+
networkid=ntwk.id,
143+
domainid=self.account.domainid)
144+
145+
# 7) Add Port Forwarding Rule with same Public IP to test conserve mode
146+
NATRule.create(
147+
self.apiclient,
148+
vm,
149+
self.services["natrule"],
150+
ipaddressid=public_ip.ipaddress.id,
151+
vpcid=vpc.id,
152+
networkid=ntwk.id)
153+
128154
@classmethod
129155
def tearDownClass(cls):
130156
try:

0 commit comments

Comments
 (0)