From 3425161580e6ededcf96b5e69f44617accab776a Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Tue, 20 Sep 2011 17:31:19 -0700 Subject: [PATCH] bug 11504: Fix source nat ip's NIC strategy from upgrading We've added "Strategy.Managed" for source nat ip address, to prevent it from releasing when we try to execute restartNetwork command. But we didn't update the existed nics when mgmt upgraded. This would result in restartNetwork command fail(NPE) when try to restart an existed network. status 11504: resolved fixed Reviewed-by: Alena --- setup/db/db/schema-2211to2212.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup/db/db/schema-2211to2212.sql b/setup/db/db/schema-2211to2212.sql index 0af4b8a1549..0227045f54b 100644 --- a/setup/db/db/schema-2211to2212.sql +++ b/setup/db/db/schema-2211to2212.sql @@ -29,6 +29,8 @@ ALTER TABLE `cloud`.`resource_count` ADD UNIQUE `i_resource_count__type_domaintI UPDATE configuration set description='Load Balancer(haproxy) stats visibilty, the value can be one of the following six parameters : global,guest-network,link-local,disabled,all,default' WHERE name='network.loadbalancer.haproxy.stats.visibility' ; +UPDATE nics SET strategy="Managed" WHERE (ip4_address, network_id) IN (SELECT public_ip_address, source_network_id FROM user_ip_address WHERE source_nat=1); + CREATE TABLE IF NOT EXISTS `cloud`.`inline_load_balancer_nic_map` ( `id` bigint unsigned NOT NULL auto_increment, `load_balancer_id` bigint unsigned NOT NULL,