This is an automated email from the ASF dual-hosted git repository.

weizhou pushed a commit to branch 4.18-vm-autoscaling
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.18-vm-autoscaling by this 
push:
     new a758f103ec3 AS: Update column 'supports_vm_autoscaling' to 1 if 
network offerings support Lb
a758f103ec3 is described below

commit a758f103ec35525e4ee328a3ed560a4f129bf926
Author: Wei Zhou <[email protected]>
AuthorDate: Tue Nov 8 12:57:44 2022 +0100

    AS: Update column 'supports_vm_autoscaling' to 1 if network offerings 
support Lb
---
 .../src/main/resources/META-INF/db/schema-41710to41800.sql    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/engine/schema/src/main/resources/META-INF/db/schema-41710to41800.sql 
b/engine/schema/src/main/resources/META-INF/db/schema-41710to41800.sql
index f6ee5e207b2..de2903cfb9d 100644
--- a/engine/schema/src/main/resources/META-INF/db/schema-41710to41800.sql
+++ b/engine/schema/src/main/resources/META-INF/db/schema-41710to41800.sql
@@ -296,8 +296,15 @@ BEGIN
 
 -- Add column 'supports_vm_autoscaling' to 'network_offerings' table
 CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.network_offerings', 
'supports_vm_autoscaling', 'boolean default false');
-UPDATE `cloud`.`network_offerings` SET supports_vm_autoscaling = 1 WHERE 
unique_name = 'DefaultIsolatedNetworkOfferingWithSourceNatService';
-UPDATE `cloud`.`network_offerings` SET supports_vm_autoscaling = 1 WHERE 
unique_name = 'DefaultIsolatedNetworkOfferingForVpcNetworks';
+
+-- Update column 'supports_vm_autoscaling' to 1 if network offerings support Lb
+UPDATE `cloud`.`network_offerings`
+JOIN `cloud`.`ntwk_offering_service_map`
+ON network_offerings.id = ntwk_offering_service_map.network_offering_id
+SET network_offerings.supports_vm_autoscaling = 1
+WHERE ntwk_offering_service_map.service = 'Lb'
+    AND ntwk_offering_service_map.provider IN ('VirtualRouter', 
'VpcVirtualRouter', 'Netscaler')
+    AND network_offerings.removed IS NULL;
 
 -- Add column 'name' to 'autoscale_vmgroups' table
 CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.autoscale_vmgroups', 'name', 
'VARCHAR(255) DEFAULT NULL COMMENT "name of the autoscale vm group" AFTER 
`load_balancer_id`');

Reply via email to