From 5b48ec24d8d0dd5919d80d396d6f1825dfe5373f Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Mon, 10 Jun 2013 20:00:04 +0530 Subject: [PATCH 1/3] CLOUDSTACK-2924 Recurring snapshot schedule not showing up in UI For some of the volumes Recurring snapshot schedule was not showing up in UI because the active column was set to false. Since we dont use this column anymore I am removing the active=true check in the listSnapshotPolicies call. --- .../schema/src/com/cloud/storage/dao/SnapshotPolicyDaoImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/engine/schema/src/com/cloud/storage/dao/SnapshotPolicyDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/SnapshotPolicyDaoImpl.java index 3f894a22640..5394a8fa103 100644 --- a/engine/schema/src/com/cloud/storage/dao/SnapshotPolicyDaoImpl.java +++ b/engine/schema/src/com/cloud/storage/dao/SnapshotPolicyDaoImpl.java @@ -63,7 +63,6 @@ public class SnapshotPolicyDaoImpl extends GenericDaoBase listByVolumeId(long volumeId, Filter filter) { SearchCriteria sc = VolumeIdSearch.create(); sc.setParameters("volumeId", volumeId); - sc.setParameters("active", true); return listBy(sc, filter); } From ef0e0f36b2e33eb65c2f0a2e99aa02eabf872b85 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Mon, 10 Jun 2013 20:38:37 +0530 Subject: [PATCH 2/3] deployment planners plan per clusters not hosts Concentration or Dispersion granularity is at the Cluster level and not at the host level. So correcting the test to ensure a. concentrated planner puts the VMs in same cluster b. dispersed planner puts the Vms in diff't clusters Signed-off-by: Prasanna Santhanam --- setup/dev/advanced.cfg | 18 ++++++++++++++++ ...ploy_vms_with_varied_deploymentplanners.py | 21 ++++++++++++------- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/setup/dev/advanced.cfg b/setup/dev/advanced.cfg index 83357866ca7..302016569ab 100644 --- a/setup/dev/advanced.cfg +++ b/setup/dev/advanced.cfg @@ -99,6 +99,24 @@ "name": "PS1" } ] + }, + { + "clustername": "C1", + "hypervisor": "simulator", + "hosts": [ + { + "username": "root", + "url": "http://sim/c1/h0", + "password": "password" + } + ], + "clustertype": "CloudManaged", + "primaryStorages": [ + { + "url": "nfs://10.147.28.6:/export/home/sandbox/primary2", + "name": "PS2" + } + ] } ], "gateway": "172.16.15.1" diff --git a/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py b/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py index 67532c78d0f..f1b304346af 100644 --- a/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py +++ b/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py @@ -16,7 +16,7 @@ # under the License. from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.integration.lib.base import Account, VirtualMachine, ServiceOffering +from marvin.integration.lib.base import Account, VirtualMachine, ServiceOffering, Host from marvin.integration.lib.common import get_zone, get_domain, get_template, cleanup_resources from nose.plugins.attrib import attr @@ -76,6 +76,7 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase): domainid=cls.domain.id ) cls.services["account"] = cls.account.name + cls.hosts = Host.list(cls.apiclient, hypervisortype='Simulator') cls.cleanup = [ cls.account ] @@ -177,10 +178,12 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase): "Running", msg="VM is not in Running state" ) + vm1clusterid = filter(lambda c: c.id == vm1.hostid, self.hosts)[0].clusterid + vm2clusterid = filter(lambda c: c.id == vm2.hostid, self.hosts)[0].clusterid self.assertNotEqual( - vm1.hostid, - vm2.hostid, - msg="VMs meant to be dispersed are deployed on the same host" + vm1clusterid, + vm2clusterid, + msg="VMs (%s, %s) meant to be dispersed are deployed in the same cluster %s" % (vm1.id, vm2.id, vm1clusterid) ) @attr(tags=["simulator", "advanced", "basic", "sg"]) @@ -236,10 +239,12 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase): "Running", msg="VM is not in Running state" ) - self.assertNotEqual( - vm1.hostid, - vm2.hostid, - msg="VMs meant to be concentrated are deployed on the different hosts" + vm1clusterid = filter(lambda c: c.id == vm1.hostid, self.hosts)[0].clusterid + vm2clusterid = filter(lambda c: c.id == vm2.hostid, self.hosts)[0].clusterid + self.assertEqual( + vm1clusterid, + vm2clusterid, + msg="VMs (%s, %s) meant to be concentrated are deployed on different clusters (%s, %s)" % (vm1.id, vm2.id, vm1clusterid, vm2clusterid) ) @classmethod From 3f3c6aa35f64c4129c203d54840524e6aa2c4621 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Mon, 10 Jun 2013 21:05:33 +0530 Subject: [PATCH 3/3] Test should find Routing hosts not specific hypervisor_type Bug in listing hosts that can be used for deploying VMs. Use Routing hosts to identify hosts regardless of hypervisor_type. Signed-off-by: Prasanna Santhanam --- .../smoke/test_deploy_vms_with_varied_deploymentplanners.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py b/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py index f1b304346af..af832995245 100644 --- a/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py +++ b/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py @@ -76,7 +76,7 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase): domainid=cls.domain.id ) cls.services["account"] = cls.account.name - cls.hosts = Host.list(cls.apiclient, hypervisortype='Simulator') + cls.hosts = Host.list(cls.apiclient, type='Routing') cls.cleanup = [ cls.account ]