You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@apache.org on 2013/11/08 14:22:29 UTC

git commit: updated refs/heads/4.2 to 9e6a1ea

Updated Branches:
  refs/heads/4.2 9d00bfeba -> 9e6a1eaff


CLOUDSTACK-5107: Decreasing memory in service offering so as
 not to run out of resources

Signed-off-by: Girish Shilamkar <gi...@clogeny.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9e6a1eaf
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9e6a1eaf
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9e6a1eaf

Branch: refs/heads/4.2
Commit: 9e6a1eaffe3df0981703dc26ab4cc7043d4ca23f
Parents: 9d00bfe
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Fri Nov 8 18:51:43 2013 +0530
Committer: Girish Shilamkar <gi...@clogeny.com>
Committed: Fri Nov 8 18:51:43 2013 +0530

----------------------------------------------------------------------
 .../component/test_mm_domain_limits.py          | 59 ++++++++++----------
 test/integration/component/test_mm_limits.py    | 40 ++++++-------
 .../component/test_mm_project_limits.py         |  2 +-
 3 files changed, 50 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e6a1eaf/test/integration/component/test_mm_domain_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_mm_domain_limits.py b/test/integration/component/test_mm_domain_limits.py
index d87db84..c856087 100644
--- a/test/integration/component/test_mm_domain_limits.py
+++ b/test/integration/component/test_mm_domain_limits.py
@@ -56,7 +56,7 @@ class Services:
                                 "displaytext": "Tiny Instance",
                                 "cpunumber": 1,
                                 "cpuspeed": 100,    # in MHz
-                                "memory": 5120,    # In MBs
+                                "memory": 2048,    # In MBs
                         },
                         "virtual_machine": {
                                 "displayname": "TestVM",
@@ -183,7 +183,7 @@ class TestDomainMemoryLimits(cloudstackTestCase):
 
         Resources.updateLimit(self.apiclient,
                               resourcetype=9,
-                              max=15360,
+                              max=6144,
                               account=self.child_do_admin_1.name,
                               domainid=self.child_do_admin_1.domainid)
 
@@ -203,17 +203,17 @@ class TestDomainMemoryLimits(cloudstackTestCase):
 
         Resources.updateLimit(self.apiclient,
                               resourcetype=9,
-                              max=15360,
+                              max=6144,
                               account=self.child_do_admin_2.name,
                               domainid=self.child_do_admin_2.domainid)
         return
 
     @attr(tags=["advanced", "advancedns","simulator"])
     def test_01_change_service_offering(self):
-        """Test Deploy VM with 5 GB RAM & verify the usage"""
+        """Test Deploy VM with specified RAM & verify the usage"""
 
         # Validate the following
-        # 1. Create compute offering with 5 GB RAM & Deploy VM in the created domain
+        # 1. Create compute offering with specified RAM & Deploy VM in the created domain
         # 2. List Resource count for the root admin Memory usage
         # 3. Upgrade and downgrade service offering
         # 4. Resource count should list properly for the domain
@@ -228,7 +228,7 @@ class TestDomainMemoryLimits(cloudstackTestCase):
             self.domain = domain
 
             #Resetting memory count in service offering
-            self.services["service_offering"]["memory"] = 5120
+            self.services["service_offering"]["memory"] = 2048
 
             self.debug("Creating an instance with service offering: %s" %
                                                     self.service_offering.name)
@@ -266,24 +266,24 @@ class TestDomainMemoryLimits(cloudstackTestCase):
             self.assertEqual(resource_count_after_stop, expected_resource_count,
                          "Resource count should be same after stopping the instance")
 
-            self.debug("Creating service offering with 7 GB RAM")
-            self.services["service_offering"]["memory"] = 7168
-            self.service_offering_7gb = ServiceOffering.create(
+            self.debug("Creating service offering with 5 GB RAM")
+            self.services["service_offering"]["memory"] = 5120
+            self.service_offering_5gb = ServiceOffering.create(
                                             self.apiclient,
                                             self.services["service_offering"]
                                             )
             # Adding to cleanup list after execution
-            self.cleanup.append(self.service_offering_7gb)
+            self.cleanup.append(self.service_offering_5gb)
 
             self.debug(
                 "Upgrade service offering of instance %s from %s to %s" %
                                             (vm.name,
                                              self.service_offering.name,
-                                             self.service_offering_7gb.name))
+                                             self.service_offering_5gb.name))
 
             try:
                 vm.change_service_offering(self.apiclient,
-                                serviceOfferingId=self.service_offering_7gb.id)
+                                serviceOfferingId=self.service_offering_5gb.id)
             except Exception as e:
                 self.fail("Failed to change service offering of vm %s - %s" %
                                                                 (vm.name, e))
@@ -305,7 +305,7 @@ class TestDomainMemoryLimits(cloudstackTestCase):
             self.debug(
                 "Down grade service offering of instance %s from %s to %s" %
                                             (vm.name,
-                                             self.service_offering_7gb.name,
+                                             self.service_offering_5gb.name,
                                              self.service_offering.name))
 
             try:
@@ -349,15 +349,15 @@ class TestDomainMemoryLimits(cloudstackTestCase):
 
     @attr(tags=["advanced", "advancedns","simulator"])
     def test_02_migrate_vm(self):
-        """Test Deploy VM with 5 GB RAM & verify the usage"""
+        """Test Deploy VM with specified RAM & verify the usage"""
 
         # Validate the following
-        # 1. Create compute offering with 5 GB RAM & Deploy VM in the created domain
+        # 1. Create compute offering with specified RAM & Deploy VM in the created domain
         # 2. List Resource count for the root admin Memory usage
         # 3. Migrate vm to another host, resource count should list properly.
 
         #Resetting memory count in service offering
-        self.services["service_offering"]["memory"] = 5120
+        self.services["service_offering"]["memory"] = 2048
 
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts()
@@ -408,15 +408,15 @@ class TestDomainMemoryLimits(cloudstackTestCase):
 
     @attr(tags=["advanced", "advancedns","simulator"])
     def test_03_delete_vm(self):
-        """Test Deploy VM with 5 GB RAM & verify the usage"""
+        """Test Deploy VM with specified RAM & verify the usage"""
 
         # Validate the following
-        # 1. Create compute offering with 5 GB RAM & Deploy VM in the created domain
+        # 1. Create compute offering with specified RAM & Deploy VM in the created domain
         # 2. List Resource count for the root admin Memory usage
         # 3. Delete vm, resource count should list as 0 after delete operation.
 
         # Resetting the memory count of service offering
-        self.services["service_offering"]["memory"] = 5120
+        self.services["service_offering"]["memory"] = 2048
 
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts()
@@ -467,16 +467,16 @@ class TestDomainMemoryLimits(cloudstackTestCase):
 
     @attr(tags=["advanced", "advancedns","simulator"])
     def test_04_deploy_multiple_vm(self):
-        """Test Deploy multiple VM with 5 GB RAM & verify the usage"""
+        """Test Deploy multiple VM with specified RAM & verify the usage"""
 
         # Validate the following
-        # 1. Create compute offering with 5 GB RAM
+        # 1. Create compute offering with specified RAM
         # 2. Deploy multiple VMs with this service offering
         # 3. List Resource count for the root admin Memory usage
         # 4. Memory usage should list properly
 
         # Resetting the memory count of service offering
-        self.services["service_offering"]["memory"] = 5120
+        self.services["service_offering"]["memory"] = 2048
 
         self.debug("Setting up account and domain hierarchy")
         self.setupAccounts()
@@ -607,7 +607,7 @@ class TestMultipleChildDomainsMemory(cloudstackTestCase):
                                                             self.domain.name)
         Resources.updateLimit(self.apiclient,
                               resourcetype=9,
-                              max=10240,
+                              max=4096,
                               account=self.parentd_admin.name,
                               domainid=self.parentd_admin.domainid)
         self.debug("Creating a sub-domain under: %s" % self.parent_domain.name)
@@ -631,14 +631,14 @@ class TestMultipleChildDomainsMemory(cloudstackTestCase):
                                                         self.cdomain_1.name)
         Resources.updateLimit(self.apiclient,
                               resourcetype=9,
-                              max=5120,
+                              max=2048,
                               domainid=self.cadmin_1.domainid)
 
         self.debug("Updating the Memory resource count for account: %s" %
                                                         self.cadmin_1.name)
         Resources.updateLimit(self.apiclient,
                               resourcetype=9,
-                              max=2148,
+                              max=2048,
                               account=self.cadmin_1.name,
                               domainid=self.cadmin_1.domainid)
 
@@ -653,14 +653,14 @@ class TestMultipleChildDomainsMemory(cloudstackTestCase):
                                                         self.cdomain_2.name)
         Resources.updateLimit(self.apiclient,
                               resourcetype=9,
-                              max=5120,
+                              max=2048,
                               domainid=self.cadmin_2.domainid)
 
         self.debug("Updating the Memory resource count for domain: %s" %
                                                         self.cadmin_2.name)
         Resources.updateLimit(self.apiclient,
                               resourcetype=9,
-                              max=2148,
+                              max=2048,
                               account=self.cadmin_2.name,
                               domainid=self.cadmin_2.domainid)
 
@@ -684,9 +684,8 @@ class TestMultipleChildDomainsMemory(cloudstackTestCase):
         """Test memory limits with multiple child domains"""
 
         # Validate the following
-        # 1. Create Domain1 with 10 GB RAM and 2 child domains with 5 GB
-        #    each.Assign 2 GB for Domain1 admin1 & Domain1 User1 .Assign 2
-        #    GB for Domain2 admin1 & Domain2 User1
+        # 1. Create Domain1 with 4 GB RAM and 2 child domains with 2 GB
+        #    each.
         # 2. Deploy VM's by Domain1 admin1/user1/ Domain2 user1/Admin1 account
         #    and verify the resource updates
         # 3. Deploy VM by admin account after reaching max parent domain limit

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e6a1eaf/test/integration/component/test_mm_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_mm_limits.py b/test/integration/component/test_mm_limits.py
index 18eab4c..7da85a5 100644
--- a/test/integration/component/test_mm_limits.py
+++ b/test/integration/component/test_mm_limits.py
@@ -55,7 +55,7 @@ class Services:
                                 "displaytext": "Tiny Instance",
                                 "cpunumber": 1,
                                 "cpuspeed": 100,    # in MHz
-                                "memory": 5120,    # In MBs
+                                "memory": 2048,    # In MBs
                         },
                         "virtual_machine": {
                                 "displayname": "TestVM",
@@ -177,10 +177,10 @@ class TestMemoryLimits(cloudstackTestCase):
 
     @attr(tags=["advanced", "advancedns","simulator"])
     def test_01_stop_start_instance(self):
-        """Test Deploy VM with 5 GB RAM & verify the usage"""
+        """Test Deploy VM with specified RAM & verify the usage"""
 
         # Validate the following
-        # 1. Create compute offering with 5 GB RAM & Deploy VM as root admin
+        # 1. Create compute offering with specified RAM & Deploy VM as root admin
         # 2 .List Resource count for the root admin Memory usage
         # 3. Stop and start instance, resource count should list properly.
 
@@ -229,10 +229,10 @@ class TestMemoryLimits(cloudstackTestCase):
 
     @attr(tags=["advanced", "advancedns","simulator"])
     def test_02_migrate_instance(self):
-        """Test Deploy VM with 5 GB RAM & verify the usage"""
+        """Test Deploy VM with specified RAM & verify the usage"""
 
         # Validate the following
-        # 1. Create compute offering with 5 GB RAM & Deploy VM as root admin
+        # 1. Create compute offering with specified RAM & Deploy VM as root admin
         # 2. List Resource count for the root admin Memory usage
         # 3. Migrate vm, resource count should list properly.
 
@@ -268,10 +268,10 @@ class TestMemoryLimits(cloudstackTestCase):
 
     @attr(tags=["advanced", "advancedns","simulator"])
     def test_03_delete_instance(self):
-        """Test Deploy VM with 5 GB RAM & verify the usage"""
+        """Test Deploy VM with specified GB RAM & verify the usage"""
 
         # Validate the following
-        # 1. Create compute offering with 5 GB RAM & Deploy VM as root admin
+        # 1. Create compute offering with specified RAM & Deploy VM as root admin
         # 2. List Resource count for the root admin Memory usage
         # 3. Delete instance, resource count should be 0 after delete operation.
 
@@ -306,11 +306,11 @@ class TestMemoryLimits(cloudstackTestCase):
         return
 
     @attr(tags=["advanced", "advancedns","simulator"])
-    def test_04_deploy_multiple_vm_with_5gb_ram(self):
-        """Test Deploy multiple VM with 5 GB RAM & verify the usage"""
+    def test_04_deploy_multiple_vm(self):
+        """Test Deploy multiple VM with specified RAM & verify the usage"""
 
         # Validate the following
-        # 1. Create compute offering with 5 GB RAM
+        # 1. Create compute offering with specified RAM
         # 2. Deploy multiple VMs with this service offering
         # 3. List Resource count for the root admin Memory usage
         # 4. Memory usage should list properly
@@ -550,10 +550,10 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase):
 
     @attr(tags=["advanced", "advancedns","simulator"])
     def test_02_migrate_instance(self):
-        """Test Deploy VM with 5 GB memory & verify the usage"""
+        """Test Deploy VM with specified memory & verify the usage"""
 
         # Validate the following
-        # 1. Create compute offering with 5 GB memory in child domains of root domain & Deploy VM
+        # 1. Create compute offering with specified memory in child domains of root domain & Deploy VM
         # 2. List Resource count
         # 3. Migrate instance to another host
         # 4. Resource count should list properly.
@@ -608,10 +608,10 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase):
 
     @attr(tags=["advanced", "advancedns","simulator"])
     def test_03_delete_instance(self):
-        """Test Deploy VM with 5 GB RAM & verify the usage"""
+        """Test Deploy VM with specified RAM & verify the usage"""
 
         # Validate the following
-        # 1. Create compute offering with 5 GB RAM in child domains of root domain & Deploy VM
+        # 1. Create compute offering with specified RAM in child domains of root domain & Deploy VM
         # 2. List Resource count for the Memory usage
         # 3. Delete instance
         # 4. Resource count should list as 0
@@ -663,16 +663,16 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase):
     @attr(tags=["advanced", "advancedns","simulator"])
     @attr(configuration='max.account.memory')
     def test_04_deploy_multiple_vm(self):
-        """Test Deploy multiple VM with 5 GB memory & verify the usage"""
-	    #keep the configuration value - max.account.memory = 20480
+        """Test Deploy multiple VM with 2 GB memory & verify the usage"""
+	    #keep the configuration value - max.account.memory = 8192 (maximum 4 instances per account with 2 GB RAM)
 
         # Validate the following
-        # 1. Create compute offering with 5 GB RAM
+        # 1. Create compute offering with 2 GB RAM
         # 2. Deploy multiple VMs with this service offering in child domains of root domain
         # 3. List Resource count for the root admin Memory usage
         # 4. Memory usage should list properly
 
-        self.debug("Creating service offering with 5 GB RAM")
+        self.debug("Creating service offering with 2 GB RAM")
         self.service_offering = ServiceOffering.create(
                                             self.apiclient,
                                             self.services["service_offering"]
@@ -695,8 +695,8 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase):
                                 domainid = self.domain.id
                                 )
 
-            if memory_account_gc[0].max != 20480:
-                self.skipTest("This test case requires configuration value max.account.memory to be 20480")
+            if memory_account_gc[0].max != 8192:
+                self.skipTest("This test case requires configuration value max.account.memory to be 8192")
 
 	        api_client = self.testClient.createUserApiClient(
                              UserName=self.account.name,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e6a1eaf/test/integration/component/test_mm_project_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_mm_project_limits.py b/test/integration/component/test_mm_project_limits.py
index 1c0ed92..ffeb20a 100644
--- a/test/integration/component/test_mm_project_limits.py
+++ b/test/integration/component/test_mm_project_limits.py
@@ -55,7 +55,7 @@ class Services:
                                 "displaytext": "Tiny Instance",
                                 "cpunumber": 1,
                                 "cpuspeed": 100,    # in MHz
-                                "memory": 5120,    # In MBs
+                                "memory": 2048,    # In MBs
                         },
                         "virtual_machine": {
                                 "displayname": "TestVM",