Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 64AD21069B for ; Tue, 3 Sep 2013 23:41:32 +0000 (UTC) Received: (qmail 82452 invoked by uid 500); 3 Sep 2013 23:41:31 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 82408 invoked by uid 500); 3 Sep 2013 23:41:31 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 82348 invoked by uid 99); 3 Sep 2013 23:41:31 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Sep 2013 23:41:31 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id BED448C773D; Tue, 3 Sep 2013 23:41:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: animesh@apache.org To: commits@cloudstack.apache.org Date: Tue, 03 Sep 2013 23:41:33 -0000 Message-Id: <77ce53c81b0845f5aac9d870432e72ff@git.apache.org> In-Reply-To: <70c85572ec594afbb63603832c9ce052@git.apache.org> References: <70c85572ec594afbb63603832c9ce052@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/21] git commit: updated refs/heads/4.2 to 51707d8 CLOUDSTACK-4561: DeployVm failed after upgrading from earlier version having a private zone to 4.2 Changes: - In the upgrade path, for a private zone, entry needs to be added in the affinity_group_domain_map to provide access to the private zone for the domains it belongs too. (cherry picked from commit 0b9b36cbca0a4294ccdb3f68ababefc314d9fd8e) Signed-off-by: animesh Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c696b449 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c696b449 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c696b449 Branch: refs/heads/4.2 Commit: c696b449ee805672e01b7d90aee27ef2c7448db6 Parents: 499bd93 Author: Prachi Damle Authored: Thu Aug 29 14:33:36 2013 -0700 Committer: animesh Committed: Tue Sep 3 16:14:39 2013 -0700 ---------------------------------------------------------------------- .../schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 9 +++++++++ setup/db/db/schema-410to420.sql | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c696b449/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java index 2e58ddd..773ad62 100755 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java @@ -392,6 +392,15 @@ public class Upgrade410to420 implements DbUpgrade { if (rs2.next()) { affinityGroupId = rs2.getLong(1); } + + // add the domain map + String sqlMap = "INSERT INTO `cloud`.`affinity_group_domain_map` (`domain_id`, `affinity_group_id`) VALUES (?, ?)"; + pstmtUpdate = conn.prepareStatement(sqlMap); + pstmtUpdate.setLong(1, domainId); + pstmtUpdate.setLong(2, affinityGroupId); + pstmtUpdate.executeUpdate(); + pstmtUpdate.close(); + } rs2.close(); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c696b449/setup/db/db/schema-410to420.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index 723791d..6eb7534 100644 --- a/setup/db/db/schema-410to420.sql +++ b/setup/db/db/schema-410to420.sql @@ -440,7 +440,7 @@ CREATE TABLE `cloud`.`affinity_group_domain_map` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', `domain_id` bigint unsigned NOT NULL COMMENT 'domain id', `affinity_group_id` bigint unsigned NOT NULL COMMENT 'affinity group id', - `subdomain_access` int(1) unsigned COMMENT '1 if affinity group can be accessible from the subdomain', + `subdomain_access` int(1) unsigned DEFAULT 1 COMMENT '1 if affinity group can be accessible from the subdomain', PRIMARY KEY (`id`), CONSTRAINT `fk_affinity_group_domain_map__domain_id` FOREIGN KEY (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_affinity_group_domain_map__affinity_group_id` FOREIGN KEY (`affinity_group_id`) REFERENCES `affinity_group`(`id`) ON DELETE CASCADE