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>
This commit is contained in:
Wei Zhou 2025-08-15 14:28:28 +02:00 committed by GitHub
parent 0b381d4270
commit 03da8cbd3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 1 deletions

View File

@ -754,3 +754,6 @@ SET `cs`.`domain_id` = (
FROM `cloud`.`account` `acc` FROM `cloud`.`account` `acc`
WHERE `acc`.`id` = `cs`.`account_id` WHERE `acc`.`id` = `cs`.`account_id`
); );
-- Re-apply VPC: update default network offering for vpc tier to conserve_mode=1 (#8309)
UPDATE `cloud`.`network_offerings` SET conserve_mode = 1 WHERE name = 'DefaultIsolatedNetworkOfferingForVpcNetworks';

View File

@ -1119,7 +1119,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
NetworkOfferingVO defaultNetworkOfferingForVpcNetworks = NetworkOfferingVO defaultNetworkOfferingForVpcNetworks =
new NetworkOfferingVO(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworks, new NetworkOfferingVO(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworks,
"Offering for Isolated Vpc networks with Source Nat service enabled", TrafficType.Guest, false, false, null, null, true, Availability.Optional, "Offering for Isolated Vpc networks with Source Nat service enabled", TrafficType.Guest, false, false, null, null, true, Availability.Optional,
null, Network.GuestType.Isolated, false, false, false, false, true, true); null, Network.GuestType.Isolated, true, false, false, false, true, true);
defaultNetworkOfferingForVpcNetworks.setState(NetworkOffering.State.Enabled); defaultNetworkOfferingForVpcNetworks.setState(NetworkOffering.State.Enabled);
defaultNetworkOfferingForVpcNetworks.setSupportsVmAutoScaling(true); defaultNetworkOfferingForVpcNetworks.setSupportsVmAutoScaling(true);

View File

@ -125,6 +125,32 @@ class TestNetworkACL(cloudstackTestCase):
self.assertTrue(vm.state == 'Running', "VM is not running") self.assertTrue(vm.state == 'Running', "VM is not running")
self.debug("VM %s deployed in VPC %s" %(vm.id, vpc.id)) self.debug("VM %s deployed in VPC %s" %(vm.id, vpc.id))
# 6) Acquire a Public IP, and add Load Balancing Rule
public_ip = PublicIPAddress.create(
self.apiclient,
zoneid=self.zone.id,
accountid=self.account.name,
domainid=self.domain.id,
vpcid=vpc.id
)
LoadBalancerRule.create(
self.apiclient,
self.services["lbrule"],
ipaddressid=public_ip.ipaddress.id,
accountid=self.account.name,
vpcid=vpc.id,
networkid=ntwk.id,
domainid=self.account.domainid)
# 7) Add Port Forwarding Rule with same Public IP to test conserve mode
NATRule.create(
self.apiclient,
vm,
self.services["natrule"],
ipaddressid=public_ip.ipaddress.id,
vpcid=vpc.id,
networkid=ntwk.id)
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
try: try: