You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ml...@apache.org on 2014/03/11 01:13:02 UTC

[1/4] git commit: updated refs/heads/resize-root to 79bd6f1

Repository: cloudstack
Updated Branches:
  refs/heads/resize-root f0a7a7f23 -> 79bd6f1a7


Merge branch 'master' into resize-root


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

Branch: refs/heads/resize-root
Commit: b8f571ffd506cce699a83acb054250f4fadc58a5
Parents: e42502a bf9375b
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Mon Feb 10 10:49:12 2014 -0700
Committer: Marcus Sorensen <ma...@betterservers.com>
Committed: Mon Feb 10 10:49:12 2014 -0700

----------------------------------------------------------------------
 api/src/com/cloud/event/EventTypes.java         |   5 +
 .../VpcVirtualNetworkApplianceService.java      |   8 +-
 core/src/com/cloud/info/ConsoleProxyInfo.java   |  19 +-
 .../engine/orchestration/CloudOrchestrator.java |   2 +-
 .../storage/image/TemplateServiceImpl.java      |  13 +-
 .../src/com/cloud/hypervisor/XenServerGuru.java |  33 +-
 .../driver/CloudStackImageStoreDriverImpl.java  |  12 +-
 server/src/com/cloud/api/ApiDispatcher.java     |   7 +
 server/src/com/cloud/api/ApiServer.java         |  11 +-
 .../dispatch/ParamGenericValidationWorker.java  |   4 +-
 server/src/com/cloud/configuration/Config.java  |   4 +-
 .../consoleproxy/ConsoleProxyManagerImpl.java   |  11 +-
 .../src/com/cloud/event/ActionEventUtils.java   |  12 +-
 .../com/cloud/network/IpAddressManagerImpl.java |   4 +-
 .../src/com/cloud/network/NetworkModelImpl.java |  14 +-
 .../element/VpcVirtualRouterElement.java        |  14 +-
 .../VpcVirtualNetworkApplianceManagerImpl.java  |  34 +-
 .../com/cloud/network/vpc/VpcManagerImpl.java   |   4 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java  |   1 -
 .../cloud/network/vpc/VpcManagerImplTest.java   |  66 +++
 .../MockVpcVirtualNetworkApplianceManager.java  |   7 +-
 .../SecondaryStorageManagerImpl.java            |   7 +
 setup/db/db/schema-421to430.sql                 |   4 +
 systemvm/conf/consoleproxy.properties           |   2 +-
 .../component/test_cpu_domain_limits.py         |  11 +-
 test/integration/component/test_cpu_limits.py   |  15 +-
 .../component/test_cpu_project_limits.py        |   7 +-
 .../component/test_dynamic_compute_offering.py  | 409 +++++++++++++++++++
 .../integration/component/test_memory_limits.py |  15 +-
 .../component/test_mm_domain_limits.py          |   7 +-
 .../component/test_mm_project_limits.py         |   7 +-
 test/integration/component/test_routers.py      |  28 +-
 .../component/test_vpc_vm_life_cycle.py         | 108 +----
 tools/marvin/marvin/codes.py                    |   1 +
 tools/marvin/marvin/integration/lib/base.py     |  29 +-
 tools/marvin/marvin/integration/lib/common.py   |  39 +-
 tools/marvin/marvin/integration/lib/utils.py    |   3 +-
 ui/css/cloudstack3.css                          |   2 +-
 38 files changed, 780 insertions(+), 199 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b8f571ff/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------


[3/4] git commit: updated refs/heads/resize-root to 79bd6f1

Posted by ml...@apache.org.
resizeroot: test for deployVirtualMachine with root disk size


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

Branch: refs/heads/resize-root
Commit: a0801a5d420a3394b3f4e3ef58996db08aa98134
Parents: bfb9e82
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Mon Feb 10 13:48:27 2014 -0700
Committer: Marcus Sorensen <ma...@betterservers.com>
Committed: Mon Feb 10 13:48:27 2014 -0700

----------------------------------------------------------------------
 .../smoke/test_deploy_vm_root_resize.py         | 179 +++++++++++++++++++
 tools/marvin/marvin/integration/lib/base.py     |   7 +-
 2 files changed, 184 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0801a5d/test/integration/smoke/test_deploy_vm_root_resize.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_deploy_vm_root_resize.py b/test/integration/smoke/test_deploy_vm_root_resize.py
new file mode 100644
index 0000000..a6584a2
--- /dev/null
+++ b/test/integration/smoke/test_deploy_vm_root_resize.py
@@ -0,0 +1,179 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#Test from the Marvin - Testing in Python wiki
+
+#All tests inherit from cloudstackTestCase
+from marvin.cloudstackTestCase import cloudstackTestCase
+
+#Import Integration Libraries
+
+#base - contains all resources as entities and defines create, delete, list operations on them
+from marvin.integration.lib.base import Account, VirtualMachine, ServiceOffering
+
+#utils - utility classes for common cleanup, external library wrappers etc
+from marvin.integration.lib.utils import cleanup_resources
+
+#common - commonly used methods for all tests are listed here
+from marvin.integration.lib.common import get_zone, get_domain, get_template, list_volumes
+
+from nose.plugins.attrib import attr
+
+class TestData(object):
+    """Test data object that is required to create resources
+    """
+    def __init__(self):
+        self.testdata = {
+            #data to create an account
+            "account": {
+                "email": "test@test.com",
+                "firstname": "Test",
+                "lastname": "User",
+                "username": "test",
+                "password": "password",
+            },
+            #data reqd for virtual machine creation
+            "virtual_machine" : {
+                "name" : "testvm",
+                "displayname" : "Test VM",
+            },
+            #small service offering
+            "service_offering": {
+                "small": {
+                    "name": "Small Instance",
+                    "displaytext": "Small Instance",
+                    "cpunumber": 1,
+                    "cpuspeed": 100,
+                    "memory": 256,
+                },
+            },
+            "ostype": 'CentOS 5.3 (64-bit)',
+        }
+
+class TestDeployVM(cloudstackTestCase):
+    """Test deploy a VM into a user account
+    """
+
+    def setUp(self):
+        self.testdata = TestData().testdata
+        self.apiclient = self.testClient.getApiClient()
+
+        # Get Zone, Domain and Default Built-in template
+        self.domain = get_domain(self.apiclient, self.testdata)
+        self.zone = get_zone(self.apiclient, self.testdata)
+        self.testdata["mode"] = self.zone.networktype
+#        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
+        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"], templatetype='USER', services = {"template":'31f52a4d-5681-43f7-8651-ad4aaf823618'})
+        
+
+        #create a user account
+        self.account = Account.create(
+            self.apiclient,
+            self.testdata["account"],
+            domainid=self.domain.id
+        )
+        #create a service offering
+        self.service_offering = ServiceOffering.create(
+            self.apiclient,
+            self.testdata["service_offering"]["small"]
+        )
+        #build cleanup list
+        self.cleanup = [
+            self.service_offering,
+            self.account
+        ]
+
+    @attr(tags = ['advanced', 'simulator', 'basic', 'sg'])
+    def test_deploy_vm_root_resize(self):
+        """Test Deploy Virtual Machine With Root Resize
+
+        # Validate the following:
+        # 1. listVirtualMachines returns accurate information
+        # 2. root disk has new size per listVolumes
+        # 3. Rejects non-supported hypervisor types
+        """
+        self.apiclient.hypervisor = 'KVM'
+        self.virtual_machine = VirtualMachine.create(
+            self.apiclient,
+            self.testdata["virtual_machine"],
+            accountid=self.account.name,
+            zoneid=self.zone.id,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering.id,
+            templateid=self.template.id,
+            rootdisksize=10
+        )
+
+        list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id)
+
+        self.debug(
+            "Verify listVirtualMachines response for virtual machine: %s"\
+            % self.virtual_machine.id
+        )
+
+        self.assertEqual(
+            isinstance(list_vms, list),
+            True,
+            "List VM response was not a valid list"
+        )
+        self.assertNotEqual(
+            len(list_vms),
+            0,
+            "List VM response was empty"
+        )
+
+        vm = list_vms[0]
+        self.assertEqual(
+            vm.id,
+            self.virtual_machine.id,
+            "Virtual Machine ids do not match"
+        )
+        self.assertEqual(
+            vm.name,
+            self.virtual_machine.name,
+            "Virtual Machine names do not match"
+        )
+        self.assertEqual(
+            vm.state,
+            "Running",
+            msg="VM is not in Running state"
+        )
+
+        # get root vol from created vm, verify it is 10G
+        list_volume_response = list_volumes(
+                                            self.apiclient,
+                                            virtualmachineid=self.virtual_machine.id,
+                                            type='ROOT',
+                                            listall=True
+                                            )
+
+        rootvolume = list_volume_response[0]
+        success = False
+        if rootvolume is not None and rootvolume.size == 10737418240L:
+            success = True
+
+        self.assertEqual(
+                         success,
+                         True,
+                         "Check if the root volume resized appropriately"
+                         )
+
+    def tearDown(self):
+        try:
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            self.debug("Warning! Exception in tearDown: %s" % e)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0801a5d/tools/marvin/marvin/integration/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py
index 7449d8c..3005a30 100755
--- a/tools/marvin/marvin/integration/lib/base.py
+++ b/tools/marvin/marvin/integration/lib/base.py
@@ -325,7 +325,7 @@ class VirtualMachine:
                     securitygroupids=None, projectid=None, startvm=None,
                     diskofferingid=None, affinitygroupnames=None, affinitygroupids=None, group=None,
                     hostid=None, keypair=None, ipaddress=None, mode='default', method='GET',
-                    customcpunumber=None, customcpuspeed=None, custommemory=None):
+                    customcpunumber=None, customcpuspeed=None, custommemory=None, rootdisksize=None):
         """Create the instance"""
 
         cmd = deployVirtualMachine.deployVirtualMachineCmd()
@@ -413,7 +413,7 @@ class VirtualMachine:
         if "userdata" in services:
             cmd.userdata = base64.urlsafe_b64encode(services["userdata"])
 
-        cmd.details = [{"cpuNumber": "","cpuSpeed":"","memory":""}]
+        cmd.details = [{"cpuNumber": "","cpuSpeed":"","memory":"","rootdisksize":""}]
 
         if customcpunumber:
             cmd.details[0]["cpuNumber"] = customcpunumber
@@ -424,6 +424,9 @@ class VirtualMachine:
         if custommemory:
             cmd.details[0]["memory"] = custommemory
 
+        if rootdisksize:
+            cmd.details[0]["rootdisksize"] = rootdisksize
+
         if group:
             cmd.group = group
 


[4/4] git commit: updated refs/heads/resize-root to 79bd6f1

Posted by ml...@apache.org.
resize-root: fix test_deploy_vm_root_resize to use default template


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

Branch: refs/heads/resize-root
Commit: 79bd6f1a75ee14fbc63d3c2a6697b960c3d54a8d
Parents: a0801a5
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Mon Feb 10 13:50:30 2014 -0700
Committer: Marcus Sorensen <ma...@betterservers.com>
Committed: Mon Feb 10 13:50:30 2014 -0700

----------------------------------------------------------------------
 test/integration/smoke/test_deploy_vm_root_resize.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79bd6f1a/test/integration/smoke/test_deploy_vm_root_resize.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_deploy_vm_root_resize.py b/test/integration/smoke/test_deploy_vm_root_resize.py
index a6584a2..b24cf4d 100644
--- a/test/integration/smoke/test_deploy_vm_root_resize.py
+++ b/test/integration/smoke/test_deploy_vm_root_resize.py
@@ -76,8 +76,9 @@ class TestDeployVM(cloudstackTestCase):
         self.domain = get_domain(self.apiclient, self.testdata)
         self.zone = get_zone(self.apiclient, self.testdata)
         self.testdata["mode"] = self.zone.networktype
-#        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
-        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"], templatetype='USER', services = {"template":'31f52a4d-5681-43f7-8651-ad4aaf823618'})
+        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
+#       for testing with specific template
+#        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"], templatetype='USER', services = {"template":'31f52a4d-5681-43f7-8651-ad4aaf823618'})
         
 
         #create a user account


[2/4] git commit: updated refs/heads/resize-root to 79bd6f1

Posted by ml...@apache.org.
Merge branch 'resize-root' of https://git-wip-us.apache.org/repos/asf/cloudstack into resize-root


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

Branch: refs/heads/resize-root
Commit: bfb9e82e1724824f26b9dde49e1700cfd21f5309
Parents: b8f571f f0a7a7f
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Mon Feb 10 13:47:01 2014 -0700
Committer: Marcus Sorensen <ma...@betterservers.com>
Committed: Mon Feb 10 13:47:01 2014 -0700

----------------------------------------------------------------------
 agent/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-agent.in          | 2 +-
 agent/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-agent.in          | 2 +-
 agent/distro/opensuse/sles/SYSCONFDIR/init.d/cloud-agent.in        | 2 +-
 agent/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-agent.in            | 2 +-
 agent/distro/sles/SYSCONFDIR/init.d/cloud-agent.in                 | 2 +-
 packaging/centos63/cloud-agent.rc                                  | 2 +-
 packaging/centos63/cloud-ipallocator.rc                            | 2 +-
 python/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in   | 2 +-
 python/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in   | 2 +-
 python/distro/opensuse/SYSCONFDIR/init.d/cloud-ipallocator.in      | 2 +-
 python/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-ipallocator.in     | 2 +-
 python/distro/sles/SYSCONFDIR/init.d/cloud-ipallocator.in          | 2 +-
 python/distro/ubuntu/SYSCONFDIR/init.d/cloud-ipallocator.in        | 2 +-
 .../distro/centos/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in    | 2 +-
 .../distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in    | 2 +-
 systemvm/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in | 2 +-
 systemvm/distro/ubuntu/SYSCONFDIR/init.d/cloud-console-proxy.in    | 2 +-
 17 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------