You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2014/11/05 11:44:55 UTC

[01/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Repository: cloudstack
Updated Branches:
  refs/heads/master fce9f9639 -> 4c5f792ca


CLOUDSTACK-7796: UI > Infrastructure > zones > zone > details tab > dataProvider > remove unnecessary module check.


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

Branch: refs/heads/master
Commit: 429ea8bc957ed6ed238ccf6f77be718d7ba0ff81
Parents: 11c53f0
Author: Jessica Wang <je...@apache.org>
Authored: Tue Oct 28 11:28:30 2014 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Oct 28 11:28:30 2014 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429ea8bc/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 4ec23c7..fd4df48 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8237,11 +8237,7 @@
                                                         }
                                                         //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)});
                                                     });
-                                                    
-                                                    if (isModuleIncluded("dr")) {
-                                                        cloudStack.dr.sharedFunctions.addExtraProperties(selectedZoneObj, "Zone");
-                                                    }
-                                                    
+                                                   
                                                     args.response.success({
                                                         actionFilter: zoneActionfilter,
                                                         data: selectedZoneObj


[20/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7646 Move the nuage test out of smoke as it depends on noredist components

(cherry picked from commit 779cd60a70a687a60db3102a0635a1ee57928235)
Signed-off-by: Hugo Trippaers <ht...@schubergphilis.com>


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

Branch: refs/heads/master
Commit: 1681b02279f0fbc2ff39b3d2abe74086c9909f71
Parents: a69950f
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Thu Oct 30 16:44:01 2014 +0100
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Thu Oct 30 16:49:05 2014 +0100

----------------------------------------------------------------------
 test/integration/component/test_nuage_vsp.py | 301 ++++++++++++++++++++++
 test/integration/smoke/test_nuage_vsp.py     | 301 ----------------------
 2 files changed, 301 insertions(+), 301 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1681b022/test/integration/component/test_nuage_vsp.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_nuage_vsp.py b/test/integration/component/test_nuage_vsp.py
new file mode 100644
index 0000000..ee7fc68
--- /dev/null
+++ b/test/integration/component/test_nuage_vsp.py
@@ -0,0 +1,301 @@
+# 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.
+
+""" P1 tests for NuageVsp network Plugin
+"""
+# Import Local Modules
+from nose.plugins.attrib import attr
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.cloudstackAPI import (listPhysicalNetworks,
+                                  listNetworkServiceProviders,
+                                  addNetworkServiceProvider,
+                                  addNuageVspDevice)
+from marvin.lib.utils import (cleanup_resources)
+from marvin.lib.base import (Account,
+                             VirtualMachine,
+                             ServiceOffering,
+                             NetworkOffering,
+                             Network)
+from marvin.lib.common import (get_domain,
+                               get_zone,
+                               get_template)
+
+
+class Services:
+
+    """Test NuageVsp plugin
+    """
+
+    def __init__(self):
+        self.services = {
+            "account": {
+                "email": "cloudstack@cloudmonkey.com",
+                "firstname": "cloudstack",
+                "lastname": "bob",
+                "username": "bobbuilder",
+                "password": "password",
+            },
+            "service_offering": {
+                "name": "Tiny Instance",
+                "displaytext": "Tiny Instance",
+                "cpunumber": 1,
+                "cpuspeed": 100,    # in MHz
+                                    "memory": 128,       # In MBs
+            },
+            "virtual_machine": {
+                "displayname": "TestVM",
+                "username": "root",
+                "password": "password",
+                "ssh_port": 22,
+                "hypervisor": 'XenServer',
+                "privateport": 22,
+                "publicport": 22,
+                "protocol": 'TCP',
+            },
+            "nuage_vsp_device": {
+                "hostname": '192.168.0.7',
+                "username": 'testusername',
+                "password": 'testpassword',
+                "port": '8443',
+                "apiversion": 'v1_0',
+                "retrycount": '4',
+                "retryinterval": '60'
+            },
+            # services supported by Nuage for isolated networks.
+            "network_offering": {
+                "name": 'nuage_marvin',
+                "displaytext": 'nuage_marvin',
+                "guestiptype": 'Isolated',
+                "supportedservices":
+                'Dhcp,SourceNat,Connectivity,StaticNat,UserData,Firewall',
+                "traffictype": 'GUEST',
+                "availability": 'Optional',
+                "serviceProviderList": {
+                    "UserData": 'VirtualRouter',
+                    "Dhcp": 'NuageVsp',
+                    "Connectivity": 'NuageVsp',
+                    "StaticNat": 'NuageVsp',
+                    "SourceNat": 'NuageVsp',
+                    "Firewall": 'NuageVsp'
+                },
+            },
+            "network": {
+                "name": "nuage",
+                "displaytext": "nuage",
+            },
+            "ostype": 'CentOS 5.3 (64-bit)',
+            "sleep": 60,
+            "timeout": 10
+        }
+
+
+class TestNuageVsp(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls._cleanup = []
+        cls.testClient = super(TestNuageVsp, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
+        # Get Zone, Domain and templates
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+        cls.template = get_template(
+            cls.api_client,
+            cls.zone.id,
+            cls.services["ostype"]
+        )
+        # nuage vsp device brings the Nuage virtual service platform into play
+        cls.nuage_services = cls.services["nuage_vsp_device"]
+        try:
+
+            resp = listPhysicalNetworks.listPhysicalNetworksCmd()
+            resp.zoneid = cls.zone.id
+            physical_networks = cls.api_client.listPhysicalNetworks(resp)
+            if isinstance(physical_networks, list):
+                physical_network = physical_networks[0]
+            resp = listNetworkServiceProviders.listNetworkServiceProvidersCmd()
+            resp.name = 'NuageVsp'
+            resp.physicalnetworkid = physical_network.id
+            nw_service_providers = cls.api_client.listNetworkServiceProviders(
+                resp)
+            if not isinstance(nw_service_providers, list):
+                # create network service provider and add nuage vsp device
+                resp_add_nsp =\
+                    addNetworkServiceProvider.addNetworkServiceProviderCmd()
+                resp_add_nsp.name = 'NuageVsp'
+                resp_add_nsp.physicalnetworkid = physical_network.id
+                cls.api_client.addNetworkServiceProvider(resp_add_nsp)
+                resp_add_device = addNuageVspDevice.addNuageVspDeviceCmd()
+                resp_add_device.physicalnetworkid = physical_network.id
+                resp_add_device.username = cls.nuage_services["username"]
+                resp_add_device.password = cls.nuage_services["password"]
+                resp_add_device.hostname = cls.nuage_services["hostname"]
+                resp_add_device.apiversion = cls.nuage_services[
+                   "apiversion"]
+                resp_add_device.retrycount = cls.nuage_services[
+                    "retrycount"]
+                resp_add_device.retryinterval = cls.nuage_services[
+                    "retryinterval"]
+                cls.nuage = cls.api_client.addNuageVspDevice(
+                    resp_add_device)
+
+            cls.network_offering = NetworkOffering.create(
+                cls.api_client,
+                cls.services["network_offering"],
+                conservemode=True
+            )
+            cls._cleanup.append(cls.network_offering)
+
+            cls.network_offering.update(cls.api_client, state='Enabled')
+            cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+            cls.services["virtual_machine"]["template"] = cls.template.id
+            cls.service_offering = ServiceOffering.create(
+                cls.api_client,
+                cls.services["service_offering"]
+            )
+            cls._cleanup.append(cls.service_offering)
+        except Exception as e:
+            cls.tearDownClass()
+            raise Exception("Warning: Exception in setUpClass: %s" % e)
+        return
+
+    @classmethod
+    def tearDownClass(cls):
+        try:
+            cleanup_resources(cls.api_client, cls._cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    def setUp(self):
+        self.apiclient = self.testClient.getApiClient()
+        self.dbclient = self.testClient.getDbConnection()
+        self.account = Account.create(
+            self.apiclient,
+            self.services["account"],
+            admin=True,
+            domainid=self.domain.id
+        )
+        self.cleanup = [self.account]
+        return
+
+    def tearDown(self):
+        try:
+            self.debug("Cleaning up the resources")
+            cleanup_resources(self.apiclient, self.cleanup)
+            self.debug("Cleanup complete!")
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    @attr(tags=["invalid"])
+    def test_network_vsp(self):
+        """Test nuage Network and VM Creation
+        """
+
+        self.debug("Creating network with network offering: %s" %
+                   self.network_offering.id)
+        self.network = Network.create(
+            self.apiclient,
+            self.services["network"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            networkofferingid=self.network_offering.id,
+            zoneid=self.zone.id
+        )
+        self.debug("Created network with ID: %s" % self.network.id)
+
+        self.debug("Deploying VM in account: %s" % self.account.name)
+
+        virtual_machine_1 = VirtualMachine.create(
+            self.apiclient,
+            self.services["virtual_machine"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering.id,
+            networkids=[str(self.network.id)]
+        )
+        self.debug("Deployed VM in network: %s" % self.network.id)
+        list_vm_response = VirtualMachine.list(
+            self.apiclient,
+            id=virtual_machine_1.id
+        )
+
+        self.debug(
+            "Verify listVirtualMachines response for virtual machine: %s"
+            % virtual_machine_1.id
+        )
+
+        self.assertEqual(
+            isinstance(list_vm_response, list),
+            True,
+            "Check list response returns a valid list"
+        )
+        vm_response = list_vm_response[0]
+
+        self.assertEqual(
+            vm_response.state,
+            "Running",
+            "VM state should be running after deployment"
+        )
+
+        self.debug("Deploying another VM in account: %s" %
+                   self.account.name)
+
+        virtual_machine_2 = VirtualMachine.create(
+            self.apiclient,
+            self.services["virtual_machine"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering.id,
+            networkids=[str(self.network.id)]
+        )
+        self.debug("Deployed VM in network: %s" % self.network.id)
+        list_vm_response = VirtualMachine.list(
+            self.apiclient,
+            id=virtual_machine_2.id
+        )
+
+        self.debug(
+            "Verify listVirtualMachines response for virtual machine: %s"
+            % virtual_machine_2.id
+        )
+
+        self.assertEqual(
+            isinstance(list_vm_response, list),
+            True,
+            "Check list response returns a valid list"
+        )
+        vm_response = list_vm_response[0]
+
+        self.assertEqual(
+            vm_response.state,
+            "Running",
+            "VM state should be running after deployment"
+        )
+
+        VirtualMachine.delete(virtual_machine_1, self.apiclient, expunge=True)
+
+        # Deleting a single VM
+        VirtualMachine.delete(virtual_machine_2, self.apiclient, expunge=True)
+
+        # Delete Network
+        Network.delete(self.network, self.apiclient)
+
+        return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1681b022/test/integration/smoke/test_nuage_vsp.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_nuage_vsp.py b/test/integration/smoke/test_nuage_vsp.py
deleted file mode 100644
index ee7fc68..0000000
--- a/test/integration/smoke/test_nuage_vsp.py
+++ /dev/null
@@ -1,301 +0,0 @@
-# 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.
-
-""" P1 tests for NuageVsp network Plugin
-"""
-# Import Local Modules
-from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import cloudstackTestCase
-from marvin.cloudstackAPI import (listPhysicalNetworks,
-                                  listNetworkServiceProviders,
-                                  addNetworkServiceProvider,
-                                  addNuageVspDevice)
-from marvin.lib.utils import (cleanup_resources)
-from marvin.lib.base import (Account,
-                             VirtualMachine,
-                             ServiceOffering,
-                             NetworkOffering,
-                             Network)
-from marvin.lib.common import (get_domain,
-                               get_zone,
-                               get_template)
-
-
-class Services:
-
-    """Test NuageVsp plugin
-    """
-
-    def __init__(self):
-        self.services = {
-            "account": {
-                "email": "cloudstack@cloudmonkey.com",
-                "firstname": "cloudstack",
-                "lastname": "bob",
-                "username": "bobbuilder",
-                "password": "password",
-            },
-            "service_offering": {
-                "name": "Tiny Instance",
-                "displaytext": "Tiny Instance",
-                "cpunumber": 1,
-                "cpuspeed": 100,    # in MHz
-                                    "memory": 128,       # In MBs
-            },
-            "virtual_machine": {
-                "displayname": "TestVM",
-                "username": "root",
-                "password": "password",
-                "ssh_port": 22,
-                "hypervisor": 'XenServer',
-                "privateport": 22,
-                "publicport": 22,
-                "protocol": 'TCP',
-            },
-            "nuage_vsp_device": {
-                "hostname": '192.168.0.7',
-                "username": 'testusername',
-                "password": 'testpassword',
-                "port": '8443',
-                "apiversion": 'v1_0',
-                "retrycount": '4',
-                "retryinterval": '60'
-            },
-            # services supported by Nuage for isolated networks.
-            "network_offering": {
-                "name": 'nuage_marvin',
-                "displaytext": 'nuage_marvin',
-                "guestiptype": 'Isolated',
-                "supportedservices":
-                'Dhcp,SourceNat,Connectivity,StaticNat,UserData,Firewall',
-                "traffictype": 'GUEST',
-                "availability": 'Optional',
-                "serviceProviderList": {
-                    "UserData": 'VirtualRouter',
-                    "Dhcp": 'NuageVsp',
-                    "Connectivity": 'NuageVsp',
-                    "StaticNat": 'NuageVsp',
-                    "SourceNat": 'NuageVsp',
-                    "Firewall": 'NuageVsp'
-                },
-            },
-            "network": {
-                "name": "nuage",
-                "displaytext": "nuage",
-            },
-            "ostype": 'CentOS 5.3 (64-bit)',
-            "sleep": 60,
-            "timeout": 10
-        }
-
-
-class TestNuageVsp(cloudstackTestCase):
-
-    @classmethod
-    def setUpClass(cls):
-        cls._cleanup = []
-        cls.testClient = super(TestNuageVsp, cls).getClsTestClient()
-        cls.api_client = cls.testClient.getApiClient()
-
-        cls.services = Services().services
-        # Get Zone, Domain and templates
-        cls.domain = get_domain(cls.api_client)
-        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
-        cls.template = get_template(
-            cls.api_client,
-            cls.zone.id,
-            cls.services["ostype"]
-        )
-        # nuage vsp device brings the Nuage virtual service platform into play
-        cls.nuage_services = cls.services["nuage_vsp_device"]
-        try:
-
-            resp = listPhysicalNetworks.listPhysicalNetworksCmd()
-            resp.zoneid = cls.zone.id
-            physical_networks = cls.api_client.listPhysicalNetworks(resp)
-            if isinstance(physical_networks, list):
-                physical_network = physical_networks[0]
-            resp = listNetworkServiceProviders.listNetworkServiceProvidersCmd()
-            resp.name = 'NuageVsp'
-            resp.physicalnetworkid = physical_network.id
-            nw_service_providers = cls.api_client.listNetworkServiceProviders(
-                resp)
-            if not isinstance(nw_service_providers, list):
-                # create network service provider and add nuage vsp device
-                resp_add_nsp =\
-                    addNetworkServiceProvider.addNetworkServiceProviderCmd()
-                resp_add_nsp.name = 'NuageVsp'
-                resp_add_nsp.physicalnetworkid = physical_network.id
-                cls.api_client.addNetworkServiceProvider(resp_add_nsp)
-                resp_add_device = addNuageVspDevice.addNuageVspDeviceCmd()
-                resp_add_device.physicalnetworkid = physical_network.id
-                resp_add_device.username = cls.nuage_services["username"]
-                resp_add_device.password = cls.nuage_services["password"]
-                resp_add_device.hostname = cls.nuage_services["hostname"]
-                resp_add_device.apiversion = cls.nuage_services[
-                   "apiversion"]
-                resp_add_device.retrycount = cls.nuage_services[
-                    "retrycount"]
-                resp_add_device.retryinterval = cls.nuage_services[
-                    "retryinterval"]
-                cls.nuage = cls.api_client.addNuageVspDevice(
-                    resp_add_device)
-
-            cls.network_offering = NetworkOffering.create(
-                cls.api_client,
-                cls.services["network_offering"],
-                conservemode=True
-            )
-            cls._cleanup.append(cls.network_offering)
-
-            cls.network_offering.update(cls.api_client, state='Enabled')
-            cls.services["virtual_machine"]["zoneid"] = cls.zone.id
-            cls.services["virtual_machine"]["template"] = cls.template.id
-            cls.service_offering = ServiceOffering.create(
-                cls.api_client,
-                cls.services["service_offering"]
-            )
-            cls._cleanup.append(cls.service_offering)
-        except Exception as e:
-            cls.tearDownClass()
-            raise Exception("Warning: Exception in setUpClass: %s" % e)
-        return
-
-    @classmethod
-    def tearDownClass(cls):
-        try:
-            cleanup_resources(cls.api_client, cls._cleanup)
-        except Exception as e:
-            raise Exception("Warning: Exception during cleanup : %s" % e)
-        return
-
-    def setUp(self):
-        self.apiclient = self.testClient.getApiClient()
-        self.dbclient = self.testClient.getDbConnection()
-        self.account = Account.create(
-            self.apiclient,
-            self.services["account"],
-            admin=True,
-            domainid=self.domain.id
-        )
-        self.cleanup = [self.account]
-        return
-
-    def tearDown(self):
-        try:
-            self.debug("Cleaning up the resources")
-            cleanup_resources(self.apiclient, self.cleanup)
-            self.debug("Cleanup complete!")
-        except Exception as e:
-            raise Exception("Warning: Exception during cleanup : %s" % e)
-        return
-
-    @attr(tags=["invalid"])
-    def test_network_vsp(self):
-        """Test nuage Network and VM Creation
-        """
-
-        self.debug("Creating network with network offering: %s" %
-                   self.network_offering.id)
-        self.network = Network.create(
-            self.apiclient,
-            self.services["network"],
-            accountid=self.account.name,
-            domainid=self.account.domainid,
-            networkofferingid=self.network_offering.id,
-            zoneid=self.zone.id
-        )
-        self.debug("Created network with ID: %s" % self.network.id)
-
-        self.debug("Deploying VM in account: %s" % self.account.name)
-
-        virtual_machine_1 = VirtualMachine.create(
-            self.apiclient,
-            self.services["virtual_machine"],
-            accountid=self.account.name,
-            domainid=self.account.domainid,
-            serviceofferingid=self.service_offering.id,
-            networkids=[str(self.network.id)]
-        )
-        self.debug("Deployed VM in network: %s" % self.network.id)
-        list_vm_response = VirtualMachine.list(
-            self.apiclient,
-            id=virtual_machine_1.id
-        )
-
-        self.debug(
-            "Verify listVirtualMachines response for virtual machine: %s"
-            % virtual_machine_1.id
-        )
-
-        self.assertEqual(
-            isinstance(list_vm_response, list),
-            True,
-            "Check list response returns a valid list"
-        )
-        vm_response = list_vm_response[0]
-
-        self.assertEqual(
-            vm_response.state,
-            "Running",
-            "VM state should be running after deployment"
-        )
-
-        self.debug("Deploying another VM in account: %s" %
-                   self.account.name)
-
-        virtual_machine_2 = VirtualMachine.create(
-            self.apiclient,
-            self.services["virtual_machine"],
-            accountid=self.account.name,
-            domainid=self.account.domainid,
-            serviceofferingid=self.service_offering.id,
-            networkids=[str(self.network.id)]
-        )
-        self.debug("Deployed VM in network: %s" % self.network.id)
-        list_vm_response = VirtualMachine.list(
-            self.apiclient,
-            id=virtual_machine_2.id
-        )
-
-        self.debug(
-            "Verify listVirtualMachines response for virtual machine: %s"
-            % virtual_machine_2.id
-        )
-
-        self.assertEqual(
-            isinstance(list_vm_response, list),
-            True,
-            "Check list response returns a valid list"
-        )
-        vm_response = list_vm_response[0]
-
-        self.assertEqual(
-            vm_response.state,
-            "Running",
-            "VM state should be running after deployment"
-        )
-
-        VirtualMachine.delete(virtual_machine_1, self.apiclient, expunge=True)
-
-        # Deleting a single VM
-        VirtualMachine.delete(virtual_machine_2, self.apiclient, expunge=True)
-
-        # Delete Network
-        Network.delete(self.network, self.apiclient)
-
-        return


[17/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7692: Fixed template register issue in test_project_usage.py

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: 4f297efef5627f04348a6b9ac550bef2364cb661
Parents: e2ba1b6
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Thu Oct 9 15:14:30 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 15:33:37 2014 +0530

----------------------------------------------------------------------
 test/integration/component/test_project_usage.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4f297efe/test/integration/component/test_project_usage.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py
index 3262e40..2627504 100644
--- a/test/integration/component/test_project_usage.py
+++ b/test/integration/component/test_project_usage.py
@@ -712,6 +712,9 @@ class TestTemplateUsage(cloudstackTestCase):
                             domainid=cls.domain.id
                             )
             cls._cleanup.append(cls.account)
+            cls.userapiclient = cls.testClient.getUserApiClient(
+                                    UserName=cls.account.name,
+                                    DomainName=cls.account.domain)
             cls.services["account"] = cls.account.name
 
             cls.project = Project.create(
@@ -789,7 +792,7 @@ class TestTemplateUsage(cloudstackTestCase):
 
         #Create template from Virtual machine and Volume ID
         self.template = Template.create(
-                                self.apiclient,
+                                self.userapiclient,
                                 self.services["templates"],
                                 self.volume.id,
                                 projectid=self.project.id


[29/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7825: Report both virtual size and physical size for the snaphost usage event.


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

Branch: refs/heads/master
Commit: 2652195010c86fa399493a041afff3eac17b1538
Parents: aaa561a
Author: Nitin Mehta <ni...@citrix.com>
Authored: Fri Oct 31 15:24:32 2014 -0700
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Fri Oct 31 15:24:32 2014 -0700

----------------------------------------------------------------------
 .../src/com/cloud/storage/snapshot/SnapshotManagerImpl.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26521950/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
index 76ab370..6d74636 100755
--- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
+++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
@@ -971,11 +971,11 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
             snapshotStrategy.takeSnapshot(snapshot);
 
             try {
-            postCreateSnapshot(volume.getId(), snapshotId, payload.getSnapshotPolicyId());
-
-                UsageEventUtils.publishUsageEvent(EventTypes.EVENT_SNAPSHOT_CREATE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(),
-                    null, null, volume.getSize(), snapshot.getClass().getName(), snapshot.getUuid());
+                postCreateSnapshot(volume.getId(), snapshotId, payload.getSnapshotPolicyId());
                 SnapshotDataStoreVO snapshotStoreRef = _snapshotStoreDao.findBySnapshot(snapshotId, DataStoreRole.Image);
+                // FIXME - snapshotStoreRef.getSize() refers to physical size, correct that
+                UsageEventUtils.publishUsageEvent(EventTypes.EVENT_SNAPSHOT_CREATE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(),
+                    null, null, snapshotStoreRef.getSize(), volume.getSize(), snapshot.getClass().getName(), snapshot.getUuid());
                 // Correct the resource count of snapshot in case of delta snapshots.
                 _resourceLimitMgr.decrementResourceCount(snapshotOwner.getId(), ResourceType.secondary_storage, new Long(volume.getSize() - snapshotStoreRef.getSize()));
             } catch (Exception e) {


[12/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7801: test_volumes.py - Fixed import and pep8 issues

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: b1ab888bf0ae1c5f63e515de28be482d18bb884c
Parents: af510eb
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Tue Oct 28 12:30:22 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 15:07:52 2014 +0530

----------------------------------------------------------------------
 test/integration/component/test_volumes.py | 1131 ++++++++++++-----------
 1 file changed, 593 insertions(+), 538 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b1ab888b/test/integration/component/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py
index 36a910b..77cad54 100644
--- a/test/integration/component/test_volumes.py
+++ b/test/integration/component/test_volumes.py
@@ -16,13 +16,13 @@
 # under the License.
 """ P1 tests for Volumes
 """
-#Import Local Modules
+# Import Local Modules
 from nose.plugins.attrib import attr
 from marvin.cloudstackTestCase import cloudstackTestCase
 from marvin.cloudstackAPI import (listHypervisorCapabilities,
                                   attachIso,
                                   deleteVolume)
-from marvin.lib.utils import cleanup_resources
+from marvin.lib.utils import cleanup_resources, validateList
 from marvin.lib.base import (Account,
                              ServiceOffering,
                              VirtualMachine,
@@ -31,70 +31,73 @@ from marvin.lib.base import (Account,
                              Iso,
                              Configurations,
                              DiskOffering,
-                             Domain)
+                             Domain,
+                             StoragePool)
 from marvin.lib.common import (get_domain,
                                get_zone,
                                get_template,
                                get_pod)
-#Import System modules
+from marvin.codes import PASS
+# Import System modules
 import time
 
 
 class Services:
+
     """Test Volume Services
     """
 
     def __init__(self):
         self.services = {
-                         "account": {
-                                    "email": "test@test.com",
-                                    "firstname": "Test",
-                                    "lastname": "User",
-                                    "username": "test",
-                                    # Random characters are appended for unique
-                                    # username
-                                    "password": "password",
-                         },
-                         "service_offering": {
-                                    "name": "Tiny Instance",
-                                    "displaytext": "Tiny Instance",
-                                    "cpunumber": 1,
-                                    "cpuspeed": 100,    # in MHz
+            "account": {
+                "email": "test@test.com",
+                "firstname": "Test",
+                "lastname": "User",
+                "username": "test",
+                # Random characters are appended for unique
+                # username
+                "password": "password",
+            },
+            "service_offering": {
+                "name": "Tiny Instance",
+                "displaytext": "Tiny Instance",
+                "cpunumber": 1,
+                "cpuspeed": 100,    # in MHz
                                     "memory": 128,       # In MBs
-                        },
-                        "disk_offering": {
-                                    "displaytext": "Small",
-                                    "name": "Small",
-                                    "disksize": 1
-                        },
-                        "volume": {
-                                "diskname": "TestDiskServ",
-                        },
-                         "virtual_machine": {
-                                    "displayname": "testVM",
-                                    "hypervisor": 'XenServer',
-                                    "protocol": 'TCP',
-                                    "ssh_port": 22,
-                                    "username": "root",
-                                    "password": "password",
-                                    "privateport": 22,
-                                    "publicport": 22,
-                         },
-                         "iso":  # ISO settings for Attach/Detach ISO tests
-                         {
-                          "displaytext": "Test ISO",
-                          "name": "testISO",
-                          "url": "http://people.apache.org/~tsp/dummy.iso",
-                          # Source URL where ISO is located
-                          "ostype": 'CentOS 5.3 (64-bit)',
-                          },
-                         "custom_volume": {
-                                           "customdisksize": 2,
-                                           "diskname": "Custom disk",
-                        },
-                        "sleep": 50,
-                        "ostype": 'CentOS 5.3 (64-bit)',
-                    }
+            },
+            "disk_offering": {
+                "displaytext": "Small",
+                "name": "Small",
+                "disksize": 1
+            },
+            "volume": {
+                "diskname": "TestDiskServ",
+            },
+            "virtual_machine": {
+                "displayname": "testVM",
+                "hypervisor": 'XenServer',
+                "protocol": 'TCP',
+                "ssh_port": 22,
+                "username": "root",
+                "password": "password",
+                "privateport": 22,
+                "publicport": 22,
+            },
+            "iso":  # ISO settings for Attach/Detach ISO tests
+            {
+                "displaytext": "Test ISO",
+                "name": "testISO",
+                "url": "http://people.apache.org/~tsp/dummy.iso",
+                # Source URL where ISO is located
+                "ostype": 'CentOS 5.3 (64-bit)',
+            },
+            "custom_volume": {
+                "customdisksize": 2,
+                "diskname": "Custom disk",
+            },
+            "sleep": 50,
+            "ostype": 'CentOS 5.3 (64-bit)',
+        }
 
 
 class TestAttachVolume(cloudstackTestCase):
@@ -111,24 +114,24 @@ class TestAttachVolume(cloudstackTestCase):
         cls.pod = get_pod(cls.api_client, cls.zone.id)
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
-                                    cls.api_client,
-                                    cls.services["disk_offering"]
-                                    )
+            cls.api_client,
+            cls.services["disk_offering"]
+        )
         template = get_template(
-                            cls.api_client,
-                            cls.zone.id,
-                            cls.services["ostype"]
-                            )
+            cls.api_client,
+            cls.zone.id,
+            cls.services["ostype"]
+        )
         cls.services["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["template"] = template.id
-        #get max data volumes limit based on the hypervisor type and version
+        # get max data volumes limit based on the hypervisor type and version
         listHost = Host.list(
-                             cls.api_client,
-                             type ='Routing',
-                             zoneid = cls.zone.id,
-                             podid = cls.pod.id,
-                             )
+            cls.api_client,
+            type='Routing',
+            zoneid=cls.zone.id,
+            podid=cls.pod.id,
+        )
         ver = listHost[0].hypervisorversion
         hv = listHost[0].hypervisor
         cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
@@ -143,27 +146,27 @@ class TestAttachVolume(cloudstackTestCase):
         cls.services["volume"]["max"] = cls.max_data_volumes
         # Create VMs, NAT Rules etc
         cls.account = Account.create(
-                            cls.api_client,
-                            cls.services["account"],
-                            domainid=cls.domain.id
-                            )
+            cls.api_client,
+            cls.services["account"],
+            domainid=cls.domain.id
+        )
 
         cls.service_offering = ServiceOffering.create(
-                                            cls.api_client,
-                                            cls.services["service_offering"]
-                                            )
+            cls.api_client,
+            cls.services["service_offering"]
+        )
         cls.virtual_machine = VirtualMachine.create(
-                                    cls.api_client,
-                                    cls.services["virtual_machine"],
-                                    accountid=cls.account.name,
-                                    domainid=cls.account.domainid,
-                                    serviceofferingid=cls.service_offering.id,
-                                )
+            cls.api_client,
+            cls.services["virtual_machine"],
+            accountid=cls.account.name,
+            domainid=cls.account.domainid,
+            serviceofferingid=cls.service_offering.id,
+        )
         cls._cleanup = [
-                        cls.service_offering,
-                        cls.disk_offering,
-                        cls.account
-                        ]
+            cls.service_offering,
+            cls.disk_offering,
+            cls.account
+        ]
 
     def setUp(self):
 
@@ -176,18 +179,20 @@ class TestAttachVolume(cloudstackTestCase):
             cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
             self.debug("Warning: Exception during cleanup : %s" % e)
-            #raise Exception("Warning: Exception during cleanup : %s" % e)
+            # raise Exception("Warning: Exception during cleanup : %s" % e)
         return
 
     @classmethod
     def tearDownClass(cls):
         try:
-            cls.api_client = super(TestAttachVolume, cls).getClsTestClient().getApiClient()
+            cls.api_client = super(
+                TestAttachVolume,
+                cls).getClsTestClient().getApiClient()
             cleanup_resources(cls.api_client, cls._cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 
-    @attr(tags = ["advanced", "advancedns", "needle"])
+    @attr(tags=["advanced", "advancedns", "needle"])
     def test_01_volume_attach(self):
         """Test Attach volumes (max capacity)
         """
@@ -202,35 +207,35 @@ class TestAttachVolume(cloudstackTestCase):
         try:
             for i in range(self.max_data_volumes):
                 volume = Volume.create(
-                                   self.apiclient,
-                                   self.services["volume"],
-                                   zoneid=self.zone.id,
-                                   account=self.account.name,
-                                   domainid=self.account.domainid,
-                                   diskofferingid=self.disk_offering.id
-                                   )
+                    self.apiclient,
+                    self.services["volume"],
+                    zoneid=self.zone.id,
+                    account=self.account.name,
+                    domainid=self.account.domainid,
+                    diskofferingid=self.disk_offering.id
+                )
                 # Check List Volume response for newly created volume
                 list_volume_response = Volume.list(
-                                                self.apiclient,
-                                                id=volume.id
-                                                )
+                    self.apiclient,
+                    id=volume.id
+                )
                 self.assertNotEqual(
-                                list_volume_response,
-                                None,
-                                "Check if volume exists in ListVolumes"
-                                )
+                    list_volume_response,
+                    None,
+                    "Check if volume exists in ListVolumes"
+                )
                 # Attach volume to VM
                 self.virtual_machine.attach_volume(
-                                                self.apiclient,
-                                                volume
-                                                )
+                    self.apiclient,
+                    volume
+                )
             # Check all volumes attached to same VM
             list_volume_response = Volume.list(
-                                    self.apiclient,
-                                    virtualmachineid=self.virtual_machine.id,
-                                    type='DATADISK',
-                                    listall=True
-                                    )
+                self.apiclient,
+                virtualmachineid=self.virtual_machine.id,
+                type='DATADISK',
+                listall=True
+            )
             self.assertNotEqual(
                 list_volume_response,
                 None,
@@ -242,32 +247,34 @@ class TestAttachVolume(cloudstackTestCase):
             self.assertEqual(
                 len(list_volume_response),
                 self.max_data_volumes,
-                "Volumes attached to the VM %s. Expected %s" % (len(list_volume_response), self.max_data_volumes))
+                "Volumes attached to the VM %s. Expected %s" %
+                (len(list_volume_response),
+                 self.max_data_volumes))
             self.debug("Rebooting the VM: %s" % self.virtual_machine.id)
             # Reboot VM
             self.virtual_machine.reboot(self.apiclient)
 
             vm_response = VirtualMachine.list(
-                                        self.apiclient,
-                                        id=self.virtual_machine.id,
-                                        )
-            #Verify VM response to check whether VM deployment was successful
+                self.apiclient,
+                id=self.virtual_machine.id,
+            )
+            # Verify VM response to check whether VM deployment was successful
             self.assertNotEqual(
-                            len(vm_response),
-                            0,
-                            "Check VMs available in List VMs response"
-                        )
+                len(vm_response),
+                0,
+                "Check VMs available in List VMs response"
+            )
             self.assertEqual(
-                                isinstance(vm_response, list),
-                                True,
-                                "Check list VM response for valid list"
-                        )
+                isinstance(vm_response, list),
+                True,
+                "Check list VM response for valid list"
+            )
             vm = vm_response[0]
             self.assertEqual(
-                            vm.state,
-                            'Running',
-                            "Check the state of VM"
-                        )
+                vm.state,
+                'Running',
+                "Check the state of VM"
+            )
 
             # Stop VM
             self.virtual_machine.stop(self.apiclient)
@@ -278,33 +285,33 @@ class TestAttachVolume(cloudstackTestCase):
             time.sleep(self.services["sleep"])
 
             vm_response = VirtualMachine.list(
-                                        self.apiclient,
-                                        id=self.virtual_machine.id,
-                                        )
+                self.apiclient,
+                id=self.virtual_machine.id,
+            )
             self.assertEqual(
-                                isinstance(vm_response, list),
-                                True,
-                                "Check list VM response for valid list"
-                        )
+                isinstance(vm_response, list),
+                True,
+                "Check list VM response for valid list"
+            )
 
-            #Verify VM response to check whether VM deployment was successful
+            # Verify VM response to check whether VM deployment was successful
             self.assertNotEqual(
-                            len(vm_response),
-                            0,
-                            "Check VMs available in List VMs response"
-                        )
+                len(vm_response),
+                0,
+                "Check VMs available in List VMs response"
+            )
 
             vm = vm_response[0]
             self.assertEqual(
-                            vm.state,
-                            'Running',
-                            "Check the state of VM"
-                        )
+                vm.state,
+                'Running',
+                "Check the state of VM"
+            )
         except Exception as e:
             self.fail("Exception occured: %s" % e)
         return
 
-    @attr(tags = ["advanced", "advancedns"])
+    @attr(tags=["advanced", "advancedns"])
     def test_02_volume_attach_max(self):
         """Test attach volumes (more than max) to an instance
         """
@@ -315,22 +322,22 @@ class TestAttachVolume(cloudstackTestCase):
 
         # Create a volume and attach to VM
         volume = Volume.create(
-                                self.apiclient,
-                                self.services["volume"],
-                                zoneid=self.zone.id,
-                                account=self.account.name,
-                                domainid=self.account.domainid,
-                                diskofferingid=self.disk_offering.id
-                               )
+            self.apiclient,
+            self.services["volume"],
+            zoneid=self.zone.id,
+            account=self.account.name,
+            domainid=self.account.domainid,
+            diskofferingid=self.disk_offering.id
+        )
         self.debug("Created volume: %s for account: %s" % (
-                                                volume.id,
-                                                self.account.name
-                                                ))
+            volume.id,
+            self.account.name
+        ))
         # Check List Volume response for newly created volume
         list_volume_response = Volume.list(
-                                            self.apiclient,
-                                            id=volume.id
-                                            )
+            self.apiclient,
+            id=volume.id
+        )
         self.assertNotEqual(
             list_volume_response,
             None,
@@ -344,15 +351,16 @@ class TestAttachVolume(cloudstackTestCase):
         # Attach volume to VM
         with self.assertRaises(Exception):
             self.debug("Trying to Attach volume: %s to VM: %s" % (
-                                                volume.id,
-                                                self.virtual_machine.id
-                                                ))
+                volume.id,
+                self.virtual_machine.id
+            ))
             self.virtual_machine.attach_volume(
-                                                self.apiclient,
-                                                volume
-                                                )
+                self.apiclient,
+                volume
+            )
         return
 
+
 class TestAttachDetachVolume(cloudstackTestCase):
 
     @classmethod
@@ -367,28 +375,28 @@ class TestAttachDetachVolume(cloudstackTestCase):
         cls.pod = get_pod(cls.api_client, cls.zone.id)
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
-                                    cls.api_client,
-                                    cls.services["disk_offering"]
-                                    )
+            cls.api_client,
+            cls.services["disk_offering"]
+        )
         template = get_template(
-                            cls.api_client,
-                            cls.zone.id,
-                            cls.services["ostype"]
-                            )
+            cls.api_client,
+            cls.zone.id,
+            cls.services["ostype"]
+        )
         cls.services["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["template"] = template.id
-        #get max data volumes limit based on the hypervisor type and version
+        # get max data volumes limit based on the hypervisor type and version
         listHost = Host.list(
-                             cls.api_client,
-                             type ='Routing',
-                             zoneid = cls.zone.id,
-                             podid = cls.pod.id,
-                             )
+            cls.api_client,
+            type='Routing',
+            zoneid=cls.zone.id,
+            podid=cls.pod.id,
+        )
         ver = listHost[0].hypervisorversion
         hv = listHost[0].hypervisor
         cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
-        cmd.hypervisor = hv #cls.services["virtual_machine"]["hypervisor"]
+        cmd.hypervisor = hv  # cls.services["virtual_machine"]["hypervisor"]
         res = cls.api_client.listHypervisorCapabilities(cmd)
         cls.debug('Hypervisor Capabilities: {}'.format(res))
         for i in range(len(res)):
@@ -399,28 +407,27 @@ class TestAttachDetachVolume(cloudstackTestCase):
         cls.services["volume"]["max"] = cls.max_data_volumes
         # Create VMs, NAT Rules etc
         cls.account = Account.create(
-                            cls.api_client,
-                            cls.services["account"],
-                            domainid=cls.domain.id
-                            )
-
+            cls.api_client,
+            cls.services["account"],
+            domainid=cls.domain.id
+        )
 
         cls.service_offering = ServiceOffering.create(
-                                            cls.api_client,
-                                            cls.services["service_offering"]
-                                            )
+            cls.api_client,
+            cls.services["service_offering"]
+        )
         cls.virtual_machine = VirtualMachine.create(
-                                    cls.api_client,
-                                    cls.services["virtual_machine"],
-                                    accountid=cls.account.name,
-                                    domainid=cls.account.domainid,
-                                    serviceofferingid=cls.service_offering.id,
-                                )
+            cls.api_client,
+            cls.services["virtual_machine"],
+            accountid=cls.account.name,
+            domainid=cls.account.domainid,
+            serviceofferingid=cls.service_offering.id,
+        )
         cls._cleanup = [
-                        cls.service_offering,
-                        cls.disk_offering,
-                        cls.account
-                        ]
+            cls.service_offering,
+            cls.disk_offering,
+            cls.account
+        ]
 
     def setUp(self):
 
@@ -429,19 +436,21 @@ class TestAttachDetachVolume(cloudstackTestCase):
         self.cleanup = []
 
     def tearDown(self):
-        #Clean up, terminate the created volumes
+        # Clean up, terminate the created volumes
         cleanup_resources(self.apiclient, self.cleanup)
         return
 
     @classmethod
     def tearDownClass(cls):
         try:
-            cls.api_client = super(TestAttachDetachVolume, cls).getClsTestClient().getApiClient()
+            cls.api_client = super(
+                TestAttachDetachVolume,
+                cls).getClsTestClient().getApiClient()
             cleanup_resources(cls.api_client, cls._cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 
-    @attr(tags = ["advanced", "advancedns"])
+    @attr(tags=["advanced", "advancedns"])
     def test_01_volume_attach_detach(self):
         """Test Volume attach/detach to VM (5 data volumes)
         """
@@ -459,21 +468,21 @@ class TestAttachDetachVolume(cloudstackTestCase):
             # Create 5 volumes and attach to VM
             for i in range(self.max_data_volumes):
                 volume = Volume.create(
-                                   self.apiclient,
-                                   self.services["volume"],
-                                   zoneid=self.zone.id,
-                                   account=self.account.name,
-                                   domainid=self.account.domainid,
-                                   diskofferingid=self.disk_offering.id
-                                   )
+                    self.apiclient,
+                    self.services["volume"],
+                    zoneid=self.zone.id,
+                    account=self.account.name,
+                    domainid=self.account.domainid,
+                    diskofferingid=self.disk_offering.id
+                )
                 self.cleanup.append(volume)
                 volumes.append(volume)
 
                 # Check List Volume response for newly created volume
                 list_volume_response = Volume.list(
-                                                self.apiclient,
-                                                id=volume.id
-                                                )
+                    self.apiclient,
+                    id=volume.id
+                )
                 self.assertNotEqual(
                     list_volume_response,
                     None,
@@ -484,39 +493,40 @@ class TestAttachDetachVolume(cloudstackTestCase):
                     "Check list volumes response for valid list")
                 # Attach volume to VM
                 self.virtual_machine.attach_volume(
-                                                self.apiclient,
-                                                volume
-                                                )
+                    self.apiclient,
+                    volume
+                )
 
             # Check all volumes attached to same VM
             list_volume_response = Volume.list(
-                                    self.apiclient,
-                                    virtualmachineid=self.virtual_machine.id,
-                                    type='DATADISK',
-                                    listall=True
-                                    )
+                self.apiclient,
+                virtualmachineid=self.virtual_machine.id,
+                type='DATADISK',
+                listall=True
+            )
             self.assertNotEqual(
-                                list_volume_response,
-                                None,
-                                "Check if volume exists in ListVolumes"
-                                )
+                list_volume_response,
+                None,
+                "Check if volume exists in ListVolumes"
+            )
             self.assertEqual(
-                                isinstance(list_volume_response, list),
-                                True,
-                                "Check list volumes response for valid list"
-                        )
+                isinstance(list_volume_response, list),
+                True,
+                "Check list volumes response for valid list"
+            )
             self.assertEqual(
                 len(list_volume_response),
                 self.max_data_volumes,
-                "Volumes attached to the VM %s. Expected %s" % (len(list_volume_response), self.max_data_volumes)
-            )
+                "Volumes attached to the VM %s. Expected %s" %
+                (len(list_volume_response),
+                 self.max_data_volumes))
 
             # Detach all volumes from VM
             for volume in volumes:
                 self.virtual_machine.detach_volume(
-                                                self.apiclient,
-                                                volume
-                                            )
+                    self.apiclient,
+                    volume
+                )
             # Reboot VM
             self.debug("Rebooting the VM: %s" % self.virtual_machine.id)
             self.virtual_machine.reboot(self.apiclient)
@@ -524,27 +534,27 @@ class TestAttachDetachVolume(cloudstackTestCase):
             time.sleep(self.services["sleep"])
 
             vm_response = VirtualMachine.list(
-                                        self.apiclient,
-                                        id=self.virtual_machine.id,
-                                        )
-            #Verify VM response to check whether VM deployment was successful
+                self.apiclient,
+                id=self.virtual_machine.id,
+            )
+            # Verify VM response to check whether VM deployment was successful
             self.assertEqual(
-                                isinstance(vm_response, list),
-                                True,
-                                "Check list VM response for valid list"
-                        )
+                isinstance(vm_response, list),
+                True,
+                "Check list VM response for valid list"
+            )
 
             self.assertNotEqual(
-                            len(vm_response),
-                            0,
-                            "Check VMs available in List VMs response"
-                        )
+                len(vm_response),
+                0,
+                "Check VMs available in List VMs response"
+            )
             vm = vm_response[0]
             self.assertEqual(
-                            vm.state,
-                            'Running',
-                            "Check the state of VM"
-                        )
+                vm.state,
+                'Running',
+                "Check the state of VM"
+            )
 
             # Stop VM
             self.virtual_machine.stop(self.apiclient)
@@ -555,26 +565,26 @@ class TestAttachDetachVolume(cloudstackTestCase):
             time.sleep(self.services["sleep"])
 
             vm_response = VirtualMachine.list(
-                                        self.apiclient,
-                                        id=self.virtual_machine.id,
-                                        )
-            #Verify VM response to check whether VM deployment was successful
+                self.apiclient,
+                id=self.virtual_machine.id,
+            )
+            # Verify VM response to check whether VM deployment was successful
             self.assertEqual(
-                                isinstance(vm_response, list),
-                                True,
-                                "Check list VM response for valid list"
-                        )
+                isinstance(vm_response, list),
+                True,
+                "Check list VM response for valid list"
+            )
             self.assertNotEqual(
-                            len(vm_response),
-                            0,
-                            "Check VMs available in List VMs response"
-                        )
+                len(vm_response),
+                0,
+                "Check VMs available in List VMs response"
+            )
             vm = vm_response[0]
             self.assertEqual(
-                            vm.state,
-                            'Running',
-                            "Check the state of VM"
-                        )
+                vm.state,
+                'Running',
+                "Check the state of VM"
+            )
         except Exception as e:
             self.fail("Exception occuered: %s" % e)
         return
@@ -594,25 +604,25 @@ class TestAttachVolumeISO(cloudstackTestCase):
         cls.pod = get_pod(cls.api_client, cls.zone.id)
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
-                                    cls.api_client,
-                                    cls.services["disk_offering"]
-                                    )
+            cls.api_client,
+            cls.services["disk_offering"]
+        )
         template = get_template(
-                            cls.api_client,
-                            cls.zone.id,
-                            cls.services["ostype"]
-                            )
+            cls.api_client,
+            cls.zone.id,
+            cls.services["ostype"]
+        )
         cls.services["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["iso"]["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["template"] = template.id
-        #get max data volumes limit based on the hypervisor type and version
+        # get max data volumes limit based on the hypervisor type and version
         listHost = Host.list(
-                             cls.api_client,
-                             type ='Routing',
-                             zoneid = cls.zone.id,
-                             podid = cls.pod.id,
-                             )
+            cls.api_client,
+            type='Routing',
+            zoneid=cls.zone.id,
+            podid=cls.pod.id,
+        )
         ver = listHost[0].hypervisorversion
         hv = listHost[0].hypervisor
         cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
@@ -627,27 +637,27 @@ class TestAttachVolumeISO(cloudstackTestCase):
         cls.services["volume"]["max"] = cls.max_data_volumes
         # Create VMs, NAT Rules etc
         cls.account = Account.create(
-                            cls.api_client,
-                            cls.services["account"],
-                            domainid=cls.domain.id
-                            )
+            cls.api_client,
+            cls.services["account"],
+            domainid=cls.domain.id
+        )
 
         cls.service_offering = ServiceOffering.create(
-                                            cls.api_client,
-                                            cls.services["service_offering"]
-                                            )
+            cls.api_client,
+            cls.services["service_offering"]
+        )
         cls.virtual_machine = VirtualMachine.create(
-                                    cls.api_client,
-                                    cls.services["virtual_machine"],
-                                    accountid=cls.account.name,
-                                    domainid=cls.account.domainid,
-                                    serviceofferingid=cls.service_offering.id,
-                                )
+            cls.api_client,
+            cls.services["virtual_machine"],
+            accountid=cls.account.name,
+            domainid=cls.account.domainid,
+            serviceofferingid=cls.service_offering.id,
+        )
         cls._cleanup = [
-                        cls.service_offering,
-                        cls.disk_offering,
-                        cls.account
-                        ]
+            cls.service_offering,
+            cls.disk_offering,
+            cls.account
+        ]
 
     @classmethod
     def tearDownClass(cls):
@@ -664,13 +674,13 @@ class TestAttachVolumeISO(cloudstackTestCase):
 
     def tearDown(self):
         try:
-            #Clean up, terminate the created instance, volumes and snapshots
+            # Clean up, terminate the created instance, volumes and snapshots
             cleanup_resources(self.apiclient, self.cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return
 
-    @attr(tags = ["advanced", "advancedns"])
+    @attr(tags=["advanced", "advancedns"])
     def test_01_volume_iso_attach(self):
         """Test Volumes and ISO attach
         """
@@ -683,84 +693,85 @@ class TestAttachVolumeISO(cloudstackTestCase):
         # Create 5 volumes and attach to VM
         for i in range(self.max_data_volumes):
             volume = Volume.create(
-                                   self.apiclient,
-                                   self.services["volume"],
-                                   zoneid=self.zone.id,
-                                   account=self.account.name,
-                                   domainid=self.account.domainid,
-                                   diskofferingid=self.disk_offering.id
-                                   )
+                self.apiclient,
+                self.services["volume"],
+                zoneid=self.zone.id,
+                account=self.account.name,
+                domainid=self.account.domainid,
+                diskofferingid=self.disk_offering.id
+            )
             self.debug("Created volume: %s for account: %s" % (
-                                                volume.id,
-                                                self.account.name
-                                                ))
+                volume.id,
+                self.account.name
+            ))
             # Check List Volume response for newly created volume
             list_volume_response = Volume.list(
-                                                self.apiclient,
-                                                id=volume.id
-                                                )
+                self.apiclient,
+                id=volume.id
+            )
             self.assertNotEqual(
-                                list_volume_response,
-                                None,
-                                "Check if volume exists in ListVolumes"
-                                )
+                list_volume_response,
+                None,
+                "Check if volume exists in ListVolumes"
+            )
             self.assertEqual(
-                                isinstance(list_volume_response, list),
-                                True,
-                                "Check list volumes response for valid list"
-                        )
+                isinstance(list_volume_response, list),
+                True,
+                "Check list volumes response for valid list"
+            )
             # Attach volume to VM
             self.virtual_machine.attach_volume(
-                                                self.apiclient,
-                                                volume
-                                                )
+                self.apiclient,
+                volume
+            )
 
         # Check all volumes attached to same VM
         list_volume_response = Volume.list(
-                                    self.apiclient,
-                                    virtualmachineid=self.virtual_machine.id,
-                                    type='DATADISK',
-                                    listall=True
-                                    )
+            self.apiclient,
+            virtualmachineid=self.virtual_machine.id,
+            type='DATADISK',
+            listall=True
+        )
         self.assertNotEqual(
-                                list_volume_response,
-                                None,
-                                "Check if volume exists in ListVolumes"
-                                )
+            list_volume_response,
+            None,
+            "Check if volume exists in ListVolumes"
+        )
         self.assertEqual(
-                                isinstance(list_volume_response, list),
-                                True,
-                                "Check list volumes response for valid list"
-                        )
+            isinstance(list_volume_response, list),
+            True,
+            "Check list volumes response for valid list"
+        )
         self.assertEqual(
             len(list_volume_response),
             self.max_data_volumes,
-            "Volumes attached to the VM %s. Expected %s" % (len(list_volume_response), self.max_data_volumes)
-        )
+            "Volumes attached to the VM %s. Expected %s" %
+            (len(list_volume_response),
+             self.max_data_volumes))
         # Create an ISO and attach it to VM
         iso = Iso.create(
-                         self.apiclient,
-                         self.services["iso"],
-                         account=self.account.name,
-                         domainid=self.account.domainid,
-                         )
+            self.apiclient,
+            self.services["iso"],
+            account=self.account.name,
+            domainid=self.account.domainid,
+        )
         self.debug("Created ISO with ID: %s for account: %s" % (
-                                                    iso.id,
-                                                    self.account.name
-                                                    ))
+            iso.id,
+            self.account.name
+        ))
 
         try:
             self.debug("Downloading ISO with ID: %s" % iso.id)
             iso.download(self.apiclient)
         except Exception as e:
-            self.fail("Exception while downloading ISO %s: %s"\
+            self.fail("Exception while downloading ISO %s: %s"
                       % (iso.id, e))
 
-        #Attach ISO to virtual machine
+        # Attach ISO to virtual machine
         self.debug("Attach ISO ID: %s to VM: %s" % (
-                                                    iso.id,
-                                                    self.virtual_machine.id
-                                                    ))
+            iso.id,
+            self.virtual_machine.id
+        ))
         cmd = attachIso.attachIsoCmd()
         cmd.id = iso.id
         cmd.virtualmachineid = self.virtual_machine.id
@@ -768,27 +779,27 @@ class TestAttachVolumeISO(cloudstackTestCase):
 
         # Verify ISO is attached to VM
         vm_response = VirtualMachine.list(
-                                        self.apiclient,
-                                        id=self.virtual_machine.id,
-                                        )
-        #Verify VM response to check whether VM deployment was successful
+            self.apiclient,
+            id=self.virtual_machine.id,
+        )
+        # Verify VM response to check whether VM deployment was successful
         self.assertEqual(
-                                isinstance(vm_response, list),
-                                True,
-                                "Check list VM response for valid list"
-                        )
+            isinstance(vm_response, list),
+            True,
+            "Check list VM response for valid list"
+        )
 
         self.assertNotEqual(
-                            len(vm_response),
-                            0,
-                            "Check VMs available in List VMs response"
-                        )
+            len(vm_response),
+            0,
+            "Check VMs available in List VMs response"
+        )
         vm = vm_response[0]
         self.assertEqual(
-                            vm.isoid,
-                            iso.id,
-                            "Check ISO is attached to VM or not"
-                        )
+            vm.isoid,
+            iso.id,
+            "Check ISO is attached to VM or not"
+        )
         return
 
 
@@ -805,52 +816,52 @@ class TestVolumes(cloudstackTestCase):
         cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
-                                    cls.api_client,
-                                    cls.services["disk_offering"]
-                                    )
+            cls.api_client,
+            cls.services["disk_offering"]
+        )
         template = get_template(
-                            cls.api_client,
-                            cls.zone.id,
-                            cls.services["ostype"]
-                            )
+            cls.api_client,
+            cls.zone.id,
+            cls.services["ostype"]
+        )
         cls.services["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["template"] = template.id
-        cls.services["virtual_machine"]["diskofferingid"] = cls.disk_offering.id
+        cls.services["virtual_machine"][
+            "diskofferingid"] = cls.disk_offering.id
 
         # Create VMs, VMs etc
         cls.account = Account.create(
-                            cls.api_client,
-                            cls.services["account"],
-                            domainid=cls.domain.id
-                            )
-
+            cls.api_client,
+            cls.services["account"],
+            domainid=cls.domain.id
+        )
 
         cls.service_offering = ServiceOffering.create(
-                                            cls.api_client,
-                                            cls.services["service_offering"]
-                                        )
+            cls.api_client,
+            cls.services["service_offering"]
+        )
         cls.virtual_machine = VirtualMachine.create(
-                                    cls.api_client,
-                                    cls.services["virtual_machine"],
-                                    accountid=cls.account.name,
-                                    domainid=cls.account.domainid,
-                                    serviceofferingid=cls.service_offering.id,
-                                )
+            cls.api_client,
+            cls.services["virtual_machine"],
+            accountid=cls.account.name,
+            domainid=cls.account.domainid,
+            serviceofferingid=cls.service_offering.id,
+        )
 
         cls.volume = Volume.create(
-                                   cls.api_client,
-                                   cls.services["volume"],
-                                   zoneid=cls.zone.id,
-                                   account=cls.account.name,
-                                   domainid=cls.account.domainid,
-                                   diskofferingid=cls.disk_offering.id
-                                   )
+            cls.api_client,
+            cls.services["volume"],
+            zoneid=cls.zone.id,
+            account=cls.account.name,
+            domainid=cls.account.domainid,
+            diskofferingid=cls.disk_offering.id
+        )
         cls._cleanup = [
-                        cls.service_offering,
-                        cls.disk_offering,
-                        cls.account
-                        ]
+            cls.service_offering,
+            cls.disk_offering,
+            cls.account
+        ]
 
     @classmethod
     def tearDownClass(cls):
@@ -865,7 +876,7 @@ class TestVolumes(cloudstackTestCase):
         self.cleanup = []
 
     def tearDown(self):
-        #Clean up, terminate the created volumes
+        # Clean up, terminate the created volumes
         cleanup_resources(self.apiclient, self.cleanup)
         return
 
@@ -883,52 +894,52 @@ class TestVolumes(cloudstackTestCase):
 
         # Check the list volumes response for vmname and virtualmachineid
         list_volume_response = Volume.list(
-                                                self.apiclient,
-                                                id=self.volume.id
-                                                )
+            self.apiclient,
+            id=self.volume.id
+        )
         self.assertNotEqual(
-                            list_volume_response,
-                            None,
-                            "Check if volume exists in ListVolumes"
-                            )
+            list_volume_response,
+            None,
+            "Check if volume exists in ListVolumes"
+        )
         self.assertEqual(
-                         isinstance(list_volume_response, list),
-                         True,
-                         "Check list volumes response for valid list"
-                        )
+            isinstance(list_volume_response, list),
+            True,
+            "Check list volumes response for valid list"
+        )
         volume = list_volume_response[0]
 
         self.assertEqual(
-                            volume.type,
-                            'DATADISK',
-                            "Check volume type from list volume response"
-                        )
+            volume.type,
+            'DATADISK',
+            "Check volume type from list volume response"
+        )
 
         self.assertEqual(
-                            hasattr(volume, 'vmname'),
-                            True,
-                            "Check whether volume has vmname field"
-                            )
+            hasattr(volume, 'vmname'),
+            True,
+            "Check whether volume has vmname field"
+        )
         self.assertEqual(
-                            hasattr(volume, 'virtualmachineid'),
-                            True,
-                            "Check whether volume has virtualmachineid field"
-                            )
+            hasattr(volume, 'virtualmachineid'),
+            True,
+            "Check whether volume has virtualmachineid field"
+        )
 
         # Attach volume to VM
         self.debug("Attach volume: %s to VM: %s" % (
-                                                    self.volume.id,
-                                                    self.virtual_machine.id
-                                                    ))
+            self.volume.id,
+            self.virtual_machine.id
+        ))
         self.virtual_machine.attach_volume(self.apiclient, self.volume)
 
         # Check all volumes attached to same VM
         list_volume_response = Volume.list(
-                                    self.apiclient,
-                                    virtualmachineid=self.virtual_machine.id,
-                                    type='DATADISK',
-                                    listall=True
-                                    )
+            self.apiclient,
+            virtualmachineid=self.virtual_machine.id,
+            type='DATADISK',
+            listall=True
+        )
         self.assertNotEqual(
             list_volume_response,
             None,
@@ -941,15 +952,15 @@ class TestVolumes(cloudstackTestCase):
         )
         volume = list_volume_response[0]
         self.assertEqual(
-                        volume.vmname,
-                        self.virtual_machine.name,
-                        "Check virtual machine name in list volumes response"
-                        )
+            volume.vmname,
+            self.virtual_machine.name,
+            "Check virtual machine name in list volumes response"
+        )
         self.assertEqual(
-                        volume.virtualmachineid,
-                        self.virtual_machine.id,
-                        "Check VM ID in list Volume response"
-                        )
+            volume.virtualmachineid,
+            self.virtual_machine.id,
+            "Check VM ID in list Volume response"
+        )
         return
 
     @attr(tags=["advanced", "advancedns"], required_hardware="false")
@@ -963,40 +974,40 @@ class TestVolumes(cloudstackTestCase):
         #    that volume.
 
         self.debug("Detach volume: %s to VM: %s" % (
-                                                    self.volume.id,
-                                                    self.virtual_machine.id
-                                                    ))
+            self.volume.id,
+            self.virtual_machine.id
+        ))
         self.virtual_machine.detach_volume(self.apiclient, self.volume)
 
-        #Sleep to ensure the current state will reflected in other calls
+        # Sleep to ensure the current state will reflected in other calls
         time.sleep(self.services["sleep"])
 
         list_volume_response = Volume.list(
-                                            self.apiclient,
-                                            id=self.volume.id
-                                            )
+            self.apiclient,
+            id=self.volume.id
+        )
         self.assertNotEqual(
-                            list_volume_response,
-                            None,
-                            "Check if volume exists in ListVolumes"
-                            )
+            list_volume_response,
+            None,
+            "Check if volume exists in ListVolumes"
+        )
         self.assertEqual(
-                         isinstance(list_volume_response, list),
-                         True,
-                         "Check list volumes response for valid list"
-                        )
+            isinstance(list_volume_response, list),
+            True,
+            "Check list volumes response for valid list"
+        )
         volume = list_volume_response[0]
         self.assertEqual(
-                         volume.virtualmachineid,
-                         None,
-                         "Check if volume state (detached) is reflected"
-                         )
+            volume.virtualmachineid,
+            None,
+            "Check if volume state (detached) is reflected"
+        )
 
         self.assertEqual(
-                         volume.vmname,
-                         None,
-                         "Check if volume state (detached) is reflected"
-                         )
+            volume.vmname,
+            None,
+            "Check if volume state (detached) is reflected"
+        )
         return
 
     @attr(tags=["advanced", "advancedns"], required_hardware="false")
@@ -1012,28 +1023,37 @@ class TestVolumes(cloudstackTestCase):
         cmd.id = self.volume.id
         self.apiclient.deleteVolume(cmd)
 
-        #Sleep to ensure the current state will reflected in other calls
+        # Sleep to ensure the current state will reflected in other calls
         time.sleep(self.services["sleep"])
 
         list_volume_response = Volume.list(
-                                            self.apiclient,
-                                            id=self.volume.id,
-                                            )
+            self.apiclient,
+            id=self.volume.id,
+        )
         self.assertEqual(
-                        list_volume_response,
-                        None,
-                        "Volume %s was not deleted" % self.volume.id
-                    )
+            list_volume_response,
+            None,
+            "Volume %s was not deleted" % self.volume.id
+        )
         return
 
-    @attr(tags=["advanced", "advancedns", "simulator", "basic", "eip", "sg"], required_hardware="false")
+    @attr(
+        tags=[
+            "advanced",
+            "advancedns",
+            "simulator",
+            "basic",
+            "eip",
+            "sg"],
+        required_hardware="false")
     def test_create_volume_under_domain(self):
         """Create a volume under a non-root domain as non-root-domain user
 
         1. Create a domain under ROOT
         2. Create a user within this domain
         3. As user in step 2. create a volume with standard disk offering
-        4. Ensure the volume is created in the domain and available to the user in his listVolumes call
+        4. Ensure the volume is created in the domain and available to the
+           user in his listVolumes call
         """
         dom = Domain.create(
             self.apiclient,
@@ -1053,11 +1073,19 @@ class TestVolumes(cloudstackTestCase):
         self.cleanup.insert(-2, domuser)
         self.assertTrue(domuser is not None)
 
-        domapiclient = self.testClient.getUserApiClient(UserName=domuser.name, DomainName=dom.name)
+        domapiclient = self.testClient.getUserApiClient(
+            UserName=domuser.name,
+            DomainName=dom.name)
 
         diskoffering = DiskOffering.list(self.apiclient)
-        self.assertTrue(isinstance(diskoffering, list), msg="DiskOffering list is not a list?")
-        self.assertTrue(len(diskoffering) > 0, "no disk offerings in the deployment")
+        self.assertTrue(
+            isinstance(
+                diskoffering,
+                list),
+            msg="DiskOffering list is not a list?")
+        self.assertTrue(
+            len(diskoffering) > 0,
+            "no disk offerings in the deployment")
 
         vol = Volume.create(
             domapiclient,
@@ -1067,21 +1095,33 @@ class TestVolumes(cloudstackTestCase):
             domainid=dom.id,
             diskofferingid=diskoffering[0].id
         )
-        self.assertTrue(vol is not None, "volume creation fails in domain %s as user %s" % (dom.name, domuser.name))
+        self.assertTrue(
+            vol is not None, "volume creation fails in domain %s as user %s" %
+            (dom.name, domuser.name))
 
         listed_vol = Volume.list(domapiclient, id=vol.id)
-        self.assertTrue(listed_vol is not None and isinstance(listed_vol, list),
-            "invalid response from listVolumes for volume %s" % vol.id)
-        self.assertTrue(listed_vol[0].id == vol.id,
-            "Volume returned by list volumes %s not matching with queried volume %s in domain %s" % (
-            listed_vol[0].id, vol.id, dom.name))
+        self.assertTrue(
+            listed_vol is not None and isinstance(
+                listed_vol,
+                list),
+            "invalid response from listVolumes for volume %s" %
+            vol.id)
+        self.assertTrue(
+            listed_vol[0].id == vol.id,
+            "Volume returned by list volumes %s not matching with queried\
+                    volume %s in domain %s" %
+            (listed_vol[0].id,
+                vol.id,
+                dom.name))
 
 
 class TestDeployVmWithCustomDisk(cloudstackTestCase):
 
     @classmethod
     def setUpClass(cls):
-        cls.testClient = super(TestDeployVmWithCustomDisk, cls).getClsTestClient()
+        cls.testClient = super(
+            TestDeployVmWithCustomDisk,
+            cls).getClsTestClient()
         cls.api_client = cls.testClient.getApiClient()
         cls.services = Services().services
         # Get Zone, Domain and templates
@@ -1089,36 +1129,35 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase):
         cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
         cls.services['mode'] = cls.zone.networktype
         cls.disk_offering = DiskOffering.create(
-                                    cls.api_client,
-                                    cls.services["disk_offering"],
-                                    custom=True
-                                    )
+            cls.api_client,
+            cls.services["disk_offering"],
+            custom=True
+        )
         template = get_template(
-                            cls.api_client,
-                            cls.zone.id,
-                            cls.services["ostype"]
-                            )
+            cls.api_client,
+            cls.zone.id,
+            cls.services["ostype"]
+        )
         cls.services["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["template"] = template.id
 
         # Create VMs, NAT Rules etc
         cls.account = Account.create(
-                            cls.api_client,
-                            cls.services["account"],
-                            domainid=cls.domain.id
-                            )
-
+            cls.api_client,
+            cls.services["account"],
+            domainid=cls.domain.id
+        )
 
         cls.service_offering = ServiceOffering.create(
-                                            cls.api_client,
-                                            cls.services["service_offering"]
-                                            )
+            cls.api_client,
+            cls.services["service_offering"]
+        )
         cls._cleanup = [
-                        cls.service_offering,
-                        cls.disk_offering,
-                        cls.account
-                        ]
+            cls.service_offering,
+            cls.disk_offering,
+            cls.account
+        ]
 
     def setUp(self):
 
@@ -1143,27 +1182,27 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase):
         #    cleanup all created data disks from the account
 
         config = Configurations.list(
-                                    self.apiclient,
-                                    name="custom.diskoffering.size.min"
-                                    )
+            self.apiclient,
+            name="custom.diskoffering.size.min"
+        )
         self.assertEqual(
             isinstance(config, list),
             True,
             "custom.diskoffering.size.min should be present in global config"
-            )
+        )
         # minimum size of custom disk (in GBs)
         min_size = int(config[0].value)
         self.debug("custom.diskoffering.size.min: %s" % min_size)
 
         config = Configurations.list(
-                                    self.apiclient,
-                                    name="custom.diskoffering.size.max"
-                                    )
+            self.apiclient,
+            name="custom.diskoffering.size.max"
+        )
         self.assertEqual(
             isinstance(config, list),
             True,
             "custom.diskoffering.size.min should be present in global config"
-            )
+        )
         # maximum size of custom disk (in GBs)
         max_size = int(config[0].value)
         self.debug("custom.diskoffering.size.max: %s" % max_size)
@@ -1173,24 +1212,24 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase):
         self.services["custom_volume"]["zoneid"] = self.zone.id
         with self.assertRaises(Exception):
             Volume.create_custom_disk(
-                                    self.apiclient,
-                                    self.services["custom_volume"],
-                                    account=self.account.name,
-                                    domainid=self.account.domainid,
-                                    diskofferingid=self.disk_offering.id
-                                    )
+                self.apiclient,
+                self.services["custom_volume"],
+                account=self.account.name,
+                domainid=self.account.domainid,
+                diskofferingid=self.disk_offering.id
+            )
         self.debug("Create volume failed!")
 
         self.debug("Creating a volume with size more than max cust disk size")
         self.services["custom_volume"]["customdisksize"] = (max_size + 1)
         with self.assertRaises(Exception):
             Volume.create_custom_disk(
-                                    self.apiclient,
-                                    self.services["custom_volume"],
-                                    account=self.account.name,
-                                    domainid=self.account.domainid,
-                                    diskofferingid=self.disk_offering.id
-                                    )
+                self.apiclient,
+                self.services["custom_volume"],
+                account=self.account.name,
+                domainid=self.account.domainid,
+                diskofferingid=self.disk_offering.id
+            )
         self.debug("Create volume failed!")
 
         self.debug("Creating a volume with size more than min cust disk " +
@@ -1199,17 +1238,18 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase):
         self.services["custom_volume"]["customdisksize"] = (min_size + 1)
         try:
             Volume.create_custom_disk(
-                                    self.apiclient,
-                                    self.services["custom_volume"],
-                                    account=self.account.name,
-                                    domainid=self.account.domainid,
-                                    diskofferingid=self.disk_offering.id
-                                    )
+                self.apiclient,
+                self.services["custom_volume"],
+                account=self.account.name,
+                domainid=self.account.domainid,
+                diskofferingid=self.disk_offering.id
+            )
             self.debug("Create volume of cust disk size succeeded")
         except Exception as e:
             self.fail("Create volume failed with exception: %s" % e)
         return
 
+
 class TestMigrateVolume(cloudstackTestCase):
 
     @classmethod
@@ -1234,7 +1274,8 @@ class TestMigrateVolume(cloudstackTestCase):
         cls.services["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["zoneid"] = cls.zone.id
         cls.services["virtual_machine"]["template"] = template.id
-        cls.services["virtual_machine"]["diskofferingid"] = cls.disk_offering.id
+        cls.services["virtual_machine"][
+            "diskofferingid"] = cls.disk_offering.id
 
         # Create VMs, VMs etc
         cls.account = Account.create(
@@ -1255,9 +1296,9 @@ class TestMigrateVolume(cloudstackTestCase):
             mode=cls.services["mode"]
         )
         cls._cleanup = [
-                        cls.small_offering,
-                        cls.account
-                       ]
+            cls.small_offering,
+            cls.account
+        ]
         return
 
     @classmethod
@@ -1278,13 +1319,15 @@ class TestMigrateVolume(cloudstackTestCase):
         cleanup_resources(self.apiclient, self.cleanup)
         return
 
-    @attr(tags=["advanced","sg","advancedsg"], required_hardware='true')
+    @attr(tags=["advanced", "sg", "advancedsg"], required_hardware='true')
     def test_01_migrateVolume(self):
         """
-        @Desc:Volume is not retaining same uuid when migrating from one storage to another.
+        @Desc:Volume is not retaining same uuid when migrating from one
+              storage to another.
         Step1:Create a volume/data disk
         Step2:Verify UUID of the volume
-        Step3:Migrate the volume to another primary storage within the cluster
+        Step3:Migrate the volume to another primary storage within
+              the cluster
         Step4:Migrating volume to new primary storage should succeed
         Step5:volume UUID should not change even after migration
         """
@@ -1295,14 +1338,17 @@ class TestMigrateVolume(cloudstackTestCase):
             zoneid=self.zone.id,
             account=self.account.name,
             domainid=self.account.domainid,
-            )
-        self.assertIsNotNone(vol,"Failed to create volume")
+        )
+        self.assertIsNotNone(vol, "Failed to create volume")
         vol_res = Volume.list(
             self.apiclient,
             id=vol.id
         )
-        self.assertEqual(validateList(vol_res)[0],PASS,"Invalid response returned for list volumes")
-        vol_uuid=vol_res[0].id
+        self.assertEqual(
+            validateList(vol_res)[0],
+            PASS,
+            "Invalid response returned for list volumes")
+        vol_uuid = vol_res[0].id
         try:
             self.virtual_machine.attach_volume(
                 self.apiclient,
@@ -1315,10 +1361,15 @@ class TestMigrateVolume(cloudstackTestCase):
             id=vol.id
         )
         if not pools:
-            self.skipTest("No suitable storage pools found for volume migration. Skipping")
-        self.assertEqual(validateList(pools)[0],PASS,"invalid pool response from findStoragePoolsForMigration")
-        pool=pools[0]
-        self.debug("Migrating Volume-ID: %s to Pool: %s" % (vol.id,pool.id))
+            self.skipTest(
+                "No suitable storage pools found for volume migration.\
+                        Skipping")
+        self.assertEqual(
+            validateList(pools)[0],
+            PASS,
+            "invalid pool response from findStoragePoolsForMigration")
+        pool = pools[0]
+        self.debug("Migrating Volume-ID: %s to Pool: %s" % (vol.id, pool.id))
         try:
             Volume.migrate(
                 self.apiclient,
@@ -1334,12 +1385,16 @@ class TestMigrateVolume(cloudstackTestCase):
             listall='true',
             type='DATADISK'
         )
-        self.assertEqual(validateList(migrated_vols)[0],PASS,"invalid volumes response after migration")
-        migrated_vol_uuid=migrated_vols[0].id
+        self.assertEqual(
+            validateList(migrated_vols)[0],
+            PASS,
+            "invalid volumes response after migration")
+        migrated_vol_uuid = migrated_vols[0].id
         self.assertEqual(
             vol_uuid,
             migrated_vol_uuid,
-            "Volume is not retaining same uuid when migrating from one storage to another"
+            "Volume is not retaining same uuid when migrating from one\
+                    storage to another"
         )
         self.virtual_machine.detach_volume(
             self.apiclient,


[30/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK:6915 search including removed


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

Branch: refs/heads/master
Commit: 0c153966e6269249fa38ab7859ab8352747e73f4
Parents: aaa561a
Author: amoghvk <am...@citrix.com>
Authored: Fri Oct 31 15:29:07 2014 -0700
Committer: amoghvk <am...@citrix.com>
Committed: Fri Oct 31 15:29:07 2014 -0700

----------------------------------------------------------------------
 .../vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java         | 4 ++--
 .../xenserver/src/com/cloud/hypervisor/XenServerGuru.java        | 2 +-
 server/src/com/cloud/hypervisor/KVMGuru.java                     | 2 +-
 server/src/com/cloud/hypervisor/LXCGuru.java                     | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c153966/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
index 63ee707..7c23699 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -27,7 +27,6 @@ import java.util.UUID;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore;
@@ -38,6 +37,7 @@ import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.storage.command.CopyCommand;
 import org.apache.cloudstack.storage.command.DeleteCommand;
+import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.storage.to.VolumeObjectTO;
@@ -311,7 +311,7 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru, Co
             }
         }
         // Determine the VM's OS description
-        GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId());
+        GuestOSVO guestOS = _guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId());
         to.setOs(guestOS.getDisplayName());
         to.setHostName(vm.getHostName());
         HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c153966/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
index 4019edc..89c2046 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
@@ -90,7 +90,7 @@ public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru
         to.setBootloader(bt);
 
         // Determine the VM's OS description
-        GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId());
+        GuestOSVO guestOS = _guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId());
         to.setOs(guestOS.getDisplayName());
         HostVO host = hostDao.findById(vm.getVirtualMachine().getHostId());
         GuestOSHypervisorVO guestOsMapping = null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c153966/server/src/com/cloud/hypervisor/KVMGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/KVMGuru.java b/server/src/com/cloud/hypervisor/KVMGuru.java
index 492342c..b6a7651 100644
--- a/server/src/com/cloud/hypervisor/KVMGuru.java
+++ b/server/src/com/cloud/hypervisor/KVMGuru.java
@@ -57,7 +57,7 @@ public class KVMGuru extends HypervisorGuruBase implements HypervisorGuru {
         VirtualMachineTO to = toVirtualMachineTO(vm);
 
         // Determine the VM's OS description
-        GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId());
+        GuestOSVO guestOS = _guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId());
         to.setOs(guestOS.getDisplayName());
         HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId());
         GuestOSHypervisorVO guestOsMapping = null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c153966/server/src/com/cloud/hypervisor/LXCGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/LXCGuru.java b/server/src/com/cloud/hypervisor/LXCGuru.java
index 46989d9..025c498 100644
--- a/server/src/com/cloud/hypervisor/LXCGuru.java
+++ b/server/src/com/cloud/hypervisor/LXCGuru.java
@@ -52,7 +52,7 @@ public class LXCGuru extends HypervisorGuruBase implements HypervisorGuru {
         VirtualMachineTO to = toVirtualMachineTO(vm);
 
         // Determine the VM's OS description
-        GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId());
+        GuestOSVO guestOS = _guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId());
         to.setOs(guestOS.getDisplayName());
 
         HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId());


[31/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

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


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

Branch: refs/heads/master
Commit: 6df396c9c050878b005f464a4155be839dc5cd1b
Parents: 0c15396 2652195
Author: amoghvk <am...@citrix.com>
Authored: Fri Oct 31 15:29:40 2014 -0700
Committer: amoghvk <am...@citrix.com>
Committed: Fri Oct 31 15:29:40 2014 -0700

----------------------------------------------------------------------
 .../src/com/cloud/storage/snapshot/SnapshotManagerImpl.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[08/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7660: Enhance system vm template to support baremetal Installed Package flask and merged the disk partition


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

Branch: refs/heads/master
Commit: 591f46847485b59e83bdfdf8bfd0478a7a755463
Parents: 58455c0
Author: Harikrishna Patnala <ha...@citrix.com>
Authored: Tue Oct 21 18:31:48 2014 +0530
Committer: Frank Zhang <fr...@citrix.com>
Committed: Wed Oct 29 15:27:01 2014 -0700

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/preseed.cfg    | 42 --------------------
 1 file changed, 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591f4684/tools/appliance/definitions/systemvmtemplate/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
index 1e4fb4e..724e05b 100644
--- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg
+++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg
@@ -128,48 +128,6 @@ d-i partman-auto/choose_recipe select atomic
 # just point at it.
 #d-i partman-auto/expert_recipe_file string /hd-media/recipe
 
-d-i partman-auto/expert_recipe string                         \
-      boot-root ::                                            \
-              30 50 100 ext4                                  \
-                      $primary{ } $bootable{ }                \
-                      method{ format } format{ }              \
-                      use_filesystem{ } filesystem{ ext4 }    \
-                      mountpoint{ /boot }                     \
-              .                                               \
-              250 40 400 ext4                                 \
-                      method{ format } format{ }              \
-                      use_filesystem{ } filesystem{ ext4 }    \
-                      mountpoint{ / }                         \
-              .                                               \
-              50 100 200 ext4                                 \
-                      method{ format } format{ }              \
-                      use_filesystem{ } filesystem{ ext4 }    \
-                      mountpoint{ /home }                     \
-              .                                               \
-              700 70 1100 ext4                                \
-                      method{ format } format{ }              \
-                      use_filesystem{ } filesystem{ ext4 }    \
-                      mountpoint{ /usr }                      \
-              .                                               \
-              400 40 500 ext4                                 \
-                      method{ format } format{ }              \
-                      use_filesystem{ } filesystem{ ext4 }    \
-                      mountpoint{ /opt }                      \
-              .                                               \
-              450 70 1000 ext4                                \
-                      method{ format } format{ }              \
-                      use_filesystem{ } filesystem{ ext4 }    \
-                      mountpoint{ /var }                      \
-              .                                               \
-              50 60 100 ext4                                  \
-                      method{ format } format{ }              \
-                      use_filesystem{ } filesystem{ ext4 }    \
-                      mountpoint{ /tmp }                      \
-              .                                               \
-              70 100 256 linux-swap                           \
-                      method{ swap } format{ }                \
-              .
-
 # If not, you can put an entire recipe into the preconfiguration file in one
 # (logical) line. This example creates a small /boot partition, suitable
 # swap, and uses the rest of the space for the root partition:


[40/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
remove duplicate import


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

Branch: refs/heads/master
Commit: 28d5b9827a021d3c1739f18a5e972f8851602da7
Parents: c8f7278
Author: Frank Zhang <fr...@citrix.com>
Authored: Mon Nov 3 17:04:30 2014 -0800
Committer: Frank Zhang <fr...@citrix.com>
Committed: Mon Nov 3 17:04:30 2014 -0800

----------------------------------------------------------------------
 .../BaremetalKickStartServiceImpl.java            | 18 ------------------
 1 file changed, 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/28d5b982/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
index ef37294..a3ac0b8 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
@@ -18,23 +18,6 @@
 // Automatically generated by addcopyright.py at 01/29/2013
 package com.cloud.baremetal.networkservice;
 
-import java.io.File;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-
-import org.apache.cloudstack.api.AddBaremetalKickStartPxeCmd;
-import org.apache.cloudstack.api.AddBaremetalPxeCmd;
-import org.apache.cloudstack.api.ListBaremetalPxeServersCmd;
-import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-import org.apache.log4j.Logger;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.baremetal.IpmISetBootDevCommand;
 import com.cloud.agent.api.baremetal.IpmISetBootDevCommand.BootDev;
@@ -42,7 +25,6 @@ import com.cloud.agent.api.baremetal.PrepareKickstartPxeServerCommand;
 import com.cloud.baremetal.database.BaremetalPxeDao;
 import com.cloud.baremetal.database.BaremetalPxeVO;
 import com.cloud.baremetal.networkservice.BaremetalPxeManager.BaremetalPxeType;
-import com.cloud.configuration.Config;
 import com.cloud.dc.DataCenter;
 import com.cloud.deploy.DeployDestination;
 import com.cloud.exception.AgentUnavailableException;


[38/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-3212: ui > infrastructure > zones > zone > physical network > guest > network > guest ip range - listview: add gateway, netmask field.


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

Branch: refs/heads/master
Commit: 207ec2574c0a8a11fab2562dca241ab27a98dad1
Parents: ddfd74d
Author: Jessica Wang <je...@apache.org>
Authored: Mon Nov 3 15:55:06 2014 -0800
Committer: Jessica Wang <je...@apache.org>
Committed: Mon Nov 3 15:55:06 2014 -0800

----------------------------------------------------------------------
 ui/scripts/system.js | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/207ec257/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index fd4df48..7b25c81 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -19318,6 +19318,12 @@
                         },
                         endipv6: {
                             label: 'label.ipv6.end.ip'
+                        },
+                        gateway: {
+                        	label: 'label.gateway'
+                        },
+                        netmask: {
+                        	label: 'label.netmask'
                         }
                     },
                     


[46/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7841: Gracefully reload haproxy config

The old way would disconnect all the existing connections through haproxy when
reload the config.

This new way would ensure that all the existing connections would still alive
after reload the config.


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

Branch: refs/heads/master
Commit: c15ed74f63559dca7692cfcfe695e195c3401454
Parents: a43fba6
Author: Sheng Yang <sh...@citrix.com>
Authored: Tue Nov 4 16:26:23 2014 -0800
Committer: Sheng Yang <sh...@citrix.com>
Committed: Tue Nov 4 16:41:46 2014 -0800

----------------------------------------------------------------------
 systemvm/patches/debian/config/root/reconfigLB.sh | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c15ed74f/systemvm/patches/debian/config/root/reconfigLB.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/root/reconfigLB.sh b/systemvm/patches/debian/config/root/reconfigLB.sh
index 70a2912..e68cc3d 100755
--- a/systemvm/patches/debian/config/root/reconfigLB.sh
+++ b/systemvm/patches/debian/config/root/reconfigLB.sh
@@ -23,23 +23,16 @@ new_config=$1
 
 # save previous state
   mv /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.old
-  mv /var/run/haproxy.pid /var/run/haproxy.pid.old
 
   mv $new_config /etc/haproxy/haproxy.cfg
-  kill -TTOU $(cat /var/run/haproxy.pid.old)
-  sleep 2
-  if haproxy -D -p /var/run/haproxy.pid -f /etc/haproxy/haproxy.cfg; then
+  if haproxy -p /var/run/haproxy.pid -f /etc/haproxy/haproxy.cfg -sf $(cat /var/run/haproxy.pid); then
     logger -t cloud "New haproxy instance successfully loaded, stopping previous one."
-    kill -KILL $(cat /var/run/haproxy.pid.old)
-    rm -f /var/run/haproxy.pid.old
     ret=0
   else
     logger -t cloud "New instance failed to start, resuming previous one."
-    kill -TTIN $(cat /var/run/haproxy.pid.old)
-    rm -f /var/run/haproxy.pid
-    mv /var/run/haproxy.pid.old /var/run/haproxy.pid
     mv /etc/haproxy/haproxy.cfg $new_config
     mv /etc/haproxy/haproxy.cfg.old /etc/haproxy/haproxy.cfg
+    haproxy -p /var/run/haproxy.pid -f /etc/haproxy/haproxy.cfg -sf $(cat /var/run/haproxy.pid)
     ret=1
   fi
 


[39/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7834
Web UI shows all DHCP/PXE providers in cloud when admin click DHCP/PXE IP for A zone

Conflicts:
	plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java


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

Branch: refs/heads/master
Commit: c8f72780ead91837e998a14459019183081a0556
Parents: 207ec25
Author: Frank Zhang <fr...@citrix.com>
Authored: Mon Nov 3 16:43:09 2014 -0800
Committer: Frank Zhang <fr...@citrix.com>
Committed: Mon Nov 3 16:44:53 2014 -0800

----------------------------------------------------------------------
 .../BaremetalDhcpManagerImpl.java               | 28 +++++++++----------
 .../BaremetalKickStartServiceImpl.java          | 22 +++++++++++++--
 .../cloudstack/api/ListBaremetalDhcpCmd.java    | 29 ++++++++++++++------
 .../api/ListBaremetalPxeServersCmd.java         | 25 +++++++++++------
 4 files changed, 71 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8f72780/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
index 3299268..2b67abe 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
@@ -22,21 +22,6 @@
 // Automatically generated by addcopyright.py at 04/03/2012
 package com.cloud.baremetal.networkservice;
 
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.AddBaremetalDhcpCmd;
-import org.apache.cloudstack.api.ListBaremetalDhcpCmd;
-
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.StartupCommand;
@@ -75,6 +60,18 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.UserVmDao;
+import org.apache.cloudstack.api.AddBaremetalDhcpCmd;
+import org.apache.cloudstack.api.ListBaremetalDhcpCmd;
+import org.apache.log4j.Logger;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Local(value = {BaremetalDhcpManager.class})
 public class BaremetalDhcpManagerImpl extends ManagerBase implements BaremetalDhcpManager, ResourceStateAdapter {
@@ -310,6 +307,7 @@ public class BaremetalDhcpManagerImpl extends ManagerBase implements BaremetalDh
             sc.and(sc.entity().getDeviceType(), Op.EQ, cmd.getDeviceType());
         }
 
+        sc.and(sc.entity().getPhysicalNetworkId(), Op.EQ, cmd.getPhysicalNetworkId());
         List<BaremetalDhcpVO> vos = sc.list();
         for (BaremetalDhcpVO vo : vos) {
             responses.add(generateApiResponse(vo));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8f72780/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
index 2786e13..ef37294 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
@@ -35,7 +35,6 @@ import org.apache.cloudstack.api.AddBaremetalPxeCmd;
 import org.apache.cloudstack.api.ListBaremetalPxeServersCmd;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.log4j.Logger;
-
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.baremetal.IpmISetBootDevCommand;
 import com.cloud.agent.api.baremetal.IpmISetBootDevCommand.BootDev;
@@ -43,6 +42,7 @@ import com.cloud.agent.api.baremetal.PrepareKickstartPxeServerCommand;
 import com.cloud.baremetal.database.BaremetalPxeDao;
 import com.cloud.baremetal.database.BaremetalPxeVO;
 import com.cloud.baremetal.networkservice.BaremetalPxeManager.BaremetalPxeType;
+import com.cloud.configuration.Config;
 import com.cloud.dc.DataCenter;
 import com.cloud.deploy.DeployDestination;
 import com.cloud.exception.AgentUnavailableException;
@@ -79,6 +79,22 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.DomainRouterDao;
 import com.cloud.vm.dao.NicDao;
+import org.apache.cloudstack.api.AddBaremetalKickStartPxeCmd;
+import org.apache.cloudstack.api.AddBaremetalPxeCmd;
+import org.apache.cloudstack.api.ListBaremetalPxeServersCmd;
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Local(value = BaremetalPxeService.class)
 public class BaremetalKickStartServiceImpl extends BareMetalPxeServiceBase implements BaremetalPxeService {
@@ -374,7 +390,9 @@ public class BaremetalKickStartServiceImpl extends BareMetalPxeServiceBase imple
             return responses;
         }
 
-        List<BaremetalPxeVO> vos = _pxeDao.listAll();
+        QueryBuilder<BaremetalPxeVO> sc = QueryBuilder.create(BaremetalPxeVO.class);
+        sc.and(sc.entity().getPhysicalNetworkId(), Op.EQ, cmd.getPhysicalNetworkId());
+        List<BaremetalPxeVO> vos = sc.list();
         for (BaremetalPxeVO vo : vos) {
             responses.add(getApiResponse(vo));
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8f72780/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalDhcpCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalDhcpCmd.java b/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalDhcpCmd.java
index b159810..36a62f8 100755
--- a/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalDhcpCmd.java
+++ b/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalDhcpCmd.java
@@ -18,14 +18,6 @@
 // Automatically generated by addcopyright.py at 01/29/2013
 package org.apache.cloudstack.api;
 
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.response.ListResponse;
-
 import com.cloud.baremetal.networkservice.BaremetalDhcpManager;
 import com.cloud.baremetal.networkservice.BaremetalDhcpResponse;
 import com.cloud.exception.ConcurrentOperationException;
@@ -33,6 +25,12 @@ import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.NetworkRuleConflictException;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceUnavailableException;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+import java.util.List;
 
 @APICommand(name = "listBaremetalDhcp", description = "list baremetal dhcp servers", responseObject = BaremetalDhcpResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
@@ -51,6 +49,21 @@ public class ListBaremetalDhcpCmd extends BaseListCmd {
     @Parameter(name = ApiConstants.DHCP_SERVER_TYPE, type = CommandType.STRING, description = "Type of DHCP device")
     private String deviceType;
 
+    @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID,
+            type = CommandType.UUID,
+            entityType = PhysicalNetworkResponse.class,
+            required = true,
+            description = "the Physical Network ID")
+    private Long physicalNetworkId;
+
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    public void setPhysicalNetworkId(Long physicalNetworkId) {
+        this.physicalNetworkId = physicalNetworkId;
+    }
+
     public Long getId() {
         return id;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8f72780/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalPxeServersCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalPxeServersCmd.java b/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalPxeServersCmd.java
index 1663663..8707aa2 100755
--- a/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalPxeServersCmd.java
+++ b/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalPxeServersCmd.java
@@ -18,14 +18,6 @@
 // Automatically generated by addcopyright.py at 01/29/2013
 package org.apache.cloudstack.api;
 
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.response.ListResponse;
-
 import com.cloud.baremetal.networkservice.BaremetalPxeManager;
 import com.cloud.baremetal.networkservice.BaremetalPxeResponse;
 import com.cloud.exception.ConcurrentOperationException;
@@ -33,6 +25,12 @@ import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.NetworkRuleConflictException;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceUnavailableException;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+import java.util.List;
 
 @APICommand(name = "listBaremetalPxeServers", description = "list baremetal pxe server", responseObject = BaremetalPxeResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
@@ -49,6 +47,13 @@ public class ListBaremetalPxeServersCmd extends BaseListCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "Pxe server device ID")
     private Long id;
 
+    @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID,
+            type = CommandType.UUID,
+            entityType = PhysicalNetworkResponse.class,
+            required = true,
+            description = "the Physical Network ID")
+    private Long physicalNetworkId;
+
     public Long getId() {
         return id;
     }
@@ -57,6 +62,10 @@ public class ListBaremetalPxeServersCmd extends BaseListCmd {
         this.id = id;
     }
 
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
     @Override
     public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
         ResourceAllocationException, NetworkRuleConflictException {


[43/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7835: Deleted volumes with null UUID and no removed timestamp in database still appear.
Also removed CREATING -> DESTROY via DESTROYREQUESTED, which was causing the volume to get stuck in expunging
state.


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

Branch: refs/heads/master
Commit: a53d39c1b687df22768613d556637c34354cb96b
Parents: 9168d82
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Tue Nov 4 13:27:17 2014 +0530
Committer: Sanjay Tripathi <sa...@citrix.com>
Committed: Tue Nov 4 17:57:31 2014 +0530

----------------------------------------------------------------------
 api/src/com/cloud/storage/Volume.java            |  1 -
 .../storage/volume/VolumeServiceImpl.java        | 19 ++++++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a53d39c1/api/src/com/cloud/storage/Volume.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/Volume.java b/api/src/com/cloud/storage/Volume.java
index b67a395..91ad955 100755
--- a/api/src/com/cloud/storage/Volume.java
+++ b/api/src/com/cloud/storage/Volume.java
@@ -69,7 +69,6 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity, Ba
             s_fsm.addTransition(Creating, Event.OperationRetry, Creating);
             s_fsm.addTransition(Creating, Event.OperationFailed, Allocated);
             s_fsm.addTransition(Creating, Event.OperationSucceeded, Ready);
-            s_fsm.addTransition(Creating, Event.DestroyRequested, Destroy);
             s_fsm.addTransition(Creating, Event.CreateRequested, Creating);
             s_fsm.addTransition(Ready, Event.ResizeRequested, Resizing);
             s_fsm.addTransition(Resizing, Event.OperationSucceeded, Ready);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a53d39c1/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index d97ad60..1297da9 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -1021,11 +1021,20 @@ public class VolumeServiceImpl implements VolumeService {
             srcVolume.processEvent(Event.OperationSuccessed);
             destVolume.processEvent(Event.OperationSuccessed, result.getAnswer());
             _volumeDao.updateUuid(srcVolume.getId(), destVolume.getId());
-            destroyVolume(srcVolume.getId());
-            srcVolume = volFactory.getVolume(srcVolume.getId());
-            AsyncCallFuture<VolumeApiResult> destroyFuture = expungeVolumeAsync(srcVolume);
-            destroyFuture.get();
-            future.complete(res);
+            try {
+                destroyVolume(srcVolume.getId());
+                srcVolume = volFactory.getVolume(srcVolume.getId());
+                AsyncCallFuture<VolumeApiResult> destroyFuture = expungeVolumeAsync(srcVolume);
+                // If volume destroy fails, this could be because of vdi is still in use state, so wait and retry.
+                if (destroyFuture.get().isFailed()) {
+                    Thread.sleep(5 * 1000);
+                    destroyFuture = expungeVolumeAsync(srcVolume);
+                    destroyFuture.get();
+                }
+                future.complete(res);
+            } catch (Exception e) {
+                s_logger.debug("failed to clean up volume on storage", e);
+            }
             return null;
         } catch (Exception e) {
             s_logger.debug("Failed to process copy volume callback", e);


[21/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7816: UI > Global Settings > add "Baremetal Rack Configuration" section.


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

Branch: refs/heads/master
Commit: b70106158c2c0e3315704a8843c7ed455282f023
Parents: 1681b02
Author: Jessica Wang <je...@apache.org>
Authored: Thu Oct 30 11:27:38 2014 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Oct 30 11:27:38 2014 -0700

----------------------------------------------------------------------
 ui/scripts/globalSettings.js | 135 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 134 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b7010615/ui/scripts/globalSettings.js
----------------------------------------------------------------------
diff --git a/ui/scripts/globalSettings.js b/ui/scripts/globalSettings.js
index 4cbfd07..34d65a2 100644
--- a/ui/scripts/globalSettings.js
+++ b/ui/scripts/globalSettings.js
@@ -234,7 +234,140 @@
                         }
                     }
                 }
-            },
+            },      
+            baremetalRct: {
+                type: 'select',
+                title: 'Baremetal Rack Configuration',
+                listView: {
+                    id: 'baremetalRct',
+                    label: 'Baremetal Rack Configuration',
+                    fields: {   
+                    	id: {
+                    		label: 'label.id'
+                    	},
+                        url: {
+                            label: 'label.url'
+                        }
+                    },
+                    dataProvider: function(args) {
+                        var data = {};
+                        listViewDataProvider(args, data);
+                        
+                        $.ajax({
+                        	url: createURL("listBaremetalRct"),
+                        	data: data,
+                        	success: function(json) {                        		
+                        		args.response.success({ data: json.listbaremetalrctresponse.baremetalrct });
+                        	}
+                        });   
+                    },
+                    actions: {
+                        add: {
+                            label: 'Add Baremetal Rack Configuration',
+                            messages: {                                
+                                notification: function(args) {
+                                    return 'Add Baremetal Rack Configuration';
+                                }
+                            },
+                            createForm: {
+                                title: 'Add Baremetal Rack Configuration',
+                                fields: {
+                                    url: {
+                                        label: 'label.url',
+                                        validation: {
+                                            required: true
+                                        }
+                                    }
+                                }
+                            },
+                            action: function(args) {                                
+                                $.ajax({
+                                	url: createURL("addBaremetalRct"),
+                                	data: {
+                                		baremetalrcturl: args.data.url
+                                	},
+                                	success: function(json) {                                		
+                                		var jid = json.addbaremetalrctresponse.jobid
+                                		args.response.success({
+                                            _custom: {
+                                                jobId: jid,
+                                                getUpdatedItem: function(json) {                                                	
+                                                    return json.queryasyncjobresultresponse.jobresult.baremetalrct;
+                                                }
+                                            }
+                                        });
+                                	}
+                                });
+                            },
+                            notification: {
+                                poll: pollAsyncJobResult
+                            }
+                        }
+                    },                    
+                    
+                    detailView: {
+                    	name: "details",
+                    	actions: {
+                    		remove: {
+                                label: 'Delete Baremetal Rack Configuration',
+                                messages: {
+                                    confirm: function(args) {
+                                        return 'Please confirm that you want to delete Baremetal Rack Configuration.';
+                                    },
+                                    notification: function(args) {
+                                        return 'Delete Baremetal Rack Configuration';
+                                    }
+                                },
+                                action: function(args) {                                	
+                                    var data = {
+                                        id: args.context.baremetalRct[0].id
+                                    };
+                                    $.ajax({
+                                        url: createURL('deleteBaremetalRct'),
+                                        data: data,
+                                        success: function(json) {
+                                        	var jid = json.deletebaremetalrctresponse.jobid;                                        	                                   	
+                                            args.response.success({
+                                                _custom: {
+                                                    jobId: jid
+                                                }
+                                            });                                        	
+                                        }
+                                    });
+                                },
+                                notification: {
+                                    poll: pollAsyncJobResult
+                                }
+                            }
+                    	},                    	
+                    	tabs: {
+                            details: {
+                                title: 'label.details',
+                                fields: [{
+                                	id: {
+                                		label: 'label.id'
+                                	},
+                                    url: {
+                                        label: 'label.url'
+                                    }
+                                }],
+                                dataProvider: function(args) {                                	
+                                    var data = {
+                                        id: args.context.baremetalRct[0].id
+                                    };                                    
+                                    $.ajax({
+                                    	url: createURL("listBaremetalRct"),
+                                    	data: data,
+                                    	success: function(json) {                                         		
+                                    		args.response.success({ data: json.listbaremetalrctresponse.baremetalrct[0] });
+                                    	}
+                                    });                                       
+                                }
+                            }
+                        }                    	
+                    }                    
+                }
+            },        
             hypervisorCapabilities: {
                 type: 'select',
                 title: 'label.hypervisor.capabilities',


[45/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7383: UI > Instances > detailView > snapshot option > hide this option when hypervisor is LXC.


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

Branch: refs/heads/master
Commit: a43fba64dacb55da6dedf6140beb5f692a486e61
Parents: 25e514a
Author: Jessica Wang <je...@apache.org>
Authored: Tue Nov 4 14:42:29 2014 -0800
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Nov 4 14:42:29 2014 -0800

----------------------------------------------------------------------
 ui/scripts/instances.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a43fba64/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 3cf5dd6..b46c343 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -2248,8 +2248,12 @@
         } else if (jsonObj.state == 'Running') {
             allowedActions.push("stop");
             allowedActions.push("restart");
-            if (jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
+            
+            if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true) 
+            		|| (jsonObj.hypervisor != 'LXC')) {
                 allowedActions.push("snapshot");
+            }
+            
             allowedActions.push("destroy");            
             allowedActions.push("reinstall");
              
@@ -2278,8 +2282,12 @@
             allowedActions.push("start");
             allowedActions.push("destroy");
             allowedActions.push("reinstall");
-            if (jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
+            
+            if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true) 
+            		|| (jsonObj.hypervisor != 'LXC')) {
                 allowedActions.push("snapshot");
+            }
+            
             allowedActions.push("scaleUp");  //when vm is stopped, scaleUp is supported for all hypervisors 
             allowedActions.push("changeAffinity");
 


[44/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7384: UI > Instances > detailView > change service offering option > hide it when VM state is Running and hyperviror is LXC.


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

Branch: refs/heads/master
Commit: 25e514a28e94ab32d452da45d8e6b42ab39ccffb
Parents: a53d39c1
Author: Jessica Wang <je...@apache.org>
Authored: Tue Nov 4 11:33:15 2014 -0800
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Nov 4 11:33:15 2014 -0800

----------------------------------------------------------------------
 ui/scripts/instances.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25e514a2/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 838e4d5..3cf5dd6 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -2253,8 +2253,8 @@
             allowedActions.push("destroy");            
             allowedActions.push("reinstall");
              
-            //when userVm is running, scaleUp is not supported for KVM
-            if (jsonObj.hypervisor != 'KVM') {
+            //when userVm is running, scaleUp is not supported for KVM, LXC
+            if (jsonObj.hypervisor != 'KVM' && jsonObj.hypervisor != 'LXC') {
             	allowedActions.push("scaleUp");
             }              
 


[48/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7800: Correcting code related to unplug NIC on VMware

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: 2cd4ad201adbee3ad75dd57d8196b633cdd0494b
Parents: c3e5964
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Tue Nov 4 18:08:15 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Wed Nov 5 12:57:40 2014 +0530

----------------------------------------------------------------------
 test/integration/smoke/test_nic.py | 90 +++++++++++----------------------
 1 file changed, 30 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2cd4ad20/test/integration/smoke/test_nic.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py
index f130bbe..86faa56 100644
--- a/test/integration/smoke/test_nic.py
+++ b/test/integration/smoke/test_nic.py
@@ -24,6 +24,8 @@ from marvin.lib.base import (Account,
 from marvin.lib.common import (get_zone,
                                get_template,
                                get_domain)
+from marvin.lib.utils import validateList
+from marvin.codes import PASS
 from nose.plugins.attrib import attr
 
 import signal
@@ -149,7 +151,6 @@ class TestNic(cloudstackTestCase):
 
         hypervisorIsVmware = False
         isVmwareToolInstalled = False
-        assertForExceptionForNicOperations = False
         if self.hypervisor.lower() == "vmware":
             hypervisorIsVmware = True
 
@@ -163,59 +164,18 @@ class TestNic(cloudstackTestCase):
             mode=self.zone.networktype if hypervisorIsVmware else "default"
         )
 
-        # If hypervisor is Vmware, then check if
-        # the vmware tools are installed and the process is running
-        # Vmware tools are necessary for add and remove nic operations
-        if hypervisorIsVmware:
-            sshClient = self.virtual_machine.get_ssh_client()
-            result = str(
-                sshClient.execute("service vmware-tools status")).lower()
-            self.debug("and result is: %s" % result)
-            if "running" in result:
-                isVmwareToolInstalled = True
-
-        # If Vmware tools are not installed in case of vmware hypervisor
-        # then check for exception while performing add and remove nic
-        # operations
-        if hypervisorIsVmware and not isVmwareToolInstalled:
-            assertForExceptionForNicOperations = True
-
         self.cleanup.insert(0, self.virtual_machine)
-        list_vm_response = VirtualMachine.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_vm_response, list),
-            True,
-            "Check list response returns a valid list"
-        )
-
-        self.assertNotEqual(
-            len(list_vm_response),
-            0,
-            "Check VM available in List Virtual Machines"
-        )
-        vm_response = list_vm_response[0]
-
         self.assertEqual(
+                validateList(vms)[0],
+                PASS,
+                "vms list validation failed")
 
-            vm_response.id,
-            self.virtual_machine.id,
-            "Check virtual machine id in listVirtualMachines"
-        )
-
-        self.assertEqual(
-            vm_response.name,
-            self.virtual_machine.name,
-            "Check virtual machine name in listVirtualMachines"
-        )
+        vm_response = vms[0]
 
         self.assertEqual(
             len(vm_response.nic),
@@ -231,30 +191,40 @@ class TestNic(cloudstackTestCase):
         existing_nic_ip = vm_response.nic[0].ipaddress
         existing_nic_id = vm_response.nic[0].id
 
-        if assertForExceptionForNicOperations:
-            with self.assertRaises(Exception):
-                self.virtual_machine.add_nic(
+        self.virtual_machine.add_nic(
                     self.apiclient,
                     self.test_network2.id)
-
-        else:
-            # 1. add a nic
-            self.virtual_machine.add_nic(self.apiclient, self.test_network2.id)
-
-            time.sleep(5)
-            # now go get the vm list?
-
-            list_vm_response = VirtualMachine.list(
+        list_vm_response = VirtualMachine.list(
                 self.apiclient,
                 id=self.virtual_machine.id
             )
 
-            self.assertEqual(
+        self.assertEqual(
                 len(list_vm_response[0].nic),
                 2,
                 "Verify we have 2 NIC's now"
             )
 
+        # If hypervisor is Vmware, then check if
+        # the vmware tools are installed and the process is running
+        # Vmware tools are necessary for remove nic operations (vmware 5.5+)
+        if hypervisorIsVmware:
+            sshClient = self.virtual_machine.get_ssh_client()
+            result = str(
+                sshClient.execute("service vmware-tools status")).lower()
+            self.debug("and result is: %s" % result)
+            if "running" in result:
+                isVmwareToolInstalled = True
+
+        goForUnplugOperation = True
+        # If Vmware tools are not installed in case of vmware hypervisor
+        # then don't go further for unplug operation (remove nic) as it won't
+        # be supported
+        if hypervisorIsVmware and not isVmwareToolInstalled:
+            goForUnplugOperation = False
+
+
+        if goForUnplugOperation:
             new_nic_id = ""
             for nc in list_vm_response[0].nic:
                 if nc.ipaddress != existing_nic_ip:


[25/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7821: Fix OSX cannot connect to VPN due to wrongly declaim ENCAPSULATION_MODE_UDP_TRANSPORT_RFC

OSX always declaims it's behind NAT no matter it's true or not, thus result in
confusion of openswan.

Add parameter "forceencaps=yes" to openswan to make sure non NAT VPN connection
from OSX can pass through.


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

Branch: refs/heads/master
Commit: e1c788ca3c69a8c8c2041c7b106f76fa49332888
Parents: c30d4ed
Author: Sheng Yang <sh...@citrix.com>
Authored: Thu Oct 30 17:23:34 2014 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Thu Oct 30 17:24:57 2014 -0700

----------------------------------------------------------------------
 systemvm/patches/debian/vpn/etc/ipsec.d/l2tp.conf | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e1c788ca/systemvm/patches/debian/vpn/etc/ipsec.d/l2tp.conf
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/vpn/etc/ipsec.d/l2tp.conf b/systemvm/patches/debian/vpn/etc/ipsec.d/l2tp.conf
index 7459e25..1cdd69d 100644
--- a/systemvm/patches/debian/vpn/etc/ipsec.d/l2tp.conf
+++ b/systemvm/patches/debian/vpn/etc/ipsec.d/l2tp.conf
@@ -30,4 +30,5 @@ conn L2TP-PSK
         # ----------------------------------------------------------
         # Change 'ignore' to 'add' to enable this configuration.
         #
+        forceencaps=yes
         auto=add


[10/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7805: test_vpc_vms_deployment.py - Removing invalid steps from test case

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: a4174d3e91fd4b090de2f9d1688a862fe46f99e5
Parents: e87da18
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Tue Oct 28 14:38:05 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 15:01:31 2014 +0530

----------------------------------------------------------------------
 .../component/test_vpc_vms_deployment.py        | 20 --------------------
 1 file changed, 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4174d3e/test/integration/component/test_vpc_vms_deployment.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_vms_deployment.py b/test/integration/component/test_vpc_vms_deployment.py
index 54586d0..e61b2f8 100644
--- a/test/integration/component/test_vpc_vms_deployment.py
+++ b/test/integration/component/test_vpc_vms_deployment.py
@@ -2087,26 +2087,6 @@ class TestVMDeployVPC(cloudstackTestCase):
             self.fail("Failed to enable static NAT on IP: %s - %s" % (
                                         public_ip_4.ipaddress.ipaddress, e))
 
-        public_ips = PublicIPAddress.list(
-                                    self.apiclient,
-                                    networkid=network_2.id,
-                                    listall=True,
-                                    isstaticnat=True,
-                                    account=self.account.name,
-                                    domainid=self.account.domainid
-                                  )
-        self.assertEqual(
-                         isinstance(public_ips, list),
-                         True,
-                         "List public Ip for network should list the Ip addr"
-                         )
-        self.assertEqual(
-                         public_ips[0].ipaddress,
-                         public_ip_4.ipaddress.ipaddress,
-                         "List public Ips %s for network should list the Ip addr %s"
-                         % (public_ips[0].ipaddress, public_ip_4.ipaddress.ipaddress)
-                         )
-
         self.debug("Adding NetwrokACl rules to make NAT rule accessible with network %s" % network_1.id)
         NetworkACL.create(
                                          self.apiclient,


[36/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
systemvm: Prefer TLS over SSL in apache, POODLE workaround (CVE­2014­3566)

Just prefer TLS over SSL in apache configuration in systemvm

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
(cherry picked from commit 88acc9bd53cbf6f8896d32576f916c20704a3403)
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/master
Commit: 84e44a4dba5fdab33ed76d787f84705366e4e670
Parents: 07ba078
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Tue Nov 4 01:43:55 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Nov 4 01:50:06 2014 +0530

----------------------------------------------------------------------
 systemvm/patches/debian/config/etc/apache2/httpd.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/84e44a4d/systemvm/patches/debian/config/etc/apache2/httpd.conf
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/etc/apache2/httpd.conf b/systemvm/patches/debian/config/etc/apache2/httpd.conf
index 0565a8c..2a6b921 100644
--- a/systemvm/patches/debian/config/etc/apache2/httpd.conf
+++ b/systemvm/patches/debian/config/etc/apache2/httpd.conf
@@ -1,2 +1,2 @@
-SSLProtocol -ALL +SSLv3 +TLSv1
+SSLProtocol +TLSv1 +TLSv1.1 +TLSv1.2
 SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM


[37/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-3608 removing duplicate entries, IDs not saved anywhere else hence safe to remove


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

Branch: refs/heads/master
Commit: ddfd74dba1d3f458c98c5074c79b2ab0199da682
Parents: 84e44a4
Author: amoghvk <am...@citrix.com>
Authored: Mon Nov 3 15:28:11 2014 -0800
Committer: amoghvk <am...@citrix.com>
Committed: Mon Nov 3 15:28:11 2014 -0800

----------------------------------------------------------------------
 setup/db/db/schema-441to450.sql | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ddfd74db/setup/db/db/schema-441to450.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-441to450.sql b/setup/db/db/schema-441to450.sql
index c899289..5caaa9f 100644
--- a/setup/db/db/schema-441to450.sql
+++ b/setup/db/db/schema-441to450.sql
@@ -749,3 +749,5 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervis
 
 INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit, storage_motion_supported) VALUES (UUID(), 'XenServer', '6.5.0', 500, 1, 13, 1);
 
+--Remove duplicates from guest_os_hypervisor table
+DELETE t1 FROM guest_os_hypervisor t1, guest_os_hypervisor t2 WHERE (t1.hypervisor_type = t2.hypervisor_type AND t1.hypervisor_version = t2.hypervisor_version AND t1.guest_os_id = t2.guest_os_id AND t1.id > t2.id AND t1.is_user_defined=0);


[22/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
saml: Use camelCase api names for SAML login/logout apis

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
(cherry picked from commit 85c0bd68ae8a76c231ab402dd0311e3672155f71)
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/master
Commit: cd52bed47759da13441b2f2a92c782907c2533dc
Parents: b701061
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Thu Oct 30 23:15:05 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Oct 31 00:32:29 2014 +0530

----------------------------------------------------------------------
 client/tomcatconf/commands.properties.in                         | 4 ++--
 .../cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java    | 2 +-
 .../cloudstack/api/command/SAML2LogoutAPIAuthenticatorCmd.java   | 2 +-
 server/src/com/cloud/configuration/Config.java                   | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd52bed4/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index 09b7ddc..ce84e69 100644
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -23,8 +23,8 @@ login=15
 logout=15
 
 ### SAML SSO/SLO commands
-samlsso=15
-samlslo=15
+samlSso=15
+samlSlo=15
 getSPMetadata=15
 
 ### Account commands

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd52bed4/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
index 0f316a8..c838ece 100644
--- a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
+++ b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
@@ -73,7 +73,7 @@ import java.security.PrivateKey;
 import java.util.List;
 import java.util.Map;
 
-@APICommand(name = "samlsso", description = "SP initiated SAML Single Sign On", requestHasSensitiveInfo = true, responseObject = LoginCmdResponse.class, entityType = {})
+@APICommand(name = "samlSso", description = "SP initiated SAML Single Sign On", requestHasSensitiveInfo = true, responseObject = LoginCmdResponse.class, entityType = {})
 public class SAML2LoginAPIAuthenticatorCmd extends BaseCmd implements APIAuthenticator {
     public static final Logger s_logger = Logger.getLogger(SAML2LoginAPIAuthenticatorCmd.class.getName());
     private static final String s_name = "loginresponse";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd52bed4/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LogoutAPIAuthenticatorCmd.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LogoutAPIAuthenticatorCmd.java b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LogoutAPIAuthenticatorCmd.java
index cdc24e0..7b1c367 100644
--- a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LogoutAPIAuthenticatorCmd.java
+++ b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LogoutAPIAuthenticatorCmd.java
@@ -51,7 +51,7 @@ import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
-@APICommand(name = "samlslo", description = "SAML Global Log Out API", responseObject = LogoutCmdResponse.class, entityType = {})
+@APICommand(name = "samlSlo", description = "SAML Global Log Out API", responseObject = LogoutCmdResponse.class, entityType = {})
 public class SAML2LogoutAPIAuthenticatorCmd extends BaseCmd implements APIAuthenticator {
     public static final Logger s_logger = Logger.getLogger(SAML2LogoutAPIAuthenticatorCmd.class.getName());
     private static final String s_name = "logoutresponse";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cd52bed4/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index 71f5c5b..517c76c 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -1423,7 +1423,7 @@ public enum Config {
             ManagementServer.class,
             String.class,
             "saml2.sp.sso.url",
-            "http://localhost:8080/client/api?command=samlsso",
+            "http://localhost:8080/client/api?command=samlSso",
             "SAML2 CloudStack Service Provider Single Sign On URL",
             null),
     SAMLServiceProviderSingleLogOutURL(
@@ -1431,7 +1431,7 @@ public enum Config {
             ManagementServer.class,
             String.class,
             "saml2.sp.slo.url",
-            "http://localhost:8080/client/api?command=samlslo",
+            "http://localhost:8080/client/api?command=samlSlo",
             "SAML2 CloudStack Service Provider Single Log Out URL",
             null),
     SAMLIdentityProviderID(


[18/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7728: Test script to identify product issue

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: aa1e26081208b5d6c758a6efbbf3b62ab2d6720d
Parents: 4f297ef
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Fri Oct 17 14:43:21 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 15:35:32 2014 +0530

----------------------------------------------------------------------
 test/integration/component/test_egress_fw_rules.py | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aa1e2608/test/integration/component/test_egress_fw_rules.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_egress_fw_rules.py b/test/integration/component/test_egress_fw_rules.py
index 12bade4..0122e4f 100755
--- a/test/integration/component/test_egress_fw_rules.py
+++ b/test/integration/component/test_egress_fw_rules.py
@@ -397,11 +397,18 @@ class TestEgressFWRules(cloudstackTestCase):
         # 2. login to VM.
         # 3. ping public network.
         # 4. public network should be reachable from the VM.
+        # 5. Reboot the router
+        # 6. Ping public network from VM, it should be reachable
         self.create_vm()
         self.exec_script_on_user_vm('ping -c 1 www.google.com',
                                     "| grep -oP \'\d+(?=% packet loss)\'",
                                     "['0']",
                                     negative_test=False)
+        self.reboot_Router()
+        self.exec_script_on_user_vm('ping -c 1 www.google.com',
+                                    "| grep -oP \'\d+(?=% packet loss)\'",
+                                    "['0']",
+                                    negative_test=False)
 
     @attr(tags=["advanced"], required_hardware="true")
     def test_01_1_egress_fr1(self):


[11/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7802: test_vpc_network.py - Increasing polling period for network state check

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: af510eb656eac08eb7f299ad970d49d9f3d96eb3
Parents: a4174d3
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Tue Oct 28 13:38:10 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 15:06:46 2014 +0530

----------------------------------------------------------------------
 test/integration/component/test_vpc_network.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/af510eb6/test/integration/component/test_vpc_network.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_network.py b/test/integration/component/test_vpc_network.py
index 096315c..f4c0a2f 100644
--- a/test/integration/component/test_vpc_network.py
+++ b/test/integration/component/test_vpc_network.py
@@ -1934,7 +1934,7 @@ class TestVPCNetworkUpgrade(cloudstackTestCase):
         # When all Vms ain network are stopped, network state changes from Implemented --> Shutdown --> Allocated
         # We can't update the network when it is in Shutodown state, hence we should wait for the state to change to
         # Allocated and then update the network
-        retriesCount = 10
+        retriesCount = 20
         while True:
             networks = list_networks(self.apiclient, id=network_1.id)
             self.assertEqual(validateList(networks)[0], PASS, "networks list validation failed, list id %s" % networks)


[03/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7809: UI > remove unnecessary cookie 'networktype'.


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

Branch: refs/heads/master
Commit: 492962520ec0fdf018b18e195efe7478133a3dab
Parents: 1ea6f7d
Author: Jessica Wang <je...@apache.org>
Authored: Tue Oct 28 15:29:39 2014 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Oct 28 15:29:39 2014 -0700

----------------------------------------------------------------------
 ui/scripts/cloudStack.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/49296252/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index 6b4e15a..0e63522 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -365,8 +365,7 @@
                         $.cookie('username', null);
                         $.cookie('account', null);
                         $.cookie('domainid', null);
-                        $.cookie('role', null);
-                        $.cookie('networktype', null);
+                        $.cookie('role', null);                        
                         $.cookie('timezoneoffset', null);
                         $.cookie('timezone', null);
                         


[14/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7682: Fixed usage event issue. Used api client of account for which we are checking the usage

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: b9fed951ef6498c828f07ab120a242fcf15e14f6
Parents: a1e7fee
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Wed Oct 8 11:25:15 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 15:28:39 2014 +0530

----------------------------------------------------------------------
 test/integration/component/test_usage.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b9fed951/test/integration/component/test_usage.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py
index 81cce48..58cfbed 100644
--- a/test/integration/component/test_usage.py
+++ b/test/integration/component/test_usage.py
@@ -669,6 +669,9 @@ class TestTemplateUsage(cloudstackTestCase):
                             domainid=cls.domain.id
                             )
             cls._cleanup.append(cls.account)
+            cls.userapiclient = cls.testClient.getUserApiClient(
+                                    UserName=cls.account.name,
+                                    DomainName=cls.account.domain)
             cls.services["account"] = cls.account.name
 
             cls.service_offering = ServiceOffering.create(
@@ -742,7 +745,7 @@ class TestTemplateUsage(cloudstackTestCase):
 
         #Create template from Virtual machine and Volume ID
         self.template = Template.create(
-                                self.apiclient,
+                                self.userapiclient,
                                 self.services["templates"],
                                 self.volume.id,
                                 TestTemplateUsage.account.name,
@@ -750,7 +753,7 @@ class TestTemplateUsage(cloudstackTestCase):
                                 )
         self.debug("Created template with ID: %s" % self.template.id)
         # Delete template
-        self.template.delete(self.apiclient)
+        self.template.delete(self.userapiclient)
         self.debug("Deleted template with ID: %s" % self.template.id)
 
         # Fetch account ID from account_uuid


[35/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7833: VM Async work jobs log "Was unable to find lock for the key vm_instance" errors as warning


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

Branch: refs/heads/master
Commit: 07ba078ee6f30b02dff6e1942e5f3da3121f4ea1
Parents: 6830cbc
Author: Min Chen <mi...@citrix.com>
Authored: Thu Oct 30 18:14:15 2014 -0700
Committer: Min Chen <mi...@citrix.com>
Committed: Mon Nov 3 11:19:06 2014 -0800

----------------------------------------------------------------------
 .../com/cloud/vm/VirtualMachineManagerImpl.java | 773 ++++++++-----------
 .../jobs/impl/AsyncJobManagerImpl.java          |  67 +-
 .../com/cloud/storage/VolumeApiServiceImpl.java | 247 ++----
 .../vm/snapshot/VMSnapshotManagerImpl.java      | 195 ++---
 4 files changed, 486 insertions(+), 796 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07ba078e/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index ec4aa1d..4b1597a 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -183,7 +183,6 @@ import com.cloud.utils.db.DB;
 import com.cloud.utils.db.EntityManager;
 import com.cloud.utils.db.GlobalLock;
 import com.cloud.utils.db.Transaction;
-import com.cloud.utils.db.TransactionCallback;
 import com.cloud.utils.db.TransactionCallbackWithException;
 import com.cloud.utils.db.TransactionCallbackWithExceptionNoReturn;
 import com.cloud.utils.db.TransactionLegacy;
@@ -3936,55 +3935,38 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
 
         final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                VmWorkJobVO workJob = null;
+        VmWorkJobVO workJob = null;
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(VirtualMachine.Type.Instance,
+                vm.getId(), VmWorkStart.class.getName());
 
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(VirtualMachine.Type.Instance,
-                            vm.getId(), VmWorkStart.class.getName());
-
-                    if (pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
-                        workJob = new VmWorkJobVO(context.getContextId());
-
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkStart.class.getName());
-
-                        workJob.setAccountId(callingAccount.getId());
-                        workJob.setUserId(callingUser.getId());
-                        workJob.setStep(VmWorkJobVO.Step.Starting);
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
-
-                        // save work context info (there are some duplications)
-                        VmWorkStart workInfo = new VmWorkStart(callingUser.getId(), callingAccount.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER);
-                        workInfo.setPlan(planToDeploy);
-                        if (planner != null) {
-                            workInfo.setDeploymentPlanner(planner.getName());
-                        }
-                        workInfo.setParams(params);
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        if (pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
+            workJob = new VmWorkJobVO(context.getContextId());
 
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkStart.class.getName());
 
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+            workJob.setAccountId(callingAccount.getId());
+            workJob.setUserId(callingUser.getId());
+            workJob.setStep(VmWorkJobVO.Step.Starting);
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+
+            // save work context info (there are some duplications)
+            VmWorkStart workInfo = new VmWorkStart(callingUser.getId(), callingAccount.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER);
+            workInfo.setPlan(planToDeploy);
+            workInfo.setParams(params);
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
+
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmStateSyncOutcome((VmWorkJobVO)result[0],
+        return new VmStateSyncOutcome(workJob,
                 VirtualMachine.PowerState.PowerOn, vm.getId(), null);
     }
 
@@ -3995,51 +3977,37 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
 
         final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                vm.getType(), vm.getId(),
+                VmWorkStop.class.getName());
 
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            vm.getType(), vm.getId(),
-                            VmWorkStop.class.getName());
-
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
-                        workJob = new VmWorkJobVO(context.getContextId());
-
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkStop.class.getName());
-
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setStep(VmWorkJobVO.Step.Prepare);
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
-
-                        // save work context info (there are some duplications)
-                        VmWorkStop workInfo = new VmWorkStop(user.getId(), account.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, cleanup);
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
-
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
+            workJob = new VmWorkJobVO(context.getContextId());
 
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkStop.class.getName());
+
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setStep(VmWorkJobVO.Step.Prepare);
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+
+            // save work context info (there are some duplications)
+            VmWorkStop workInfo = new VmWorkStop(user.getId(), account.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, cleanup);
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmStateSyncOutcome((VmWorkJobVO)result[0],
+        return new VmStateSyncOutcome(workJob,
                 VirtualMachine.PowerState.PowerOff, vm.getId(), null);
     }
 
@@ -4052,50 +4020,37 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
 
         final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            VirtualMachine.Type.Instance, vm.getId(),
-                            VmWorkReboot.class.getName());
-
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
-                        workJob = new VmWorkJobVO(context.getContextId());
-
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkReboot.class.getName());
-
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setStep(VmWorkJobVO.Step.Prepare);
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
-
-                        // save work context info (there are some duplications)
-                        VmWorkReboot workInfo = new VmWorkReboot(user.getId(), account.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, params);
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
-
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                VirtualMachine.Type.Instance, vm.getId(),
+                VmWorkReboot.class.getName());
 
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
+            workJob = new VmWorkJobVO(context.getContextId());
+
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkReboot.class.getName());
+
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setStep(VmWorkJobVO.Step.Prepare);
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+
+            // save work context info (there are some duplications)
+            VmWorkReboot workInfo = new VmWorkReboot(user.getId(), account.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, params);
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVirtualMachineOutcome((VmWorkJobVO)result[0],
+        return new VmJobVirtualMachineOutcome(workJob,
                 vm.getId());
     }
 
@@ -4106,50 +4061,37 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
 
         final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            VirtualMachine.Type.Instance, vm.getId(),
-                            VmWorkMigrate.class.getName());
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                VirtualMachine.Type.Instance, vm.getId(),
+                VmWorkMigrate.class.getName());
 
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
 
-                        workJob = new VmWorkJobVO(context.getContextId());
+            workJob = new VmWorkJobVO(context.getContextId());
 
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkMigrate.class.getName());
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkMigrate.class.getName());
 
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                        // save work context info (there are some duplications)
-                        VmWorkMigrate workInfo = new VmWorkMigrate(user.getId(), account.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, srcHostId, dest);
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+            // save work context info (there are some duplications)
+            VmWorkMigrate workInfo = new VmWorkMigrate(user.getId(), account.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, srcHostId, dest);
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmStateSyncOutcome((VmWorkJobVO)result[0],
+        return new VmStateSyncOutcome(workJob,
                 VirtualMachine.PowerState.PowerOn, vm.getId(), vm.getPowerHostId());
     }
 
@@ -4160,49 +4102,36 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
 
         final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            VirtualMachine.Type.Instance, vm.getId(),
-                            VmWorkMigrateAway.class.getName());
-
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
-                        workJob = new VmWorkJobVO(context.getContextId());
-
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkMigrateAway.class.getName());
-
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
-
-                        // save work context info (there are some duplications)
-                        VmWorkMigrateAway workInfo = new VmWorkMigrateAway(user.getId(), account.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, srcHostId);
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
-
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                VirtualMachine.Type.Instance, vm.getId(),
+                VmWorkMigrateAway.class.getName());
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
+            workJob = new VmWorkJobVO(context.getContextId());
 
-        return new VmStateSyncOutcome((VmWorkJobVO)result[0],
-                VirtualMachine.PowerState.PowerOn, vm.getId(), vm.getPowerHostId());
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkMigrateAway.class.getName());
+
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+
+            // save work context info (there are some duplications)
+            VmWorkMigrateAway workInfo = new VmWorkMigrateAway(user.getId(), account.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, srcHostId);
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        }
+
+        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
+
+        return new VmStateSyncOutcome(workJob, VirtualMachine.PowerState.PowerOn, vm.getId(), vm.getPowerHostId());
     }
 
     public Outcome<VirtualMachine> migrateVmWithStorageThroughJobQueue(
@@ -4215,51 +4144,37 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
 
         final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            VirtualMachine.Type.Instance, vm.getId(),
-                            VmWorkMigrateWithStorage.class.getName());
-
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                VirtualMachine.Type.Instance, vm.getId(),
+                VmWorkMigrateWithStorage.class.getName());
 
-                        workJob = new VmWorkJobVO(context.getContextId());
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
 
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkMigrate.class.getName());
+            workJob = new VmWorkJobVO(context.getContextId());
 
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkMigrate.class.getName());
 
-                        // save work context info (there are some duplications)
-                        VmWorkMigrateWithStorage workInfo = new VmWorkMigrateWithStorage(user.getId(), account.getId(), vm.getId(),
-                                VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, srcHostId, destHostId, volumeToPool);
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+            // save work context info (there are some duplications)
+            VmWorkMigrateWithStorage workInfo = new VmWorkMigrateWithStorage(user.getId(), account.getId(), vm.getId(),
+                    VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, srcHostId, destHostId, volumeToPool);
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmStateSyncOutcome((VmWorkJobVO)result[0],
+        return new VmStateSyncOutcome(workJob,
                 VirtualMachine.PowerState.PowerOn, vm.getId(), destHostId);
     }
 
@@ -4272,52 +4187,37 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
 
         final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            VirtualMachine.Type.Instance, vm.getId(),
-                            VmWorkMigrateForScale.class.getName());
-
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
-
-                        workJob = new VmWorkJobVO(context.getContextId());
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                VirtualMachine.Type.Instance, vm.getId(),
+                VmWorkMigrateForScale.class.getName());
 
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkMigrate.class.getName());
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
 
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+            workJob = new VmWorkJobVO(context.getContextId());
 
-                        // save work context info (there are some duplications)
-                        VmWorkMigrateForScale workInfo = new VmWorkMigrateForScale(user.getId(), account.getId(), vm.getId(),
-                                VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, srcHostId, dest, newSvcOfferingId);
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkMigrate.class.getName());
 
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+            // save work context info (there are some duplications)
+            VmWorkMigrateForScale workInfo = new VmWorkMigrateForScale(user.getId(), account.getId(), vm.getId(),
+                    VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, srcHostId, dest, newSvcOfferingId);
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVirtualMachineOutcome((VmWorkJobVO)result[0], vm.getId());
+        return new VmJobVirtualMachineOutcome(workJob, vm.getId());
     }
 
     public Outcome<VirtualMachine> migrateVmStorageThroughJobQueue(
@@ -4329,52 +4229,37 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
 
         final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            VirtualMachine.Type.Instance, vm.getId(),
-                            VmWorkStorageMigration.class.getName());
-
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
-
-                        workJob = new VmWorkJobVO(context.getContextId());
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                VirtualMachine.Type.Instance, vm.getId(),
+                VmWorkStorageMigration.class.getName());
 
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkStorageMigration.class.getName());
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
 
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+            workJob = new VmWorkJobVO(context.getContextId());
 
-                        // save work context info (there are some duplications)
-                        VmWorkStorageMigration workInfo = new VmWorkStorageMigration(user.getId(), account.getId(), vm.getId(),
-                                VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, destPool.getId());
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkStorageMigration.class.getName());
 
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+            // save work context info (there are some duplications)
+            VmWorkStorageMigration workInfo = new VmWorkStorageMigration(user.getId(), account.getId(), vm.getId(),
+                    VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, destPool.getId());
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVirtualMachineOutcome((VmWorkJobVO)result[0], vm.getId());
+        return new VmJobVirtualMachineOutcome(workJob, vm.getId());
     }
 
     public Outcome<VirtualMachine> addVmToNetworkThroughJobQueue(
@@ -4384,52 +4269,37 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
         final User user = context.getCallingUser();
         final Account account = context.getCallingAccount();
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            VirtualMachine.Type.Instance, vm.getId(),
-                            VmWorkAddVmToNetwork.class.getName());
-
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                VirtualMachine.Type.Instance, vm.getId(),
+                VmWorkAddVmToNetwork.class.getName());
 
-                        workJob = new VmWorkJobVO(context.getContextId());
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
 
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkAddVmToNetwork.class.getName());
+            workJob = new VmWorkJobVO(context.getContextId());
 
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkAddVmToNetwork.class.getName());
 
-                        // save work context info (there are some duplications)
-                        VmWorkAddVmToNetwork workInfo = new VmWorkAddVmToNetwork(user.getId(), account.getId(), vm.getId(),
-                                VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, network.getId(), requested);
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+            // save work context info (there are some duplications)
+            VmWorkAddVmToNetwork workInfo = new VmWorkAddVmToNetwork(user.getId(), account.getId(), vm.getId(),
+                    VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, network.getId(), requested);
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVirtualMachineOutcome((VmWorkJobVO)result[0], vm.getId());
+        return new VmJobVirtualMachineOutcome(workJob, vm.getId());
     }
 
     public Outcome<VirtualMachine> removeNicFromVmThroughJobQueue(
@@ -4439,51 +4309,37 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
         final User user = context.getCallingUser();
         final Account account = context.getCallingAccount();
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            VirtualMachine.Type.Instance, vm.getId(),
-                            VmWorkRemoveNicFromVm.class.getName());
-
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                VirtualMachine.Type.Instance, vm.getId(),
+                VmWorkRemoveNicFromVm.class.getName());
 
-                        workJob = new VmWorkJobVO(context.getContextId());
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
 
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkRemoveNicFromVm.class.getName());
+            workJob = new VmWorkJobVO(context.getContextId());
 
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkRemoveNicFromVm.class.getName());
 
-                        // save work context info (there are some duplications)
-                        VmWorkRemoveNicFromVm workInfo = new VmWorkRemoveNicFromVm(user.getId(), account.getId(), vm.getId(),
-                                VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, nic.getId());
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+            // save work context info (there are some duplications)
+            VmWorkRemoveNicFromVm workInfo = new VmWorkRemoveNicFromVm(user.getId(), account.getId(), vm.getId(),
+                    VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, nic.getId());
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVirtualMachineOutcome((VmWorkJobVO)result[0], vm.getId());
+        return new VmJobVirtualMachineOutcome(workJob, vm.getId());
     }
 
     public Outcome<VirtualMachine> removeVmFromNetworkThroughJobQueue(
@@ -4493,51 +4349,38 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
         final User user = context.getCallingUser();
         final Account account = context.getCallingAccount();
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            VirtualMachine.Type.Instance, vm.getId(),
-                            VmWorkRemoveVmFromNetwork.class.getName());
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                VirtualMachine.Type.Instance, vm.getId(),
+                VmWorkRemoveVmFromNetwork.class.getName());
 
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
 
-                        workJob = new VmWorkJobVO(context.getContextId());
+            workJob = new VmWorkJobVO(context.getContextId());
 
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkRemoveVmFromNetwork.class.getName());
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkRemoveVmFromNetwork.class.getName());
 
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                        // save work context info (there are some duplications)
-                        VmWorkRemoveVmFromNetwork workInfo = new VmWorkRemoveVmFromNetwork(user.getId(), account.getId(), vm.getId(),
-                                VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, network, broadcastUri);
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+            // save work context info (there are some duplications)
+            VmWorkRemoveVmFromNetwork workInfo = new VmWorkRemoveVmFromNetwork(user.getId(), account.getId(), vm.getId(),
+                    VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, network, broadcastUri);
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVirtualMachineOutcome((VmWorkJobVO)result[0], vm.getId());
+        return new VmJobVirtualMachineOutcome(workJob, vm.getId());
     }
 
     public Outcome<VirtualMachine> reconfigureVmThroughJobQueue(
@@ -4549,51 +4392,37 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
 
         final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-
-                _vmDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
-                            VirtualMachine.Type.Instance, vm.getId(),
-                            VmWorkReconfigure.class.getName());
-
-                    VmWorkJobVO workJob = null;
-                    if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
-                        assert (pendingWorkJobs.size() == 1);
-                        workJob = pendingWorkJobs.get(0);
-                    } else {
+        List<VmWorkJobVO> pendingWorkJobs = _workJobDao.listPendingWorkJobs(
+                VirtualMachine.Type.Instance, vm.getId(),
+                VmWorkReconfigure.class.getName());
 
-                        workJob = new VmWorkJobVO(context.getContextId());
+        VmWorkJobVO workJob = null;
+        if (pendingWorkJobs != null && pendingWorkJobs.size() > 0) {
+            assert (pendingWorkJobs.size() == 1);
+            workJob = pendingWorkJobs.get(0);
+        } else {
 
-                        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                        workJob.setCmd(VmWorkReconfigure.class.getName());
+            workJob = new VmWorkJobVO(context.getContextId());
 
-                        workJob.setAccountId(account.getId());
-                        workJob.setUserId(user.getId());
-                        workJob.setVmType(VirtualMachine.Type.Instance);
-                        workJob.setVmInstanceId(vm.getId());
-                        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+            workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+            workJob.setCmd(VmWorkReconfigure.class.getName());
 
-                        // save work context info (there are some duplications)
-                        VmWorkReconfigure workInfo = new VmWorkReconfigure(user.getId(), account.getId(), vm.getId(),
-                                VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, newServiceOffering.getId(), reconfiguringOnExistingHost);
-                        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+            workJob.setAccountId(account.getId());
+            workJob.setUserId(user.getId());
+            workJob.setVmType(VirtualMachine.Type.Instance);
+            workJob.setVmInstanceId(vm.getId());
+            workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
-                    }
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+            // save work context info (there are some duplications)
+            VmWorkReconfigure workInfo = new VmWorkReconfigure(user.getId(), account.getId(), vm.getId(),
+                    VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER, newServiceOffering.getId(), reconfiguringOnExistingHost);
+            workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+            _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        }
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVirtualMachineOutcome((VmWorkJobVO)result[0], vm.getId());
+        return new VmJobVirtualMachineOutcome(workJob, vm.getId());
     }
 
     @ReflectionUse

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07ba078e/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
index aab1683..548182a 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
@@ -79,6 +79,7 @@ import com.cloud.utils.db.TransactionStatus;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.exception.ExceptionUtil;
 import com.cloud.utils.mgmt.JmxUtil;
+import com.cloud.vm.dao.VMInstanceDao;
 
 public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, ClusterManagerListener, Configurable {
     // Advanced
@@ -86,6 +87,9 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
         "Time (in minutes) for async-jobs to be kept in system", true, ConfigKey.Scope.Global);
     private static final ConfigKey<Long> JobCancelThresholdMinutes = new ConfigKey<Long>("Advanced", Long.class, "job.cancel.threshold.minutes", "60",
         "Time (in minutes) for async-jobs to be forcely cancelled if it has been in process for long", true, ConfigKey.Scope.Global);
+    private static final ConfigKey<Integer> VmJobLockTimeout = new ConfigKey<Integer>("Advanced",
+            Integer.class, "vm.job.lock.timeout", "1800",
+            "Time in seconds to wait in acquiring lock to submit a vm worker job", false);
 
     private static final Logger s_logger = Logger.getLogger(AsyncJobManagerImpl.class);
 
@@ -111,6 +115,8 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
     private MessageBus _messageBus;
     @Inject
     private AsyncJobMonitor _jobMonitor;
+    @Inject
+    private VMInstanceDao _vmInstanceDao;
 
     private volatile long _executionRunNumber = 1;
 
@@ -125,7 +131,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
 
     @Override
     public ConfigKey<?>[] getConfigKeys() {
-        return new ConfigKey<?>[] {JobExpireMinutes, JobCancelThresholdMinutes};
+        return new ConfigKey<?>[] {JobExpireMinutes, JobCancelThresholdMinutes, VmJobLockTimeout};
     }
 
     @Override
@@ -185,18 +191,27 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             @SuppressWarnings("rawtypes")
             final GenericDao dao = GenericDaoBase.getDao(job.getClass());
 
-            return Transaction.execute(new TransactionCallback<Long>() {
-                @Override
-                public Long doInTransaction(TransactionStatus status) {
-                    job.setInitMsid(getMsid());
-                    dao.persist(job);
+            publishOnEventBus(job, "submit");
 
-                    publishOnEventBus(job, "submit");
-                    syncAsyncJobExecution(job, syncObjType, syncObjId, 1);
+            if (!_vmInstanceDao.lockInLockTable(String.valueOf(syncObjId), VmJobLockTimeout.value())){
+                throw new CloudRuntimeException("Failed to acquire lock in submitting async job: " + job.getCmd() + " with timeout value = " + VmJobLockTimeout.value());
+            }
 
-                    return job.getId();
-                }
-            });
+            try {
+                // lock is acquired
+                return Transaction.execute(new TransactionCallback<Long>() {
+                    @Override
+                    public Long doInTransaction(TransactionStatus status) {
+                        job.setInitMsid(getMsid());
+                        dao.persist(job);
+
+                        syncAsyncJobExecution(job, syncObjType, syncObjId, 1);
+                        return job.getId();
+                    }
+                });
+            } finally {
+                _vmInstanceDao.unlockFromLockTable(String.valueOf(syncObjId));
+            }
         } catch (Exception e) {
             String errMsg = "Unable to schedule async job for command " + job.getCmd() + ", unexpected exception.";
             s_logger.warn(errMsg, e);
@@ -239,13 +254,13 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
         publishOnEventBus(job, "complete"); // publish before the instance type and ID are wiped out
 
         if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Wake up jobs related to job- " + jobId);
+            s_logger.debug("Wake up jobs related to job-" + jobId);
         }
         List<Long> wakeupList = Transaction.execute(new TransactionCallback<List<Long>>() {
             @Override
             public List<Long> doInTransaction(TransactionStatus status) {
                 if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("Update db status for job- " + jobId);
+                    s_logger.debug("Update db status for job-" + jobId);
                 }
                 job.setCompleteMsid(getMsid());
                 job.setStatus(jobStatus);
@@ -262,15 +277,13 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
                 _jobDao.update(jobId, job);
 
                 if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("Wake up jobs joined with job- " + jobId + " and disjoin all subjobs created from job- " + jobId);
+                    s_logger.debug("Wake up jobs joined with job-" + jobId + " and disjoin all subjobs created from job- " + jobId);
                 }
                 List<Long> wakeupList = wakeupByJoinedJobCompletion(jobId);
                 _joinMapDao.disjoinAllJobs(jobId);
 
                 // purge the job sync item from queue
-                if (job.getSyncSource() != null) {
-                    _queueMgr.purgeItem(job.getSyncSource().getId());
-                }
+                _queueMgr.purgeAsyncJobQueueItemId(jobId);
 
                 return wakeupList;
             }
@@ -856,20 +869,16 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             final SearchCriteria<AsyncJobVO> jobsSC = JobIdsSearch.create("ids", ids);
             final SearchCriteria<SyncQueueItemVO> queueItemsSC = QueueJobIdsSearch.create("contentIds", ids);
 
-            Transaction.execute(new TransactionCallbackNoReturn() {
-                @Override
-                public void doInTransactionWithoutResult(TransactionStatus status) {
-                    AsyncJobVO job = _jobDao.createForUpdate();
-                    job.setPendingSignals(AsyncJob.Constants.SIGNAL_MASK_WAKEUP);
-                    _jobDao.update(job, jobsSC);
+            AsyncJobVO job = _jobDao.createForUpdate();
+            job.setPendingSignals(AsyncJob.Constants.SIGNAL_MASK_WAKEUP);
+            _jobDao.update(job, jobsSC);
 
-                    SyncQueueItemVO item = _queueItemDao.createForUpdate();
-                    item.setLastProcessNumber(null);
-                    item.setLastProcessMsid(null);
-                    _queueItemDao.update(item, queueItemsSC);
-                }
-            });
+            SyncQueueItemVO item = _queueItemDao.createForUpdate();
+            item.setLastProcessNumber(null);
+            item.setLastProcessMsid(null);
+            _queueItemDao.update(item, queueItemsSC);
         }
+
         return _joinMapDao.findJobsToWake(joinedJobId);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07ba078e/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 9f132c3..3184dca 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -2379,47 +2379,31 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
 
         final VMInstanceVO vm = _vmInstanceDao.findById(vmId);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                VmWorkJobVO workJob = null;
+        VmWorkJobVO workJob = new VmWorkJobVO(context.getContextId());
 
-                _vmInstanceDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    workJob = new VmWorkJobVO(context.getContextId());
+        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+        workJob.setCmd(VmWorkAttachVolume.class.getName());
 
-                    workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                    workJob.setCmd(VmWorkAttachVolume.class.getName());
+        workJob.setAccountId(callingAccount.getId());
+        workJob.setUserId(callingUser.getId());
+        workJob.setStep(VmWorkJobVO.Step.Starting);
+        workJob.setVmType(VirtualMachine.Type.Instance);
+        workJob.setVmInstanceId(vm.getId());
+        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                    workJob.setAccountId(callingAccount.getId());
-                    workJob.setUserId(callingUser.getId());
-                    workJob.setStep(VmWorkJobVO.Step.Starting);
-                    workJob.setVmType(VirtualMachine.Type.Instance);
-                    workJob.setVmInstanceId(vm.getId());
-                    workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+        // save work context info (there are some duplications)
+        VmWorkAttachVolume workInfo = new VmWorkAttachVolume(callingUser.getId(), callingAccount.getId(), vm.getId(),
+                VolumeApiServiceImpl.VM_WORK_JOB_HANDLER, volumeId, deviceId);
+        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                    // save work context info (there are some duplications)
-                    VmWorkAttachVolume workInfo = new VmWorkAttachVolume(callingUser.getId(), callingAccount.getId(), vm.getId(),
-                            VolumeApiServiceImpl.VM_WORK_JOB_HANDLER, volumeId, deviceId);
-                    workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
 
-                    _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        AsyncJobVO jobVo = _jobMgr.getAsyncJob(workJob.getId());
+        s_logger.debug("New job " + workJob.getId() + ", result field: " + jobVo.getResult());
 
-                    AsyncJobVO jobVo = _jobMgr.getAsyncJob(workJob.getId());
-                    s_logger.debug("New job " + workJob.getId() + ", result field: " + jobVo.getResult());
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmInstanceDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
-
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
-
-        return new VmJobVolumeOutcome((VmWorkJobVO)result[0],
-                volumeId);
+        return new VmJobVolumeOutcome(workJob, volumeId);
     }
 
     public Outcome<Volume> detachVolumeFromVmThroughJobQueue(final Long vmId, final Long volumeId) {
@@ -2430,44 +2414,28 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
 
         final VMInstanceVO vm = _vmInstanceDao.findById(vmId);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                VmWorkJobVO workJob = null;
-
-                _vmInstanceDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    workJob = new VmWorkJobVO(context.getContextId());
-
-                    workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                    workJob.setCmd(VmWorkDetachVolume.class.getName());
+        VmWorkJobVO workJob = new VmWorkJobVO(context.getContextId());
 
-                    workJob.setAccountId(callingAccount.getId());
-                    workJob.setUserId(callingUser.getId());
-                    workJob.setStep(VmWorkJobVO.Step.Starting);
-                    workJob.setVmType(VirtualMachine.Type.Instance);
-                    workJob.setVmInstanceId(vm.getId());
-                    workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+        workJob.setCmd(VmWorkDetachVolume.class.getName());
 
-                    // save work context info (there are some duplications)
-                    VmWorkDetachVolume workInfo = new VmWorkDetachVolume(callingUser.getId(), callingAccount.getId(), vm.getId(),
-                            VolumeApiServiceImpl.VM_WORK_JOB_HANDLER, volumeId);
-                    workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        workJob.setAccountId(callingAccount.getId());
+        workJob.setUserId(callingUser.getId());
+        workJob.setStep(VmWorkJobVO.Step.Starting);
+        workJob.setVmType(VirtualMachine.Type.Instance);
+        workJob.setVmInstanceId(vm.getId());
+        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                    _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        // save work context info (there are some duplications)
+        VmWorkDetachVolume workInfo = new VmWorkDetachVolume(callingUser.getId(), callingAccount.getId(), vm.getId(),
+                VolumeApiServiceImpl.VM_WORK_JOB_HANDLER, volumeId);
+        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmInstanceDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVolumeOutcome((VmWorkJobVO)result[0],
-                volumeId);
+        return new VmJobVolumeOutcome(workJob, volumeId);
     }
 
     public Outcome<Volume> resizeVolumeThroughJobQueue(final Long vmId, final long volumeId,
@@ -2479,45 +2447,28 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
 
         final VMInstanceVO vm = _vmInstanceDao.findById(vmId);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                VmWorkJobVO workJob = null;
-
-                _vmInstanceDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-
-                try {
-                    workJob = new VmWorkJobVO(context.getContextId());
-
-                    workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                    workJob.setCmd(VmWorkResizeVolume.class.getName());
+        VmWorkJobVO workJob = new VmWorkJobVO(context.getContextId());
 
-                    workJob.setAccountId(callingAccount.getId());
-                    workJob.setUserId(callingUser.getId());
-                    workJob.setStep(VmWorkJobVO.Step.Starting);
-                    workJob.setVmType(VirtualMachine.Type.Instance);
-                    workJob.setVmInstanceId(vm.getId());
-                    workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+        workJob.setCmd(VmWorkResizeVolume.class.getName());
 
-                    // save work context info (there are some duplications)
-                    VmWorkResizeVolume workInfo = new VmWorkResizeVolume(callingUser.getId(), callingAccount.getId(), vm.getId(),
-                            VolumeApiServiceImpl.VM_WORK_JOB_HANDLER, volumeId, currentSize, newSize, newMinIops, newMaxIops, newServiceOfferingId, shrinkOk);
-                    workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        workJob.setAccountId(callingAccount.getId());
+        workJob.setUserId(callingUser.getId());
+        workJob.setStep(VmWorkJobVO.Step.Starting);
+        workJob.setVmType(VirtualMachine.Type.Instance);
+        workJob.setVmInstanceId(vm.getId());
+        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                    _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        // save work context info (there are some duplications)
+        VmWorkResizeVolume workInfo = new VmWorkResizeVolume(callingUser.getId(), callingAccount.getId(), vm.getId(),
+                VolumeApiServiceImpl.VM_WORK_JOB_HANDLER, volumeId, currentSize, newSize, newMinIops, newMaxIops, newServiceOfferingId, shrinkOk);
+        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmInstanceDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVolumeOutcome((VmWorkJobVO)result[0],
-                volumeId);
+        return new VmJobVolumeOutcome(workJob,volumeId);
     }
 
     public Outcome<Volume> migrateVolumeThroughJobQueue(final Long vmId, final long volumeId,
@@ -2529,44 +2480,28 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
 
         final VMInstanceVO vm = _vmInstanceDao.findById(vmId);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                VmWorkJobVO workJob = null;
+        VmWorkJobVO workJob = new VmWorkJobVO(context.getContextId());
 
-                _vmInstanceDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    workJob = new VmWorkJobVO(context.getContextId());
+        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+        workJob.setCmd(VmWorkMigrateVolume.class.getName());
 
-                    workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                    workJob.setCmd(VmWorkMigrateVolume.class.getName());
+        workJob.setAccountId(callingAccount.getId());
+        workJob.setUserId(callingUser.getId());
+        workJob.setStep(VmWorkJobVO.Step.Starting);
+        workJob.setVmType(VirtualMachine.Type.Instance);
+        workJob.setVmInstanceId(vm.getId());
+        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                    workJob.setAccountId(callingAccount.getId());
-                    workJob.setUserId(callingUser.getId());
-                    workJob.setStep(VmWorkJobVO.Step.Starting);
-                    workJob.setVmType(VirtualMachine.Type.Instance);
-                    workJob.setVmInstanceId(vm.getId());
-                    workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+        // save work context info (there are some duplications)
+        VmWorkMigrateVolume workInfo = new VmWorkMigrateVolume(callingUser.getId(), callingAccount.getId(), vm.getId(),
+                VolumeApiServiceImpl.VM_WORK_JOB_HANDLER, volumeId, destPoolId, liveMigrate);
+        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                    // save work context info (there are some duplications)
-                    VmWorkMigrateVolume workInfo = new VmWorkMigrateVolume(callingUser.getId(), callingAccount.getId(), vm.getId(),
-                            VolumeApiServiceImpl.VM_WORK_JOB_HANDLER, volumeId, destPoolId, liveMigrate);
-                    workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
 
-                    _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmInstanceDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
-
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
-
-        return new VmJobVolumeOutcome((VmWorkJobVO)result[0],
-                volumeId);
+        return new VmJobVolumeOutcome(workJob,volumeId);
     }
 
     public Outcome<Snapshot> takeVolumeSnapshotThroughJobQueue(final Long vmId, final Long volumeId,
@@ -2578,45 +2513,29 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
 
         final VMInstanceVO vm = _vmInstanceDao.findById(vmId);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                VmWorkJobVO workJob = null;
-
-                _vmInstanceDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                    workJob = new VmWorkJobVO(context.getContextId());
-
-                    workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                    workJob.setCmd(VmWorkTakeVolumeSnapshot.class.getName());
+        VmWorkJobVO workJob = new VmWorkJobVO(context.getContextId());
 
-                    workJob.setAccountId(callingAccount.getId());
-                    workJob.setUserId(callingUser.getId());
-                    workJob.setStep(VmWorkJobVO.Step.Starting);
-                    workJob.setVmType(VirtualMachine.Type.Instance);
-                    workJob.setVmInstanceId(vm.getId());
-                    workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
+        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+        workJob.setCmd(VmWorkTakeVolumeSnapshot.class.getName());
 
-                    // save work context info (there are some duplications)
-                    VmWorkTakeVolumeSnapshot workInfo = new VmWorkTakeVolumeSnapshot(
-                            callingUser.getId(), accountId != null ? accountId : callingAccount.getId(), vm.getId(),
-                                    VolumeApiServiceImpl.VM_WORK_JOB_HANDLER, volumeId, policyId, snapshotId, quiesceVm);
-                    workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        workJob.setAccountId(callingAccount.getId());
+        workJob.setUserId(callingUser.getId());
+        workJob.setStep(VmWorkJobVO.Step.Starting);
+        workJob.setVmType(VirtualMachine.Type.Instance);
+        workJob.setVmInstanceId(vm.getId());
+        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                    _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        // save work context info (there are some duplications)
+        VmWorkTakeVolumeSnapshot workInfo = new VmWorkTakeVolumeSnapshot(
+                callingUser.getId(), accountId != null ? accountId : callingAccount.getId(), vm.getId(),
+                VolumeApiServiceImpl.VM_WORK_JOB_HANDLER, volumeId, policyId, snapshotId, quiesceVm);
+        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                    return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmInstanceDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobSnapshotOutcome((VmWorkJobVO)result[0],
-                snapshotId);
+        return new VmJobSnapshotOutcome(workJob,snapshotId);
     }
 
     @ReflectionUse


[27/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7822: updated ssl cert(exp:2096), reactivate tests


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

Branch: refs/heads/master
Commit: 5b1cbc442abd381879d70847047f91a5892808bc
Parents: e463d6d
Author: pdion891 <pd...@apache.org>
Authored: Fri Oct 31 16:42:31 2014 -0400
Committer: pdion891 <pd...@apache.org>
Committed: Fri Oct 31 16:43:57 2014 -0400

----------------------------------------------------------------------
 .../cloudstack/network/lb/CertServiceTest.java  | 16 +++----
 server/test/resources/certs/rsa_ca_signed.crt   | 36 +++++++++-------
 server/test/resources/certs/rsa_ca_signed.key   | 45 +++++++++++++-------
 server/test/resources/certs/rsa_self_signed.crt | 33 +++++++-------
 server/test/resources/certs/rsa_self_signed.key | 38 +++++++++++------
 .../certs/rsa_self_signed_with_pwd.crt          | 33 +++++++-------
 .../certs/rsa_self_signed_with_pwd.key          | 41 ++++++++++++------
 7 files changed, 148 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b1cbc44/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java
----------------------------------------------------------------------
diff --git a/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java b/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java
index 1292ce1..276bf8f 100755
--- a/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java
+++ b/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java
@@ -242,7 +242,7 @@ public class CertServiceTest {
         certService.uploadSslCert(uploadCmd);
     }
 
-    /*
+
     @Test
     public void runUploadSslCertBadChain() throws IOException, IllegalAccessException, NoSuchFieldException {
         Assume.assumeTrue(isOpenJdk() || isJCEInstalled());
@@ -297,9 +297,9 @@ public class CertServiceTest {
             assertTrue(e.getMessage().contains("Invalid certificate chain"));
         }
     }
-    */
 
-    /*
+
+
     @Test
     public void runUploadSslCertNoRootCert() throws IOException, IllegalAccessException, NoSuchFieldException {
 
@@ -356,9 +356,9 @@ public class CertServiceTest {
         }
 
     }
-    */
 
-    /*
+
+
     @Test
     public void runUploadSslCertNoChain() throws IOException, IllegalAccessException, NoSuchFieldException {
 
@@ -409,9 +409,9 @@ public class CertServiceTest {
         }
 
     }
-    */
 
-    /*
+
+
     @Test
     public void runUploadSslCertBadPassword() throws IOException, IllegalAccessException, NoSuchFieldException {
 
@@ -460,7 +460,7 @@ public class CertServiceTest {
         }
 
     }
-    */
+
 
     @Test
     public void runUploadSslCertBadkeyPair() throws IOException, IllegalAccessException, NoSuchFieldException {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b1cbc44/server/test/resources/certs/rsa_ca_signed.crt
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_ca_signed.crt b/server/test/resources/certs/rsa_ca_signed.crt
index 0b540aa..fb74f17 100644
--- a/server/test/resources/certs/rsa_ca_signed.crt
+++ b/server/test/resources/certs/rsa_ca_signed.crt
@@ -1,17 +1,23 @@
 -----BEGIN CERTIFICATE-----
-MIICszCCAhwCCQCaE4goZabzDTANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMC
-VVMxCzAJBgNVBAgMAkNBMREwDwYDVQQHDAhTYW4gSm9zZTETMBEGA1UECgwKQ2xv
-dWRTdGFjazETMBEGA1UECwwKQ2xvdWRTdGFjazEeMBwGA1UEAwwVY2xvdWRzdGFj
-ay5hcGFjaGUub3JnMSQwIgYJKoZIhvcNAQkBFhVjbG91ZHN0YWNrQGFwYWNoZS5v
-cmcwHhcNMTQxMDIxMjI0MjA4WhcNMTUxMDIxMjI0MjA4WjCBnTELMAkGA1UEBhMC
-VVMxCzAJBgNVBAgMAkNBMREwDwYDVQQHDAhTYW4gSm9zZTETMBEGA1UECgwKQ2xv
-dWRTdGFjazETMBEGA1UECwwKQ2xvdWRTdGFjazEeMBwGA1UEAwwVY2xvdWRzdGFj
-ay5hcGFjaGUub3JnMSQwIgYJKoZIhvcNAQkBFhVjbG91ZHN0YWNrQGFwYWNoZS5v
-cmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANrW6mzOmvTipZiL6N0Lz+T+
-W1qM7iN0k9mOC9fq/U3pN1kIvI8yDF/6eJHQDmr0Hx/GJg4TNZ761kJcB/kCu7zA
-8uILGqh2M3+qhp5zqgPfN7MAxJ65dZPdg+r1mxogHxZUcMTDcEvNKDd73xJDZK47
-iPBie/4RRPQTJS3jbWhJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAoBURaXgxobxj
-4YEU0IHo/G1UwPhPAKahiDjQH7HxUFJoLEDGUXlP6L8Z7fN22CeX2gQoeAA3w6I2
-Oyb78wBnI3Kwlhr486NGZuxg2DSSfgK2EirIqswMa+P1/XxrArrfr/Ty4qiMEKhg
-ut+HM3oPPMVyU0Tlk/vgwgER5WD/9d0=
+MIID1TCCAr2gAwIBAgIJALXV1B5/vewhMA0GCSqGSIb3DQEBBQUAMGUxCzAJBgNV
+BAYTAkFVMQ0wCwYDVQQIDARTb21lMQwwCgYDVQQKDANPcmcxDDAKBgNVBAsMA0Rl
+djENMAsGA1UEAwwETmFtZTEcMBoGCSqGSIb3DQEJARYNdGVzdEBtYWlsLmNvbTAe
+Fw0xMzEwMjExNjE4MjJaFw0xNDEwMjExNjE4MjJaMHIxCzAJBgNVBAYTAkFVMRMw
+EQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0
+eSBMdGQxDTALBgNVBAMMBFN5ZWQxHDAaBgkqhkiG9w0BCQEWDXN5ZWRAdGVzdC5j
+b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpkHkV6ZHhkYc3Y92i
+YllHGbSnXIzwnbaYcfIB5NRldbxyts2Hp8HttxG0rH5DgEMdqfOowqYITe2/hAop
+ZqLuAuwEj0tlPJ/hoVnZeHlCuBps+/nWkanA0DgkwiVksm7UoWM736dkmhLf03FI
+A0/pOsUYranCJAGO26BmNQnocjuoWHZRZINKFNVwgNLrCGkhIu4Dk4o6Rnto0oew
+kwUUVogpUJ6hPFU+8eIV0BAxertuiv6bQC/dG4MhVLl9nRB+XSnf+UAMgH3ay1em
+t8CL4pAlBmctt08LcaLeJBVWH0tsdx/QUuo/5iL61I/eQi4thLureM+bhzDq3/JN
+DYzfAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wg
+R2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBR2LIRfVveDgQB3dC7TOYhX
+BEv71DAfBgNVHSMEGDAWgBSMUs4ge7LDahb4VdjEn9RmLxh0GDANBgkqhkiG9w0B
+AQUFAAOCAQEAPjN/sdLcPfMh5ep29vp/7JTh6dUYnBNATYaXxx8j2XdnMCKeRfgP
+WOJur8HDPSayWWKKlztiQbJV5jDS5vyuMWI1a5/KIAQlOJep+anpR1QnQaX4/M4Z
+YUJo1fPs6tg47dXRpZZaJ+Hqwh0ZftCQoUq/sBxawXf6sbxsjoUmzxQLBqzYo1LJ
+jwxBs6C9aM8LDHFz4TVlyclSFQXiLMosj1jLBQ+TqzCxS6qOfJeMM9STXI9W3F2k
+duXeceqOwEkh8aeSUIztYFpX34d4SA4DDX5GUEaOeOR/abnXjH52vE6tM/m7NOve
+5+I/BrlT3heRqiD6Z2ofSsFhG86YeF9Q3w==
 -----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b1cbc44/server/test/resources/certs/rsa_ca_signed.key
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_ca_signed.key b/server/test/resources/certs/rsa_ca_signed.key
index ece40e4..d30dd8e 100644
--- a/server/test/resources/certs/rsa_ca_signed.key
+++ b/server/test/resources/certs/rsa_ca_signed.key
@@ -1,15 +1,30 @@
------BEGIN RSA PRIVATE KEY-----
-MIICWwIBAAKBgQDa1upszpr04qWYi+jdC8/k/ltajO4jdJPZjgvX6v1N6TdZCLyP
-Mgxf+niR0A5q9B8fxiYOEzWe+tZCXAf5Aru8wPLiCxqodjN/qoaec6oD3zezAMSe
-uXWT3YPq9ZsaIB8WVHDEw3BLzSg3e98SQ2SuO4jwYnv+EUT0EyUt421oSQIDAQAB
-AoGAEYwgGf9rD23JB3VYg7j5v4vhuV4JjlA/trccHgEatI+Zv4riy7ygn2WPG2oK
-besLP9n8nS5PI2NLoOCORxpAAVmUQFZvUKE76ElJN9KtNNzY/Xoch54RJ1fCoqL/
-ERMpYDXmVONWSUTRio+SPu3gYDCOZX4wBWV+G6wHRa4m0V0CQQD7d/BvlE37T4kP
-5U3r8LpD05PxqvK18zq4D5oV7DFm3trog+uyScG+oHVNmZTCzujIxhlA7PrpClyv
-MuWBm6f7AkEA3sh0Rx4l1y4htTRIsS3i3QSfhE85Nf1VvYuVJGL1R/ckBlOyWrPV
-XadOxKpnho/sFT9a1FHMFWZtZBhkeGYpiwJAGURW4086eqrmMbOvnaplfNUwg1LS
-6ldTKhVfPR6rZBO2WTCQKSziC75hqvdojB5wI2RMO0rUdz/0SiJKDzjNqwJAauf0
-bIA6FmVLxaG+VE+5sufaCGrgAFl+QIPv4NMf8xXUkritOLtdYyC7OsKvBTKhTpzl
-YEeUUJyjV8ogxGn5+wJAXbnTChiLrfgMOOOAP8acxFPWGfLC3Ae0CAm5CeVJRTSr
-4m6LNHbtqXeYTnr1WQ8A10yNPxyB0l3AaWJpBC3iew==
------END RSA PRIVATE KEY-----
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIN4x8YHLIb60CAggA
+MBQGCCqGSIb3DQMHBAiuWe+C2SitUgSCBMhVxMKivNaQh9SQedh2GQ8vlhI2/mKf
+r6zVUgODOdmFRj/PAlQu6B+VH8u2Ef5tr74O9UyZUQpC6oI0npvQOGqnhIxECR8D
+zepFlC0s+6kNRqfzXiMhGTsfbs3xUE1TZK1z5556OS4GlihIB0E5F7GdlulHELeA
+dnEItqDffWPQczTmSmFqtH7G/ksGQhSA2reBIDNgxWreBh9x9h2TftEvhhogdkr2
+XQpzxcby2v2z6Hut1lfVkLQNdvdHYdDG751NQltOmGvncXkTNJ+tSByXuY9ITtYz
+XqwY/vAEX+YYjCrWcvMmhU1t6B9cZ3viFzIIIltqtvDo3rybicpM3xvmnYnTF35j
+sGebcynzZedrLUHwD6/o0jBzFJN26QBxDGrlmn9E8HBhmjMCeSyZTXtSkwN0dAhu
+EHT2NgdC/4G4+JHsb3Oetl6AbUyYs2eWTRgr6bgBezbiDqKMj1QtGECkPQE9tFFP
+Jtma6lGJ1/u8zLFYNjigKZgXaNbtlMpslk+KDTGaTSbbVEaaxWSc0YlHz329ovQC
+1btrTE71FoNjRsTRaDRXC7BfrrMtnLhG2SmROKzyBtoxFymfEmASpdGERO+c2712
+Z0NLpHJL5ocsRr/onVi0auFC/nuaq6QqYF5OPtZhYh3+IDd193LP3xo8hnFjTq90
+9zV1QI2uHfTfijI4OABYSSZLxrl2IFF7Z/e4XkWSXrneR2Ne5GoYX7w6wshiuubQ
+bDPUHODsy7uQJ3ZEmmmd5xWvA3h3F5Yyls3WEuz8+jYR4iPKdjt8DJuz9j+7IP3C
+LoRa3KhxIPAzziQw+tMFVCozLLfS1kN8mg5SwU9Dp4HUPY/n3KnjVSjUJ347KAgW
++ykPlz4S1H0A2GyGWhdyX3J839UOdXfCsfKQQ1FLOBvhQgBNGzoRIgDrsZdrxgWa
+XtF+Ct2/2/O+503I6X90maXzhshmGw/NKsiNx7YOdUiu6w3N4LajIWE689UUU7Dr
+EtM8HcfmBnE/cZTbeWbQBfl1GqigMp+YOAY2sw0rZdF4ocmnqoCWLVN2j8O/re5g
+20y5eHkztPOZ+NNczo5PP96ng1XEMVzs/h6xDHzsak6osZb5b+Hs9kcYuqBEqr16
+3DVwaZ45dGwNN90Q9YmrgEdCqtCAU12w/YYVB/aB701Ijg0NhVsh7PgWaJIOJD56
+YTaiWIzQaZ/uM0KlgLz2eI9VXcuv24gUMAUMaI84mInnIrax1zFMrlCjEcR8Zxvk
+jCCY6Uq9WH30cUo7cMHWLWMzsl7PC7xpYSHPClqzCUluUgQwqoOs5Ux4nYl+JI7C
+ZfJ8BUMCD2RJtjvJhkE6LEkcrCjwnvappRaXbN54IVXpuMl2XYtp44T117QulEj1
+I/jk1mrpkXRKi9ZsKsjDH9VMy1hcKHn4CgTxmtRYN6LPA4tamxzVLxIi6YDU0142
+l1u763cT7cH14lvzUvEQMFbk/s0AUl8zeZAwjDayNlD/ljz7nZnJ3NToMlxeoK0a
+F6c/RgQBwxR8NMdo19Irv8stxo9WGB2/0Q8WCxW7ENHlBpvX5zXKRJMswFKp0ft6
+dT7hOBPgJlD7C1eX5jVcSz6kDRM6gQ7K/c5QcJa6qNAC2Jw6yBBYltqiRalFWX46
+VcM=
+-----END ENCRYPTED PRIVATE KEY-----

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b1cbc44/server/test/resources/certs/rsa_self_signed.crt
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_self_signed.crt b/server/test/resources/certs/rsa_self_signed.crt
index f0dbbb8..19003ef 100644
--- a/server/test/resources/certs/rsa_self_signed.crt
+++ b/server/test/resources/certs/rsa_self_signed.crt
@@ -1,17 +1,20 @@
 -----BEGIN CERTIFICATE-----
-MIICwTCCAioCCQCRL9B7rcgqFTANBgkqhkiG9w0BAQUFADCBpDELMAkGA1UEBhMC
-VVMxCzAJBgNVBAgMAkNBMREwDwYDVQQHDAhTYW4gSm9zZTEaMBgGA1UECgwRQXBh
-Y2hlIENsb3VkU3RhY2sxEzARBgNVBAsMCkNsb3VkU3RhY2sxHjAcBgNVBAMMFWNs
-b3Vkc3RhY2suYXBhY2hlLm9yZzEkMCIGCSqGSIb3DQEJARYVY2xvdWRzdGFja0Bh
-cGFjaGUub3JnMB4XDTE0MTAyMTIyMjc1OFoXDTI0MTAxODIyMjc1OFowgaQxCzAJ
-BgNVBAYTAlVTMQswCQYDVQQIDAJDQTERMA8GA1UEBwwIU2FuIEpvc2UxGjAYBgNV
-BAoMEUFwYWNoZSBDbG91ZFN0YWNrMRMwEQYDVQQLDApDbG91ZFN0YWNrMR4wHAYD
-VQQDDBVjbG91ZHN0YWNrLmFwYWNoZS5vcmcxJDAiBgkqhkiG9w0BCQEWFWNsb3Vk
-c3RhY2tAYXBhY2hlLm9yZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtZuL
-mow2ktFcV50aU4On6O5PxWzDWX4118nKJ/qCEjdxArZacSTpdbjBtQdq3DeWAbbD
-d5TdcL0qB0/dZSXmNWt5kEaEmOTm0Yy1HwbT+pKDn+r5KwtICvJogf2VTVpjGNyD
-bmvYE9mCdxmaqZIzGWMrr04ZZX+6AXAlKfYPaRsCAwEAATANBgkqhkiG9w0BAQUF
-AAOBgQBCKbaQ0puIQ7/WzlQCnt8r7z3FIhLJ/pyFL/lyAjr/+8TxEcxZvoNMKza6
-EFAYmHPumJdTQJVWWMOpeY3m3+rKKup+DcGVGmijTG1t7wPhok4JAWm561NUNNaI
-RQFyp9VuTWbgvN6pZCI6RsV9oXj8FnkDenXyX4qlUXXKVa74hw==
+MIIDNjCCAh4CCQD1aM8xUbgZDDANBgkqhkiG9w0BAQUFADBcMQswCQYDVQQGEwJB
+VTETMBEGA1UECAwKU29tZS1TdGF0ZTEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MSEw
+HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwIBcNMTQxMDMxMDE1NTM0
+WhgPMjA5NjEyMTkwMTU1MzRaMFwxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21l
+LVN0YXRlMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxITAfBgNVBAoMGEludGVybmV0
+IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
+AN6wEhbwZgBfgh5+fE1OYm9B7jA+IMbraIY80IyV2ERbNXJoi2/XrDtAr5NAxWkL
+qpaccOA4XupMUWzUCpDxa9M7L/QfCP6PFEJnJZ2dCPvosZQKuFcj+h9LHsK5nVW6
+1Zkh9HhtbdIS6l1JsV/119ZJGxzoGUEJPdEnsNt1cE1cW8sKvMo5GC2toZQV4d96
+17IpMuyRYhdEyRNq+sDQetAUDHYthBK7QVDy/9Sw+/lbgf2OsWacIrysDCF3hXc0
+qyNoBgp/s39NZDXx49GKwNmx9IuRV+P/WEqXfDxSDmHP4APtzDTtMTFnIW8+gH4z
+0GkeLRi7EQY48LyyGcB88lkCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAH5vm8XY+
+jp0Qw3I5jyMI7QYoCdSIY4FoxAMxmCXqOXsem06Yxx55IRgaQR3CTxKY6jOyfBnQ
+P0bLCX4MNaIKIEuLgYr5/g2sbmTWReCfqJRalU69znj6CUpKkIZ3rmxHJQF+BJjw
+A+Eut87o1WOR7quXJOo0cJUjNPRc7+Hjt9U+HWxC8K1jv+/dCv1EdhVGWTdLKWEk
+kApnfTOq66hVsD6FCQ+ohPgCv32wdMxmBSCctSRHE+Zf3GqJheQS+7AIF/y4VVmm
+eDjZGXmCQR9nb24JLkHO2g4ogP5X9nuyzwcOqiw+SITPArH3IadzMV4Kus5tsGUo
+zaPaMXXDmNj8Rw==
 -----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b1cbc44/server/test/resources/certs/rsa_self_signed.key
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_self_signed.key b/server/test/resources/certs/rsa_self_signed.key
index 043b865..14b95e6 100644
--- a/server/test/resources/certs/rsa_self_signed.key
+++ b/server/test/resources/certs/rsa_self_signed.key
@@ -1,15 +1,27 @@
 -----BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQC1m4uajDaS0VxXnRpTg6fo7k/FbMNZfjXXycon+oISN3ECtlpx
-JOl1uMG1B2rcN5YBtsN3lN1wvSoHT91lJeY1a3mQRoSY5ObRjLUfBtP6koOf6vkr
-C0gK8miB/ZVNWmMY3INua9gT2YJ3GZqpkjMZYyuvThllf7oBcCUp9g9pGwIDAQAB
-AoGAPyqiDRhV5w0xDDxVqtSxM4CoeGfTLq6Kdcr3KJ6mXUWxZhsdLBuFpG+l2JyC
-26Pt5hy2skIyH4N8OdzaidL71eSQSz8rmnh811EkM1+Xu6NnX81dLsFV8zGuZpMs
-qF/0lPggmg9o+mwXD5v8BBnmSV86Ki3LNCidgZFvOXhdLkkCQQDk1k2a4qt1JZ8J
-II6eNEwCKV13RrXnds83+q0pglosSjRmFNBll35MQxsPMG1FPRHisl7ayeppCeK7
-R8mDUWaPAkEAyyoS6bpTASRDmIfbSPPUZePJT6Wyx0rSAhWZ9nWU3tJGk2lkmkJQ
-yVNO7yPl05O8k8MMpBSTw56WR1XwBiK6tQJBAKRT2Eq/N0zahUfynzewalyrA7lh
-h8L9qHSUiMDkIIjpiJM9oyExFrsA/W984Rr1beCTIlaO5MwlEzJVrLmmPLUCQEs4
-q8IAK8VrcN+jxYwwQz7qZNnphtUFHdaJuvSmulT51Am2Zvo6fYDdKIegafK5a4Pm
-HuMNf1xZdli5N+J9r1UCQQCGyN8Cbggjms1hZoby4EFsEvFw+l7/B56Km51LUDKE
-8phRLBOy5X5ATT8QjrTGNAhw+T7OewkwK8CjVSltkk1x
+MIIEpAIBAAKCAQEA3rASFvBmAF+CHn58TU5ib0HuMD4gxutohjzQjJXYRFs1cmiL
+b9esO0Cvk0DFaQuqlpxw4Dhe6kxRbNQKkPFr0zsv9B8I/o8UQmclnZ0I++ixlAq4
+VyP6H0sewrmdVbrVmSH0eG1t0hLqXUmxX/XX1kkbHOgZQQk90Sew23VwTVxbywq8
+yjkYLa2hlBXh33rXsiky7JFiF0TJE2r6wNB60BQMdi2EErtBUPL/1LD7+VuB/Y6x
+ZpwivKwMIXeFdzSrI2gGCn+zf01kNfHj0YrA2bH0i5FX4/9YSpd8PFIOYc/gA+3M
+NO0xMWchbz6AfjPQaR4tGLsRBjjwvLIZwHzyWQIDAQABAoIBAFBYus4oAsWTsEEM
+ZhEGfSGjaith3zWmblowyxZOYm+XcRtMeTLrYCso1bCNqCyUlwIsg9WCwUxMKPzZ
+LM7LLJpUOqMcJ4ShXy/uQ3Yw2LL7bEb77zMRugdcdUbQ7eGmvba4t5pT8VHgnUr3
+cdYrv6qDShMN8z6x9OnoJjmoj9J5Ggda6DhsXsvl5Ox85XMOJKd9yyaUfa/qy8b6
+wIyixGQ/9l/GwGONgtrF7yKW3YUE+uhoEp4pqgKsGUIke3l7aWug6dCDjKDMdbX5
+jwSSiw2ilTpQJhi1r8JIMOfMea3addf39VySK7e6cSWhsf1VTVwneJbka13xS6uR
+SSdvs7kCgYEA9ynOXh/1+VkpCHJBAPWEIUtPn16KGJB6YEsEf7cfaAQfzQCwJ8E4
+I7/WsHveHXs80HLS/ZJQlIXXsdeMiWdu1rnsQiVBZMmSNOpOD8iP/6mv8eqeeNr+
+3e3JG+j+l3w+/RzX516WC5JPMIsNSIzSlyx8Yht4IYA2uvpJcLdMW2MCgYEA5qY/
+xht6UlbLevGzFFFnM5R9LWSs+Ip88HCBmEwbow7FQTc0TXYbOKxGtPqn88dM91XT
+NMpPaGenuioRz+P1sbEFOP/iE4Hyob8643NMkAiwwoxzSf2Bsj+ebJ/U7oC0xKYx
+yjLeFWINhDy+I3LDLEXTTfv5GNrFlitqBEA+ThMCgYEAmOrJnhyCD4JlS698nj5I
+QF0a5wwTvnzs6dSf9PB0QuOCVVBerEn0FNIk3s3UL0NG7eSMu4uhxTJFr+cfMQfI
+YJtpG8d2/QdlKM3p/APna5Mtoyu4XieH1gC/E0CE+25IfksxHRm9FW2xBuSRFFjk
+FdnVHtHF8lwkAGzHsTAG0ucCgYEAigFdVT7psMyoEZb+7KBMXKtzPq7nZAsQ+JiI
+okSfoK/czMmoLNUHMqC56d20koNkhPVAW2zVmIW08QntAHPIdZqSomlQrxVoxOjz
+5lX9sIzSnoWFEfdyG+I++4Wi1VYDU0qRrgdDpI23wrDJn9Ix/5KD/TxP7lQwN0sg
+swxxeysCgYBBXGBBJR7+AbreFpOHitw0h32Qdmy6zHTEF8e0SjmEgDv3uwGDdsYO
+QQ7g9QPPPUsYtl0+mUmCwDrw1sJeVFtp86AQlQMV89pR2yXZLf0xwT7IN6RAH5Bi
+WlV2/pmiMuWB1qSUKgdPzVEd6aqtjD0TIjtryDBHp76YHJR6SzdCCA==
 -----END RSA PRIVATE KEY-----

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b1cbc44/server/test/resources/certs/rsa_self_signed_with_pwd.crt
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_self_signed_with_pwd.crt b/server/test/resources/certs/rsa_self_signed_with_pwd.crt
index 0b540aa..ff46845 100644
--- a/server/test/resources/certs/rsa_self_signed_with_pwd.crt
+++ b/server/test/resources/certs/rsa_self_signed_with_pwd.crt
@@ -1,17 +1,20 @@
 -----BEGIN CERTIFICATE-----
-MIICszCCAhwCCQCaE4goZabzDTANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMC
-VVMxCzAJBgNVBAgMAkNBMREwDwYDVQQHDAhTYW4gSm9zZTETMBEGA1UECgwKQ2xv
-dWRTdGFjazETMBEGA1UECwwKQ2xvdWRTdGFjazEeMBwGA1UEAwwVY2xvdWRzdGFj
-ay5hcGFjaGUub3JnMSQwIgYJKoZIhvcNAQkBFhVjbG91ZHN0YWNrQGFwYWNoZS5v
-cmcwHhcNMTQxMDIxMjI0MjA4WhcNMTUxMDIxMjI0MjA4WjCBnTELMAkGA1UEBhMC
-VVMxCzAJBgNVBAgMAkNBMREwDwYDVQQHDAhTYW4gSm9zZTETMBEGA1UECgwKQ2xv
-dWRTdGFjazETMBEGA1UECwwKQ2xvdWRTdGFjazEeMBwGA1UEAwwVY2xvdWRzdGFj
-ay5hcGFjaGUub3JnMSQwIgYJKoZIhvcNAQkBFhVjbG91ZHN0YWNrQGFwYWNoZS5v
-cmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANrW6mzOmvTipZiL6N0Lz+T+
-W1qM7iN0k9mOC9fq/U3pN1kIvI8yDF/6eJHQDmr0Hx/GJg4TNZ761kJcB/kCu7zA
-8uILGqh2M3+qhp5zqgPfN7MAxJ65dZPdg+r1mxogHxZUcMTDcEvNKDd73xJDZK47
-iPBie/4RRPQTJS3jbWhJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAoBURaXgxobxj
-4YEU0IHo/G1UwPhPAKahiDjQH7HxUFJoLEDGUXlP6L8Z7fN22CeX2gQoeAA3w6I2
-Oyb78wBnI3Kwlhr486NGZuxg2DSSfgK2EirIqswMa+P1/XxrArrfr/Ty4qiMEKhg
-ut+HM3oPPMVyU0Tlk/vgwgER5WD/9d0=
+MIIDNjCCAh4CCQCYwpqRbl2zIDANBgkqhkiG9w0BAQUFADBcMQswCQYDVQQGEwJB
+VTETMBEGA1UECAwKU29tZS1TdGF0ZTEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MSEw
+HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwIBcNMTQxMDMwMjMwMDUy
+WhgPMjA5NjEyMTgyMzAwNTJaMFwxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21l
+LVN0YXRlMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxITAfBgNVBAoMGEludGVybmV0
+IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
+AN/7lJtiEs68IC1ZPxY9NA34z9T4AU4LPS/kbQtuxx4X72XOBy+y0cB/qdMD7JNV
+h8Mq4URDljhSDyVPdH/+jQr+7kWx2gNe2R/DCnd/meVwwU30JJvpGVZXt+MTef5N
+QAbSfDMsuT4FaUY80InbDd24HelrjwunPdY9wwKXO6zL2fLjyDRediiydxcx18Vb
+Dq1cm7DRi4mNkmA3RwBQMhxGp3VsfXJ4Hy2WTRCCCxWHZphAh3EUJGK3idum6/7j
+HbAwpM/t1kNWN8PZiYDZ1HbccgjmqB7Cub10BfB9g1RByiQ/C87o5cKtQha3uuXR
+iBcHISoDydQrgxKgUpiqEF0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEANEPM6lLV
+wIZP6djgUFfEQvxHiw2VEqfPl+zttcILXCW2z5JbuXYQ3anQJrN2lkZQpPT+6/Ra
+338IrJ8F6NK28uji5uwn4f8SWdCxGNAbufwBKJnYbWYuTdhW7bXsRcFYE8kIoc6b
+JLGvr8hL5LFqQyRT8pQgNOfAOkubhC2MJXIX7lAVmRWIUFUufCOHAgQMECcsQA2t
+gTqyfLhdswLRRSWSI1ShxO5XWatxV9F43TzoV0kpkr8P4TdKkwXJviRSlRIR91k+
+i0278LtEglDhDoi9jHqudwl/9dU4TstHRHWoWftJ47w7B0gLuGLdQdhDsaAXlKcl
+kvVCO+go8AmLSA==
 -----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b1cbc44/server/test/resources/certs/rsa_self_signed_with_pwd.key
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_self_signed_with_pwd.key b/server/test/resources/certs/rsa_self_signed_with_pwd.key
index ece40e4..d645a71 100644
--- a/server/test/resources/certs/rsa_self_signed_with_pwd.key
+++ b/server/test/resources/certs/rsa_self_signed_with_pwd.key
@@ -1,15 +1,30 @@
 -----BEGIN RSA PRIVATE KEY-----
-MIICWwIBAAKBgQDa1upszpr04qWYi+jdC8/k/ltajO4jdJPZjgvX6v1N6TdZCLyP
-Mgxf+niR0A5q9B8fxiYOEzWe+tZCXAf5Aru8wPLiCxqodjN/qoaec6oD3zezAMSe
-uXWT3YPq9ZsaIB8WVHDEw3BLzSg3e98SQ2SuO4jwYnv+EUT0EyUt421oSQIDAQAB
-AoGAEYwgGf9rD23JB3VYg7j5v4vhuV4JjlA/trccHgEatI+Zv4riy7ygn2WPG2oK
-besLP9n8nS5PI2NLoOCORxpAAVmUQFZvUKE76ElJN9KtNNzY/Xoch54RJ1fCoqL/
-ERMpYDXmVONWSUTRio+SPu3gYDCOZX4wBWV+G6wHRa4m0V0CQQD7d/BvlE37T4kP
-5U3r8LpD05PxqvK18zq4D5oV7DFm3trog+uyScG+oHVNmZTCzujIxhlA7PrpClyv
-MuWBm6f7AkEA3sh0Rx4l1y4htTRIsS3i3QSfhE85Nf1VvYuVJGL1R/ckBlOyWrPV
-XadOxKpnho/sFT9a1FHMFWZtZBhkeGYpiwJAGURW4086eqrmMbOvnaplfNUwg1LS
-6ldTKhVfPR6rZBO2WTCQKSziC75hqvdojB5wI2RMO0rUdz/0SiJKDzjNqwJAauf0
-bIA6FmVLxaG+VE+5sufaCGrgAFl+QIPv4NMf8xXUkritOLtdYyC7OsKvBTKhTpzl
-YEeUUJyjV8ogxGn5+wJAXbnTChiLrfgMOOOAP8acxFPWGfLC3Ae0CAm5CeVJRTSr
-4m6LNHbtqXeYTnr1WQ8A10yNPxyB0l3AaWJpBC3iew==
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,CCA6E4CB4C4039DD
+
+TaVCJtB0dE9xTZbX7GOaGJwwGHVAMjU1GbRIHf0jODdP+quZvbjklNqsw8Ozlia9
+q/G+UqtRJGlIPPLpce0YCrTo0P3eixZdMs0+hioAEJ4OLtL0SAC6b8q/gB6HRfAx
+BvNg+umTqeF9YB68Tcuv/2g4VGKiaePQACyOzMdf7lGY7ojxoJCYZa1mfKb7jWrg
+FLwmTtLLhNjb6CnOKo3klIef3A6zdutpgxF1gARzdRyXg4qCA3boYnwEptTOlJFu
+ovxbhDG9iuYYr4gXYSs1pLYptEC8J6iWpG/qzkwfr4l5Cfg5uF00bbxQE5+WeRaj
+YFicvXjB/kcoFZuCL7M/YRXYxkJ/EZ19xI9HZNBQ4L738StkSBKL4OhpF/qgYZ2y
+ZLRV6XT4AijUA0Ef7YTuUsTL7Qt9drj09gCtAzXTA7gpZBn5SqT9kWhuwSzY302l
+KF8DIC6A52igk2QKPLbleM/V8eCu6n+J4uF+0GwVRROuG7ThxAQiUlJKhoEYrndL
+nzT7jHVLftjilhVWFu2On62bRf5t1QZuob+1AdK0ukvEIVsYnN4bnlAkc99Wi6C0
+ZJd9qW5L4A9XAC2gcjr3m0Rzw3RO+k17faR8YfmTuJvGyBf5fnrSFoNkrninXQXp
+sk0ajRi4PJ4XTswLyxjWRSt3egNsZBSKnVCibca/QoDEdZHSKXo2FlYiUYx8JHQX
+SPUsLl9OQKC1W8/+ReryqBLHCkiGEsvT8gVaXga0uhVaqe+PaVur2tbOHl4yCysC
++ZlnKwsC84LQsUvpENdCh+D7E1I1Rao9IJMR6q9azKq8Ck63cOJ1fA9xSnxJGoCA
+IlGLttlXrR32EtzYwEnlqf1nI/IqNQrAXQKrP5VPzHsgMFu5uD4OEZa92Q5cVTsz
+ap/1UEqiJVYUt6nuA+aqOUlyjC0oNtYL/VO4DbHTFcHa8SI2cPSS6ebPMWPGHjUm
+l9bWa6Q9iyplCYS6hinAVsAaLVjPi1Eu9Pc8rxFCmoiJYJju5NZuGI5UBK64dqcX
+T6trWl0kB8QY63JtnrZaoStoSPImV5KVseUKDV8TM3Y76h1nLV3MSmAD1ivk9oKs
+VKeVrDhZBWUq9Dqre/+lVGO0a2wo5VTR8hfpf8QkODPLeyNZNdfGKzkkFLuXa8V5
+ELhLQJ3FnbEU3NEvMwikV9MhP/ELPTkZwJr/NKv+9JLs9eXtwz29I/Q8byQVrCCs
+hAuDl0zHGRnqdpdSImeS2EXGx631zGMwSe8fhKelni5h6hXrXz52asr0k30BxWjf
+WUn1uTInwVjWGy9B5j3mZlVDotFbvVAZgtR0IoFwihPl4VZd9oS13l+hMfrTy1YZ
+8xFNg8ZqUQ0lSmKfOVqSBT0lP8tM8LuGxgY4cWluhsAQxR5Nl7wkundnqjcwEDDu
+Jz2rD54St1EZYGLDJZSfC7mpG2PgodsdeopQCTyFhHWa8s3caZ40GFOwaR+/5+YF
+1oRvkR1Yr4qIS7KbX4xsaFfAA5b8QfLA74L05PAgDwKofam2GFAlAKHOcI6mexPq
+aySON9MNdnXBNxs16mBJLzCX5ljQb0ilJildVEI3aVmABptM4ehEiw==
 -----END RSA PRIVATE KEY-----


[28/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
Revert "CLOUDSTACK-7822: updated ssl cert(exp:2096), reactivate tests"

This reverts commit 0d1fa9102d7a87863a9f91f88af05e9f38fe6b91.


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

Branch: refs/heads/master
Commit: aaa561a283ecf7df15a610511dc150fec73402e9
Parents: 5b1cbc4
Author: pdion891 <pd...@apache.org>
Authored: Fri Oct 31 17:14:59 2014 -0400
Committer: pdion891 <pd...@apache.org>
Committed: Fri Oct 31 17:14:59 2014 -0400

----------------------------------------------------------------------
 .../cloudstack/network/lb/CertServiceTest.java  | 16 +++----
 server/test/resources/certs/rsa_ca_signed.crt   | 36 +++++++---------
 server/test/resources/certs/rsa_ca_signed.key   | 45 +++++++-------------
 server/test/resources/certs/rsa_self_signed.crt | 33 +++++++-------
 server/test/resources/certs/rsa_self_signed.key | 38 ++++++-----------
 .../certs/rsa_self_signed_with_pwd.crt          | 33 +++++++-------
 .../certs/rsa_self_signed_with_pwd.key          | 41 ++++++------------
 7 files changed, 94 insertions(+), 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aaa561a2/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java
----------------------------------------------------------------------
diff --git a/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java b/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java
index 276bf8f..1292ce1 100755
--- a/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java
+++ b/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java
@@ -242,7 +242,7 @@ public class CertServiceTest {
         certService.uploadSslCert(uploadCmd);
     }
 
-
+    /*
     @Test
     public void runUploadSslCertBadChain() throws IOException, IllegalAccessException, NoSuchFieldException {
         Assume.assumeTrue(isOpenJdk() || isJCEInstalled());
@@ -297,9 +297,9 @@ public class CertServiceTest {
             assertTrue(e.getMessage().contains("Invalid certificate chain"));
         }
     }
+    */
 
-
-
+    /*
     @Test
     public void runUploadSslCertNoRootCert() throws IOException, IllegalAccessException, NoSuchFieldException {
 
@@ -356,9 +356,9 @@ public class CertServiceTest {
         }
 
     }
+    */
 
-
-
+    /*
     @Test
     public void runUploadSslCertNoChain() throws IOException, IllegalAccessException, NoSuchFieldException {
 
@@ -409,9 +409,9 @@ public class CertServiceTest {
         }
 
     }
+    */
 
-
-
+    /*
     @Test
     public void runUploadSslCertBadPassword() throws IOException, IllegalAccessException, NoSuchFieldException {
 
@@ -460,7 +460,7 @@ public class CertServiceTest {
         }
 
     }
-
+    */
 
     @Test
     public void runUploadSslCertBadkeyPair() throws IOException, IllegalAccessException, NoSuchFieldException {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aaa561a2/server/test/resources/certs/rsa_ca_signed.crt
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_ca_signed.crt b/server/test/resources/certs/rsa_ca_signed.crt
index fb74f17..0b540aa 100644
--- a/server/test/resources/certs/rsa_ca_signed.crt
+++ b/server/test/resources/certs/rsa_ca_signed.crt
@@ -1,23 +1,17 @@
 -----BEGIN CERTIFICATE-----
-MIID1TCCAr2gAwIBAgIJALXV1B5/vewhMA0GCSqGSIb3DQEBBQUAMGUxCzAJBgNV
-BAYTAkFVMQ0wCwYDVQQIDARTb21lMQwwCgYDVQQKDANPcmcxDDAKBgNVBAsMA0Rl
-djENMAsGA1UEAwwETmFtZTEcMBoGCSqGSIb3DQEJARYNdGVzdEBtYWlsLmNvbTAe
-Fw0xMzEwMjExNjE4MjJaFw0xNDEwMjExNjE4MjJaMHIxCzAJBgNVBAYTAkFVMRMw
-EQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0
-eSBMdGQxDTALBgNVBAMMBFN5ZWQxHDAaBgkqhkiG9w0BCQEWDXN5ZWRAdGVzdC5j
-b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpkHkV6ZHhkYc3Y92i
-YllHGbSnXIzwnbaYcfIB5NRldbxyts2Hp8HttxG0rH5DgEMdqfOowqYITe2/hAop
-ZqLuAuwEj0tlPJ/hoVnZeHlCuBps+/nWkanA0DgkwiVksm7UoWM736dkmhLf03FI
-A0/pOsUYranCJAGO26BmNQnocjuoWHZRZINKFNVwgNLrCGkhIu4Dk4o6Rnto0oew
-kwUUVogpUJ6hPFU+8eIV0BAxertuiv6bQC/dG4MhVLl9nRB+XSnf+UAMgH3ay1em
-t8CL4pAlBmctt08LcaLeJBVWH0tsdx/QUuo/5iL61I/eQi4thLureM+bhzDq3/JN
-DYzfAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wg
-R2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBR2LIRfVveDgQB3dC7TOYhX
-BEv71DAfBgNVHSMEGDAWgBSMUs4ge7LDahb4VdjEn9RmLxh0GDANBgkqhkiG9w0B
-AQUFAAOCAQEAPjN/sdLcPfMh5ep29vp/7JTh6dUYnBNATYaXxx8j2XdnMCKeRfgP
-WOJur8HDPSayWWKKlztiQbJV5jDS5vyuMWI1a5/KIAQlOJep+anpR1QnQaX4/M4Z
-YUJo1fPs6tg47dXRpZZaJ+Hqwh0ZftCQoUq/sBxawXf6sbxsjoUmzxQLBqzYo1LJ
-jwxBs6C9aM8LDHFz4TVlyclSFQXiLMosj1jLBQ+TqzCxS6qOfJeMM9STXI9W3F2k
-duXeceqOwEkh8aeSUIztYFpX34d4SA4DDX5GUEaOeOR/abnXjH52vE6tM/m7NOve
-5+I/BrlT3heRqiD6Z2ofSsFhG86YeF9Q3w==
+MIICszCCAhwCCQCaE4goZabzDTANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgMAkNBMREwDwYDVQQHDAhTYW4gSm9zZTETMBEGA1UECgwKQ2xv
+dWRTdGFjazETMBEGA1UECwwKQ2xvdWRTdGFjazEeMBwGA1UEAwwVY2xvdWRzdGFj
+ay5hcGFjaGUub3JnMSQwIgYJKoZIhvcNAQkBFhVjbG91ZHN0YWNrQGFwYWNoZS5v
+cmcwHhcNMTQxMDIxMjI0MjA4WhcNMTUxMDIxMjI0MjA4WjCBnTELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgMAkNBMREwDwYDVQQHDAhTYW4gSm9zZTETMBEGA1UECgwKQ2xv
+dWRTdGFjazETMBEGA1UECwwKQ2xvdWRTdGFjazEeMBwGA1UEAwwVY2xvdWRzdGFj
+ay5hcGFjaGUub3JnMSQwIgYJKoZIhvcNAQkBFhVjbG91ZHN0YWNrQGFwYWNoZS5v
+cmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANrW6mzOmvTipZiL6N0Lz+T+
+W1qM7iN0k9mOC9fq/U3pN1kIvI8yDF/6eJHQDmr0Hx/GJg4TNZ761kJcB/kCu7zA
+8uILGqh2M3+qhp5zqgPfN7MAxJ65dZPdg+r1mxogHxZUcMTDcEvNKDd73xJDZK47
+iPBie/4RRPQTJS3jbWhJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAoBURaXgxobxj
+4YEU0IHo/G1UwPhPAKahiDjQH7HxUFJoLEDGUXlP6L8Z7fN22CeX2gQoeAA3w6I2
+Oyb78wBnI3Kwlhr486NGZuxg2DSSfgK2EirIqswMa+P1/XxrArrfr/Ty4qiMEKhg
+ut+HM3oPPMVyU0Tlk/vgwgER5WD/9d0=
 -----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aaa561a2/server/test/resources/certs/rsa_ca_signed.key
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_ca_signed.key b/server/test/resources/certs/rsa_ca_signed.key
index d30dd8e..ece40e4 100644
--- a/server/test/resources/certs/rsa_ca_signed.key
+++ b/server/test/resources/certs/rsa_ca_signed.key
@@ -1,30 +1,15 @@
------BEGIN ENCRYPTED PRIVATE KEY-----
-MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIN4x8YHLIb60CAggA
-MBQGCCqGSIb3DQMHBAiuWe+C2SitUgSCBMhVxMKivNaQh9SQedh2GQ8vlhI2/mKf
-r6zVUgODOdmFRj/PAlQu6B+VH8u2Ef5tr74O9UyZUQpC6oI0npvQOGqnhIxECR8D
-zepFlC0s+6kNRqfzXiMhGTsfbs3xUE1TZK1z5556OS4GlihIB0E5F7GdlulHELeA
-dnEItqDffWPQczTmSmFqtH7G/ksGQhSA2reBIDNgxWreBh9x9h2TftEvhhogdkr2
-XQpzxcby2v2z6Hut1lfVkLQNdvdHYdDG751NQltOmGvncXkTNJ+tSByXuY9ITtYz
-XqwY/vAEX+YYjCrWcvMmhU1t6B9cZ3viFzIIIltqtvDo3rybicpM3xvmnYnTF35j
-sGebcynzZedrLUHwD6/o0jBzFJN26QBxDGrlmn9E8HBhmjMCeSyZTXtSkwN0dAhu
-EHT2NgdC/4G4+JHsb3Oetl6AbUyYs2eWTRgr6bgBezbiDqKMj1QtGECkPQE9tFFP
-Jtma6lGJ1/u8zLFYNjigKZgXaNbtlMpslk+KDTGaTSbbVEaaxWSc0YlHz329ovQC
-1btrTE71FoNjRsTRaDRXC7BfrrMtnLhG2SmROKzyBtoxFymfEmASpdGERO+c2712
-Z0NLpHJL5ocsRr/onVi0auFC/nuaq6QqYF5OPtZhYh3+IDd193LP3xo8hnFjTq90
-9zV1QI2uHfTfijI4OABYSSZLxrl2IFF7Z/e4XkWSXrneR2Ne5GoYX7w6wshiuubQ
-bDPUHODsy7uQJ3ZEmmmd5xWvA3h3F5Yyls3WEuz8+jYR4iPKdjt8DJuz9j+7IP3C
-LoRa3KhxIPAzziQw+tMFVCozLLfS1kN8mg5SwU9Dp4HUPY/n3KnjVSjUJ347KAgW
-+ykPlz4S1H0A2GyGWhdyX3J839UOdXfCsfKQQ1FLOBvhQgBNGzoRIgDrsZdrxgWa
-XtF+Ct2/2/O+503I6X90maXzhshmGw/NKsiNx7YOdUiu6w3N4LajIWE689UUU7Dr
-EtM8HcfmBnE/cZTbeWbQBfl1GqigMp+YOAY2sw0rZdF4ocmnqoCWLVN2j8O/re5g
-20y5eHkztPOZ+NNczo5PP96ng1XEMVzs/h6xDHzsak6osZb5b+Hs9kcYuqBEqr16
-3DVwaZ45dGwNN90Q9YmrgEdCqtCAU12w/YYVB/aB701Ijg0NhVsh7PgWaJIOJD56
-YTaiWIzQaZ/uM0KlgLz2eI9VXcuv24gUMAUMaI84mInnIrax1zFMrlCjEcR8Zxvk
-jCCY6Uq9WH30cUo7cMHWLWMzsl7PC7xpYSHPClqzCUluUgQwqoOs5Ux4nYl+JI7C
-ZfJ8BUMCD2RJtjvJhkE6LEkcrCjwnvappRaXbN54IVXpuMl2XYtp44T117QulEj1
-I/jk1mrpkXRKi9ZsKsjDH9VMy1hcKHn4CgTxmtRYN6LPA4tamxzVLxIi6YDU0142
-l1u763cT7cH14lvzUvEQMFbk/s0AUl8zeZAwjDayNlD/ljz7nZnJ3NToMlxeoK0a
-F6c/RgQBwxR8NMdo19Irv8stxo9WGB2/0Q8WCxW7ENHlBpvX5zXKRJMswFKp0ft6
-dT7hOBPgJlD7C1eX5jVcSz6kDRM6gQ7K/c5QcJa6qNAC2Jw6yBBYltqiRalFWX46
-VcM=
------END ENCRYPTED PRIVATE KEY-----
+-----BEGIN RSA PRIVATE KEY-----
+MIICWwIBAAKBgQDa1upszpr04qWYi+jdC8/k/ltajO4jdJPZjgvX6v1N6TdZCLyP
+Mgxf+niR0A5q9B8fxiYOEzWe+tZCXAf5Aru8wPLiCxqodjN/qoaec6oD3zezAMSe
+uXWT3YPq9ZsaIB8WVHDEw3BLzSg3e98SQ2SuO4jwYnv+EUT0EyUt421oSQIDAQAB
+AoGAEYwgGf9rD23JB3VYg7j5v4vhuV4JjlA/trccHgEatI+Zv4riy7ygn2WPG2oK
+besLP9n8nS5PI2NLoOCORxpAAVmUQFZvUKE76ElJN9KtNNzY/Xoch54RJ1fCoqL/
+ERMpYDXmVONWSUTRio+SPu3gYDCOZX4wBWV+G6wHRa4m0V0CQQD7d/BvlE37T4kP
+5U3r8LpD05PxqvK18zq4D5oV7DFm3trog+uyScG+oHVNmZTCzujIxhlA7PrpClyv
+MuWBm6f7AkEA3sh0Rx4l1y4htTRIsS3i3QSfhE85Nf1VvYuVJGL1R/ckBlOyWrPV
+XadOxKpnho/sFT9a1FHMFWZtZBhkeGYpiwJAGURW4086eqrmMbOvnaplfNUwg1LS
+6ldTKhVfPR6rZBO2WTCQKSziC75hqvdojB5wI2RMO0rUdz/0SiJKDzjNqwJAauf0
+bIA6FmVLxaG+VE+5sufaCGrgAFl+QIPv4NMf8xXUkritOLtdYyC7OsKvBTKhTpzl
+YEeUUJyjV8ogxGn5+wJAXbnTChiLrfgMOOOAP8acxFPWGfLC3Ae0CAm5CeVJRTSr
+4m6LNHbtqXeYTnr1WQ8A10yNPxyB0l3AaWJpBC3iew==
+-----END RSA PRIVATE KEY-----

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aaa561a2/server/test/resources/certs/rsa_self_signed.crt
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_self_signed.crt b/server/test/resources/certs/rsa_self_signed.crt
index 19003ef..f0dbbb8 100644
--- a/server/test/resources/certs/rsa_self_signed.crt
+++ b/server/test/resources/certs/rsa_self_signed.crt
@@ -1,20 +1,17 @@
 -----BEGIN CERTIFICATE-----
-MIIDNjCCAh4CCQD1aM8xUbgZDDANBgkqhkiG9w0BAQUFADBcMQswCQYDVQQGEwJB
-VTETMBEGA1UECAwKU29tZS1TdGF0ZTEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MSEw
-HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwIBcNMTQxMDMxMDE1NTM0
-WhgPMjA5NjEyMTkwMTU1MzRaMFwxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21l
-LVN0YXRlMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxITAfBgNVBAoMGEludGVybmV0
-IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-AN6wEhbwZgBfgh5+fE1OYm9B7jA+IMbraIY80IyV2ERbNXJoi2/XrDtAr5NAxWkL
-qpaccOA4XupMUWzUCpDxa9M7L/QfCP6PFEJnJZ2dCPvosZQKuFcj+h9LHsK5nVW6
-1Zkh9HhtbdIS6l1JsV/119ZJGxzoGUEJPdEnsNt1cE1cW8sKvMo5GC2toZQV4d96
-17IpMuyRYhdEyRNq+sDQetAUDHYthBK7QVDy/9Sw+/lbgf2OsWacIrysDCF3hXc0
-qyNoBgp/s39NZDXx49GKwNmx9IuRV+P/WEqXfDxSDmHP4APtzDTtMTFnIW8+gH4z
-0GkeLRi7EQY48LyyGcB88lkCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAH5vm8XY+
-jp0Qw3I5jyMI7QYoCdSIY4FoxAMxmCXqOXsem06Yxx55IRgaQR3CTxKY6jOyfBnQ
-P0bLCX4MNaIKIEuLgYr5/g2sbmTWReCfqJRalU69znj6CUpKkIZ3rmxHJQF+BJjw
-A+Eut87o1WOR7quXJOo0cJUjNPRc7+Hjt9U+HWxC8K1jv+/dCv1EdhVGWTdLKWEk
-kApnfTOq66hVsD6FCQ+ohPgCv32wdMxmBSCctSRHE+Zf3GqJheQS+7AIF/y4VVmm
-eDjZGXmCQR9nb24JLkHO2g4ogP5X9nuyzwcOqiw+SITPArH3IadzMV4Kus5tsGUo
-zaPaMXXDmNj8Rw==
+MIICwTCCAioCCQCRL9B7rcgqFTANBgkqhkiG9w0BAQUFADCBpDELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgMAkNBMREwDwYDVQQHDAhTYW4gSm9zZTEaMBgGA1UECgwRQXBh
+Y2hlIENsb3VkU3RhY2sxEzARBgNVBAsMCkNsb3VkU3RhY2sxHjAcBgNVBAMMFWNs
+b3Vkc3RhY2suYXBhY2hlLm9yZzEkMCIGCSqGSIb3DQEJARYVY2xvdWRzdGFja0Bh
+cGFjaGUub3JnMB4XDTE0MTAyMTIyMjc1OFoXDTI0MTAxODIyMjc1OFowgaQxCzAJ
+BgNVBAYTAlVTMQswCQYDVQQIDAJDQTERMA8GA1UEBwwIU2FuIEpvc2UxGjAYBgNV
+BAoMEUFwYWNoZSBDbG91ZFN0YWNrMRMwEQYDVQQLDApDbG91ZFN0YWNrMR4wHAYD
+VQQDDBVjbG91ZHN0YWNrLmFwYWNoZS5vcmcxJDAiBgkqhkiG9w0BCQEWFWNsb3Vk
+c3RhY2tAYXBhY2hlLm9yZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtZuL
+mow2ktFcV50aU4On6O5PxWzDWX4118nKJ/qCEjdxArZacSTpdbjBtQdq3DeWAbbD
+d5TdcL0qB0/dZSXmNWt5kEaEmOTm0Yy1HwbT+pKDn+r5KwtICvJogf2VTVpjGNyD
+bmvYE9mCdxmaqZIzGWMrr04ZZX+6AXAlKfYPaRsCAwEAATANBgkqhkiG9w0BAQUF
+AAOBgQBCKbaQ0puIQ7/WzlQCnt8r7z3FIhLJ/pyFL/lyAjr/+8TxEcxZvoNMKza6
+EFAYmHPumJdTQJVWWMOpeY3m3+rKKup+DcGVGmijTG1t7wPhok4JAWm561NUNNaI
+RQFyp9VuTWbgvN6pZCI6RsV9oXj8FnkDenXyX4qlUXXKVa74hw==
 -----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aaa561a2/server/test/resources/certs/rsa_self_signed.key
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_self_signed.key b/server/test/resources/certs/rsa_self_signed.key
index 14b95e6..043b865 100644
--- a/server/test/resources/certs/rsa_self_signed.key
+++ b/server/test/resources/certs/rsa_self_signed.key
@@ -1,27 +1,15 @@
 -----BEGIN RSA PRIVATE KEY-----
-MIIEpAIBAAKCAQEA3rASFvBmAF+CHn58TU5ib0HuMD4gxutohjzQjJXYRFs1cmiL
-b9esO0Cvk0DFaQuqlpxw4Dhe6kxRbNQKkPFr0zsv9B8I/o8UQmclnZ0I++ixlAq4
-VyP6H0sewrmdVbrVmSH0eG1t0hLqXUmxX/XX1kkbHOgZQQk90Sew23VwTVxbywq8
-yjkYLa2hlBXh33rXsiky7JFiF0TJE2r6wNB60BQMdi2EErtBUPL/1LD7+VuB/Y6x
-ZpwivKwMIXeFdzSrI2gGCn+zf01kNfHj0YrA2bH0i5FX4/9YSpd8PFIOYc/gA+3M
-NO0xMWchbz6AfjPQaR4tGLsRBjjwvLIZwHzyWQIDAQABAoIBAFBYus4oAsWTsEEM
-ZhEGfSGjaith3zWmblowyxZOYm+XcRtMeTLrYCso1bCNqCyUlwIsg9WCwUxMKPzZ
-LM7LLJpUOqMcJ4ShXy/uQ3Yw2LL7bEb77zMRugdcdUbQ7eGmvba4t5pT8VHgnUr3
-cdYrv6qDShMN8z6x9OnoJjmoj9J5Ggda6DhsXsvl5Ox85XMOJKd9yyaUfa/qy8b6
-wIyixGQ/9l/GwGONgtrF7yKW3YUE+uhoEp4pqgKsGUIke3l7aWug6dCDjKDMdbX5
-jwSSiw2ilTpQJhi1r8JIMOfMea3addf39VySK7e6cSWhsf1VTVwneJbka13xS6uR
-SSdvs7kCgYEA9ynOXh/1+VkpCHJBAPWEIUtPn16KGJB6YEsEf7cfaAQfzQCwJ8E4
-I7/WsHveHXs80HLS/ZJQlIXXsdeMiWdu1rnsQiVBZMmSNOpOD8iP/6mv8eqeeNr+
-3e3JG+j+l3w+/RzX516WC5JPMIsNSIzSlyx8Yht4IYA2uvpJcLdMW2MCgYEA5qY/
-xht6UlbLevGzFFFnM5R9LWSs+Ip88HCBmEwbow7FQTc0TXYbOKxGtPqn88dM91XT
-NMpPaGenuioRz+P1sbEFOP/iE4Hyob8643NMkAiwwoxzSf2Bsj+ebJ/U7oC0xKYx
-yjLeFWINhDy+I3LDLEXTTfv5GNrFlitqBEA+ThMCgYEAmOrJnhyCD4JlS698nj5I
-QF0a5wwTvnzs6dSf9PB0QuOCVVBerEn0FNIk3s3UL0NG7eSMu4uhxTJFr+cfMQfI
-YJtpG8d2/QdlKM3p/APna5Mtoyu4XieH1gC/E0CE+25IfksxHRm9FW2xBuSRFFjk
-FdnVHtHF8lwkAGzHsTAG0ucCgYEAigFdVT7psMyoEZb+7KBMXKtzPq7nZAsQ+JiI
-okSfoK/czMmoLNUHMqC56d20koNkhPVAW2zVmIW08QntAHPIdZqSomlQrxVoxOjz
-5lX9sIzSnoWFEfdyG+I++4Wi1VYDU0qRrgdDpI23wrDJn9Ix/5KD/TxP7lQwN0sg
-swxxeysCgYBBXGBBJR7+AbreFpOHitw0h32Qdmy6zHTEF8e0SjmEgDv3uwGDdsYO
-QQ7g9QPPPUsYtl0+mUmCwDrw1sJeVFtp86AQlQMV89pR2yXZLf0xwT7IN6RAH5Bi
-WlV2/pmiMuWB1qSUKgdPzVEd6aqtjD0TIjtryDBHp76YHJR6SzdCCA==
+MIICXQIBAAKBgQC1m4uajDaS0VxXnRpTg6fo7k/FbMNZfjXXycon+oISN3ECtlpx
+JOl1uMG1B2rcN5YBtsN3lN1wvSoHT91lJeY1a3mQRoSY5ObRjLUfBtP6koOf6vkr
+C0gK8miB/ZVNWmMY3INua9gT2YJ3GZqpkjMZYyuvThllf7oBcCUp9g9pGwIDAQAB
+AoGAPyqiDRhV5w0xDDxVqtSxM4CoeGfTLq6Kdcr3KJ6mXUWxZhsdLBuFpG+l2JyC
+26Pt5hy2skIyH4N8OdzaidL71eSQSz8rmnh811EkM1+Xu6NnX81dLsFV8zGuZpMs
+qF/0lPggmg9o+mwXD5v8BBnmSV86Ki3LNCidgZFvOXhdLkkCQQDk1k2a4qt1JZ8J
+II6eNEwCKV13RrXnds83+q0pglosSjRmFNBll35MQxsPMG1FPRHisl7ayeppCeK7
+R8mDUWaPAkEAyyoS6bpTASRDmIfbSPPUZePJT6Wyx0rSAhWZ9nWU3tJGk2lkmkJQ
+yVNO7yPl05O8k8MMpBSTw56WR1XwBiK6tQJBAKRT2Eq/N0zahUfynzewalyrA7lh
+h8L9qHSUiMDkIIjpiJM9oyExFrsA/W984Rr1beCTIlaO5MwlEzJVrLmmPLUCQEs4
+q8IAK8VrcN+jxYwwQz7qZNnphtUFHdaJuvSmulT51Am2Zvo6fYDdKIegafK5a4Pm
+HuMNf1xZdli5N+J9r1UCQQCGyN8Cbggjms1hZoby4EFsEvFw+l7/B56Km51LUDKE
+8phRLBOy5X5ATT8QjrTGNAhw+T7OewkwK8CjVSltkk1x
 -----END RSA PRIVATE KEY-----

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aaa561a2/server/test/resources/certs/rsa_self_signed_with_pwd.crt
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_self_signed_with_pwd.crt b/server/test/resources/certs/rsa_self_signed_with_pwd.crt
index ff46845..0b540aa 100644
--- a/server/test/resources/certs/rsa_self_signed_with_pwd.crt
+++ b/server/test/resources/certs/rsa_self_signed_with_pwd.crt
@@ -1,20 +1,17 @@
 -----BEGIN CERTIFICATE-----
-MIIDNjCCAh4CCQCYwpqRbl2zIDANBgkqhkiG9w0BAQUFADBcMQswCQYDVQQGEwJB
-VTETMBEGA1UECAwKU29tZS1TdGF0ZTEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MSEw
-HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwIBcNMTQxMDMwMjMwMDUy
-WhgPMjA5NjEyMTgyMzAwNTJaMFwxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21l
-LVN0YXRlMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxITAfBgNVBAoMGEludGVybmV0
-IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-AN/7lJtiEs68IC1ZPxY9NA34z9T4AU4LPS/kbQtuxx4X72XOBy+y0cB/qdMD7JNV
-h8Mq4URDljhSDyVPdH/+jQr+7kWx2gNe2R/DCnd/meVwwU30JJvpGVZXt+MTef5N
-QAbSfDMsuT4FaUY80InbDd24HelrjwunPdY9wwKXO6zL2fLjyDRediiydxcx18Vb
-Dq1cm7DRi4mNkmA3RwBQMhxGp3VsfXJ4Hy2WTRCCCxWHZphAh3EUJGK3idum6/7j
-HbAwpM/t1kNWN8PZiYDZ1HbccgjmqB7Cub10BfB9g1RByiQ/C87o5cKtQha3uuXR
-iBcHISoDydQrgxKgUpiqEF0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEANEPM6lLV
-wIZP6djgUFfEQvxHiw2VEqfPl+zttcILXCW2z5JbuXYQ3anQJrN2lkZQpPT+6/Ra
-338IrJ8F6NK28uji5uwn4f8SWdCxGNAbufwBKJnYbWYuTdhW7bXsRcFYE8kIoc6b
-JLGvr8hL5LFqQyRT8pQgNOfAOkubhC2MJXIX7lAVmRWIUFUufCOHAgQMECcsQA2t
-gTqyfLhdswLRRSWSI1ShxO5XWatxV9F43TzoV0kpkr8P4TdKkwXJviRSlRIR91k+
-i0278LtEglDhDoi9jHqudwl/9dU4TstHRHWoWftJ47w7B0gLuGLdQdhDsaAXlKcl
-kvVCO+go8AmLSA==
+MIICszCCAhwCCQCaE4goZabzDTANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgMAkNBMREwDwYDVQQHDAhTYW4gSm9zZTETMBEGA1UECgwKQ2xv
+dWRTdGFjazETMBEGA1UECwwKQ2xvdWRTdGFjazEeMBwGA1UEAwwVY2xvdWRzdGFj
+ay5hcGFjaGUub3JnMSQwIgYJKoZIhvcNAQkBFhVjbG91ZHN0YWNrQGFwYWNoZS5v
+cmcwHhcNMTQxMDIxMjI0MjA4WhcNMTUxMDIxMjI0MjA4WjCBnTELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgMAkNBMREwDwYDVQQHDAhTYW4gSm9zZTETMBEGA1UECgwKQ2xv
+dWRTdGFjazETMBEGA1UECwwKQ2xvdWRTdGFjazEeMBwGA1UEAwwVY2xvdWRzdGFj
+ay5hcGFjaGUub3JnMSQwIgYJKoZIhvcNAQkBFhVjbG91ZHN0YWNrQGFwYWNoZS5v
+cmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANrW6mzOmvTipZiL6N0Lz+T+
+W1qM7iN0k9mOC9fq/U3pN1kIvI8yDF/6eJHQDmr0Hx/GJg4TNZ761kJcB/kCu7zA
+8uILGqh2M3+qhp5zqgPfN7MAxJ65dZPdg+r1mxogHxZUcMTDcEvNKDd73xJDZK47
+iPBie/4RRPQTJS3jbWhJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAoBURaXgxobxj
+4YEU0IHo/G1UwPhPAKahiDjQH7HxUFJoLEDGUXlP6L8Z7fN22CeX2gQoeAA3w6I2
+Oyb78wBnI3Kwlhr486NGZuxg2DSSfgK2EirIqswMa+P1/XxrArrfr/Ty4qiMEKhg
+ut+HM3oPPMVyU0Tlk/vgwgER5WD/9d0=
 -----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aaa561a2/server/test/resources/certs/rsa_self_signed_with_pwd.key
----------------------------------------------------------------------
diff --git a/server/test/resources/certs/rsa_self_signed_with_pwd.key b/server/test/resources/certs/rsa_self_signed_with_pwd.key
index d645a71..ece40e4 100644
--- a/server/test/resources/certs/rsa_self_signed_with_pwd.key
+++ b/server/test/resources/certs/rsa_self_signed_with_pwd.key
@@ -1,30 +1,15 @@
 -----BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,CCA6E4CB4C4039DD
-
-TaVCJtB0dE9xTZbX7GOaGJwwGHVAMjU1GbRIHf0jODdP+quZvbjklNqsw8Ozlia9
-q/G+UqtRJGlIPPLpce0YCrTo0P3eixZdMs0+hioAEJ4OLtL0SAC6b8q/gB6HRfAx
-BvNg+umTqeF9YB68Tcuv/2g4VGKiaePQACyOzMdf7lGY7ojxoJCYZa1mfKb7jWrg
-FLwmTtLLhNjb6CnOKo3klIef3A6zdutpgxF1gARzdRyXg4qCA3boYnwEptTOlJFu
-ovxbhDG9iuYYr4gXYSs1pLYptEC8J6iWpG/qzkwfr4l5Cfg5uF00bbxQE5+WeRaj
-YFicvXjB/kcoFZuCL7M/YRXYxkJ/EZ19xI9HZNBQ4L738StkSBKL4OhpF/qgYZ2y
-ZLRV6XT4AijUA0Ef7YTuUsTL7Qt9drj09gCtAzXTA7gpZBn5SqT9kWhuwSzY302l
-KF8DIC6A52igk2QKPLbleM/V8eCu6n+J4uF+0GwVRROuG7ThxAQiUlJKhoEYrndL
-nzT7jHVLftjilhVWFu2On62bRf5t1QZuob+1AdK0ukvEIVsYnN4bnlAkc99Wi6C0
-ZJd9qW5L4A9XAC2gcjr3m0Rzw3RO+k17faR8YfmTuJvGyBf5fnrSFoNkrninXQXp
-sk0ajRi4PJ4XTswLyxjWRSt3egNsZBSKnVCibca/QoDEdZHSKXo2FlYiUYx8JHQX
-SPUsLl9OQKC1W8/+ReryqBLHCkiGEsvT8gVaXga0uhVaqe+PaVur2tbOHl4yCysC
-+ZlnKwsC84LQsUvpENdCh+D7E1I1Rao9IJMR6q9azKq8Ck63cOJ1fA9xSnxJGoCA
-IlGLttlXrR32EtzYwEnlqf1nI/IqNQrAXQKrP5VPzHsgMFu5uD4OEZa92Q5cVTsz
-ap/1UEqiJVYUt6nuA+aqOUlyjC0oNtYL/VO4DbHTFcHa8SI2cPSS6ebPMWPGHjUm
-l9bWa6Q9iyplCYS6hinAVsAaLVjPi1Eu9Pc8rxFCmoiJYJju5NZuGI5UBK64dqcX
-T6trWl0kB8QY63JtnrZaoStoSPImV5KVseUKDV8TM3Y76h1nLV3MSmAD1ivk9oKs
-VKeVrDhZBWUq9Dqre/+lVGO0a2wo5VTR8hfpf8QkODPLeyNZNdfGKzkkFLuXa8V5
-ELhLQJ3FnbEU3NEvMwikV9MhP/ELPTkZwJr/NKv+9JLs9eXtwz29I/Q8byQVrCCs
-hAuDl0zHGRnqdpdSImeS2EXGx631zGMwSe8fhKelni5h6hXrXz52asr0k30BxWjf
-WUn1uTInwVjWGy9B5j3mZlVDotFbvVAZgtR0IoFwihPl4VZd9oS13l+hMfrTy1YZ
-8xFNg8ZqUQ0lSmKfOVqSBT0lP8tM8LuGxgY4cWluhsAQxR5Nl7wkundnqjcwEDDu
-Jz2rD54St1EZYGLDJZSfC7mpG2PgodsdeopQCTyFhHWa8s3caZ40GFOwaR+/5+YF
-1oRvkR1Yr4qIS7KbX4xsaFfAA5b8QfLA74L05PAgDwKofam2GFAlAKHOcI6mexPq
-aySON9MNdnXBNxs16mBJLzCX5ljQb0ilJildVEI3aVmABptM4ehEiw==
+MIICWwIBAAKBgQDa1upszpr04qWYi+jdC8/k/ltajO4jdJPZjgvX6v1N6TdZCLyP
+Mgxf+niR0A5q9B8fxiYOEzWe+tZCXAf5Aru8wPLiCxqodjN/qoaec6oD3zezAMSe
+uXWT3YPq9ZsaIB8WVHDEw3BLzSg3e98SQ2SuO4jwYnv+EUT0EyUt421oSQIDAQAB
+AoGAEYwgGf9rD23JB3VYg7j5v4vhuV4JjlA/trccHgEatI+Zv4riy7ygn2WPG2oK
+besLP9n8nS5PI2NLoOCORxpAAVmUQFZvUKE76ElJN9KtNNzY/Xoch54RJ1fCoqL/
+ERMpYDXmVONWSUTRio+SPu3gYDCOZX4wBWV+G6wHRa4m0V0CQQD7d/BvlE37T4kP
+5U3r8LpD05PxqvK18zq4D5oV7DFm3trog+uyScG+oHVNmZTCzujIxhlA7PrpClyv
+MuWBm6f7AkEA3sh0Rx4l1y4htTRIsS3i3QSfhE85Nf1VvYuVJGL1R/ckBlOyWrPV
+XadOxKpnho/sFT9a1FHMFWZtZBhkeGYpiwJAGURW4086eqrmMbOvnaplfNUwg1LS
+6ldTKhVfPR6rZBO2WTCQKSziC75hqvdojB5wI2RMO0rUdz/0SiJKDzjNqwJAauf0
+bIA6FmVLxaG+VE+5sufaCGrgAFl+QIPv4NMf8xXUkritOLtdYyC7OsKvBTKhTpzl
+YEeUUJyjV8ogxGn5+wJAXbnTChiLrfgMOOOAP8acxFPWGfLC3Ae0CAm5CeVJRTSr
+4m6LNHbtqXeYTnr1WQ8A10yNPxyB0l3AaWJpBC3iew==
 -----END RSA PRIVATE KEY-----


[49/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
Merge branch '4.5'


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

Branch: refs/heads/master
Commit: 2b1ca20b9be21a5ec0faf381dd275f2448217314
Parents: fce9f96 c15ed74
Author: Rajani Karuturi <ra...@gmail.com>
Authored: Wed Nov 5 15:19:46 2014 +0530
Committer: Rajani Karuturi <ra...@gmail.com>
Committed: Wed Nov 5 15:19:46 2014 +0530

----------------------------------------------------------------------

----------------------------------------------------------------------



[04/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7814: Fix default passphrase for keystores

In upgrade case, the db.properties file is not changed, but the following commit
would require passphrase for keystore in it, thus result in error(NPE in fact
due to there is no such properity).

commit 918c320438980f070150f872e3a3ba907572af83
Author: Upendra Moturi <up...@sungard.com>
Date: Fri Jun 20 11:41:58 2014 +0530
CLOUDSTACK-6847.Link.java and console proxy files have hardcoded value

This commit fix it by put default value for passphrases, also set correct
passphrase if fail-safe keystore is used.


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

Branch: refs/heads/master
Commit: 865b2e6791a37371fff4c43c974c90f44d24c418
Parents: 4929625
Author: Sheng Yang <sh...@citrix.com>
Authored: Mon Oct 27 18:59:55 2014 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Tue Oct 28 16:29:29 2014 -0700

----------------------------------------------------------------------
 .../ConsoleProxySecureServerFactoryImpl.java    | 32 ++++++++++----------
 utils/src/com/cloud/utils/nio/Link.java         |  9 ++++--
 2 files changed, 22 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/865b2e67/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxySecureServerFactoryImpl.java
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxySecureServerFactoryImpl.java b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxySecureServerFactoryImpl.java
index 7af4c7b..75d23b1 100644
--- a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxySecureServerFactoryImpl.java
+++ b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxySecureServerFactoryImpl.java
@@ -16,12 +16,12 @@
 // under the License.
 package com.cloud.consoleproxy;
 
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.security.KeyStore;
-import java.util.Properties;
+import com.cloud.utils.db.DbProperties;
+import com.sun.net.httpserver.HttpServer;
+import com.sun.net.httpserver.HttpsConfigurator;
+import com.sun.net.httpserver.HttpsParameters;
+import com.sun.net.httpserver.HttpsServer;
+import org.apache.log4j.Logger;
 
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
@@ -29,14 +29,11 @@ import javax.net.ssl.SSLParameters;
 import javax.net.ssl.SSLServerSocket;
 import javax.net.ssl.SSLServerSocketFactory;
 import javax.net.ssl.TrustManagerFactory;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.utils.db.DbProperties;
-import com.sun.net.httpserver.HttpServer;
-import com.sun.net.httpserver.HttpsConfigurator;
-import com.sun.net.httpserver.HttpsParameters;
-import com.sun.net.httpserver.HttpsServer;
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.security.KeyStore;
 
 public class ConsoleProxySecureServerFactoryImpl implements ConsoleProxyServerFactory {
     private static final Logger s_logger = Logger.getLogger(ConsoleProxySecureServerFactoryImpl.class);
@@ -54,8 +51,11 @@ public class ConsoleProxySecureServerFactoryImpl implements ConsoleProxyServerFa
             try {
                 s_logger.info("Initializing SSL from built-in default certificate");
 
-                final Properties dbProps = DbProperties.getDbProperties();
-                char[] passphrase = dbProps.getProperty("db.cloud.keyStorePassphrase").toCharArray();
+                final String pass = DbProperties.getDbProperties().getProperty("db.cloud.keyStorePassphrase");
+                char[] passphrase = "vmops.com".toCharArray();
+                if (pass != null) {
+                    passphrase = pass.toCharArray();
+                }
                 KeyStore ks = KeyStore.getInstance("JKS");
 
                 ks.load(new FileInputStream("certs/realhostip.keystore"), passphrase);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/865b2e67/utils/src/com/cloud/utils/nio/Link.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/nio/Link.java b/utils/src/com/cloud/utils/nio/Link.java
index c295caf..a15b8a4 100755
--- a/utils/src/com/cloud/utils/nio/Link.java
+++ b/utils/src/com/cloud/utils/nio/Link.java
@@ -33,7 +33,6 @@ import java.nio.channels.SelectionKey;
 import java.nio.channels.SocketChannel;
 import java.security.GeneralSecurityException;
 import java.security.KeyStore;
-import java.util.Properties;
 import java.util.concurrent.ConcurrentLinkedQueue;
 
 import javax.net.ssl.KeyManagerFactory;
@@ -418,8 +417,11 @@ public class Link {
 
         File confFile = PropertiesUtil.findConfigFile("db.properties");
         if (null != confFile && !isClient) {
-            final Properties dbProps = DbProperties.getDbProperties();
-            char[] passphrase = dbProps.getProperty("db.cloud.keyStorePassphrase").toCharArray();
+            final String pass = DbProperties.getDbProperties().getProperty("db.cloud.keyStorePassphrase");
+            char[] passphrase = "vmops.com".toCharArray();
+            if (pass != null) {
+                passphrase = pass.toCharArray();
+            }
             String confPath = confFile.getParent();
             String keystorePath = confPath + keystoreFile;
             if (new File(keystorePath).exists()) {
@@ -427,6 +429,7 @@ public class Link {
             } else {
                 s_logger.warn("SSL: Fail to find the generated keystore. Loading fail-safe one to continue.");
                 stream = NioConnection.class.getResourceAsStream("/cloud.keystore");
+                passphrase = "vmops.com".toCharArray();
             }
             ks.load(stream, passphrase);
             stream.close();


[07/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7809: UI > remove usage of g_mySession which is unnecessary.


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

Branch: refs/heads/master
Commit: 58455c08c4ff40f7aaa632e5014700444cb7aa9a
Parents: 070e689
Author: Jessica Wang <je...@apache.org>
Authored: Wed Oct 29 11:14:58 2014 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Wed Oct 29 11:14:58 2014 -0700

----------------------------------------------------------------------
 ui/scripts/cloudStack.js      | 31 +++----------------------------
 ui/scripts/sharedFunctions.js |  2 +-
 2 files changed, 4 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58455c08/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index 49af7f7..c5aa89c 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -93,26 +93,6 @@
                     message: parseXMLHttpResponse(data),
                     clickAction: clickAction
                 });
-            },
-            beforeSend: function(XMLHttpRequest) {
-                if (g_mySession == $.cookie("JSESSIONID")) {
-                    return true;
-                } else {
-                    var clickAction = function() {
-                        $('#user-options a').eq(0).trigger('click');
-                    };
-
-                    if ($('.notification-box:visible').size()) {
-                        $('.notification-box, div.overlay:first').remove();
-                    }
-
-                    cloudStack.dialog.notice({
-                        message: _l('label.session.expired'),
-                        clickAction: clickAction
-                    }).closest('.ui-dialog').overlay();
-
-                    return false;
-                }
             }
         });
 
@@ -137,7 +117,6 @@
                         }
                         return cookieValue;
                     };
-                    g_mySession = $.cookie('JSESSIONID');
                     g_sessionKey = unBoxCookieValue('sessionKey');
                     g_role = unBoxCookieValue('role');
                     g_userid = unBoxCookieValue('userid');
@@ -147,7 +126,6 @@
                     g_userfullname = unBoxCookieValue('userfullname');
                     g_timezone = unBoxCookieValue('timezone');                    
                 } else { //single-sign-on	(bypass login screen)
-                    g_mySession = $.cookie('JSESSIONID');
                     g_sessionKey = encodeURIComponent(g_loginResponse.sessionkey);
                     g_role = g_loginResponse.type;
                     g_username = g_loginResponse.username;
@@ -238,8 +216,7 @@
                     async: false,
                     success: function(json) {
                         var loginresponse = json.loginresponse;
-
-                        g_mySession = $.cookie('JSESSIONID');
+                        
                         g_sessionKey = encodeURIComponent(loginresponse.sessionkey);
                         g_role = loginresponse.type;
                         g_username = loginresponse.username;
@@ -335,8 +312,7 @@
                 $.ajax({
                     url: createURL('logout'),
                     async: false,
-                    success: function() {
-                        g_mySession = null;
+                    success: function() {                        
                         g_sessionKey = null;
                         g_username = null;
                         g_account = null;
@@ -347,8 +323,7 @@
                         g_kvmsnapshotenabled = null;
                         g_regionsecondaryenabled = null;
                         g_loginCmdText = null;
-
-                        $.cookie('JSESSIONID', null);
+                        
                         $.cookie('sessionKey', null);
                         $.cookie('username', null);
                         $.cookie('account', null);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58455c08/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 8ec88b3..cba6fc6 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -14,7 +14,7 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
-var g_mySession = null;
+
 var g_sessionKey = null;
 var g_role = null; // roles - root, domain-admin, ro-admin, user
 var g_username = null;


[05/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7809: UI > remove unnecessary cookie 'timezoneoffset'.


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

Branch: refs/heads/master
Commit: 0d6a277a0051c191cc34645a0a70bf8e3515865e
Parents: 865b2e6
Author: Jessica Wang <je...@apache.org>
Authored: Tue Oct 28 16:35:36 2014 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Oct 28 16:35:36 2014 -0700

----------------------------------------------------------------------
 ui/scripts/cloudStack.js | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d6a277a/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index 0e63522..49af7f7 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -145,11 +145,7 @@
                     g_account = unBoxCookieValue('account');
                     g_username = unBoxCookieValue('username');
                     g_userfullname = unBoxCookieValue('userfullname');
-                    g_timezone = unBoxCookieValue('timezone');
-                    if ($.cookie('timezoneoffset') != null)
-                        g_timezoneoffset = isNaN(unBoxCookieValue('timezoneoffset')) ? null : parseFloat(unBoxCookieValue('timezoneoffset'));
-                    else
-                        g_timezoneoffset = null;
+                    g_timezone = unBoxCookieValue('timezone');                    
                 } else { //single-sign-on	(bypass login screen)
                     g_mySession = $.cookie('JSESSIONID');
                     g_sessionKey = encodeURIComponent(g_loginResponse.sessionkey);
@@ -159,11 +155,7 @@
                     g_account = g_loginResponse.account;
                     g_domainid = g_loginResponse.domainid;
                     g_userfullname = g_loginResponse.firstname + ' ' + g_loginResponse.lastname;
-                    g_timezone = g_loginResponse.timezone;
-                    if (g_loginResponse.timezoneoffset != null)
-                        g_timezoneoffset = isNaN(g_loginResponse.timezoneoffset) ? null : parseFloat(g_loginResponse.timezoneoffset);
-                    else
-                        g_timezoneoffset = null;
+                    g_timezone = g_loginResponse.timezone;                    
                 }
 
                 var userValid = false;
@@ -254,8 +246,7 @@
                         g_userid = loginresponse.userid;
                         g_account = loginresponse.account;
                         g_domainid = loginresponse.domainid;
-                        g_timezone = loginresponse.timezone;
-                        g_timezoneoffset = loginresponse.timezoneoffset;
+                        g_timezone = loginresponse.timezone;                        
                         g_userfullname = loginresponse.firstname + ' ' + loginresponse.lastname;
 
                         $.cookie('sessionKey', g_sessionKey, {
@@ -272,10 +263,7 @@
                         });
                         $.cookie('role', g_role, {
                             expires: 1
-                        });
-                        $.cookie('timezoneoffset', g_timezoneoffset, {
-                            expires: 1
-                        });
+                        });                        
                         $.cookie('timezone', g_timezone, {
                             expires: 1
                         });
@@ -365,8 +353,7 @@
                         $.cookie('username', null);
                         $.cookie('account', null);
                         $.cookie('domainid', null);
-                        $.cookie('role', null);                        
-                        $.cookie('timezoneoffset', null);
+                        $.cookie('role', null);  
                         $.cookie('timezone', null);
                         
                         if (onLogoutCallback()) { //onLogoutCallback() will set g_loginResponse(single-sign-on variable) to null, then bypassLoginCheck() will show login screen.


[19/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7632:Automation for volume life cycle testPath

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>
This closes #32


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

Branch: refs/heads/master
Commit: a69950f6a97819c9c071ad9f278377f2a5ca77ca
Parents: aa1e260
Author: Prashant Kumar Mishra <pr...@citrix.comm>
Authored: Thu Oct 9 11:42:56 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 18:30:25 2014 +0530

----------------------------------------------------------------------
 .../testpaths/testpath_volumelifecycle.py       | 967 ++++++++++++++-----
 1 file changed, 732 insertions(+), 235 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a69950f6/test/integration/testpaths/testpath_volumelifecycle.py
----------------------------------------------------------------------
diff --git a/test/integration/testpaths/testpath_volumelifecycle.py b/test/integration/testpaths/testpath_volumelifecycle.py
index d30f2b0..526d20c 100644
--- a/test/integration/testpaths/testpath_volumelifecycle.py
+++ b/test/integration/testpaths/testpath_volumelifecycle.py
@@ -16,11 +16,12 @@
 # under the License.
 """Utilities functions
 """
-#All tests inherit from cloudstackTestCase
+# All tests inherit from cloudstackTestCase
 from marvin.cloudstackTestCase import cloudstackTestCase
-#Import Integration Libraries
+# Import Integration Libraries
 from marvin.codes import FAILED, PASS
-#base - contains all resources as entities and defines create, delete, list operations on them
+# base - contains all resources as entities and defines create, delete,
+# list operations on them
 from marvin.lib.base import (Account,
                              VirtualMachine,
                              ServiceOffering,
@@ -28,10 +29,11 @@ from marvin.lib.base import (Account,
                              DiskOffering,
                              Volume,
                              Template,
-                             StoragePool)
+                             StoragePool,
+                             Resources)
 from marvin.lib.utils import cleanup_resources, validateList
 
-#common - commonly used methods for all tests are listed here
+# common - commonly used methods for all tests are listed here
 from marvin.lib.common import (get_zone,
                                get_domain,
                                get_template,
@@ -43,54 +45,97 @@ import tempfile
 
 
 def verify_attach_volume(self, vmid, volid):
-        list_volumes = Volume.list(self.userapiclient,
-                                   id=volid
-                                   )
-        self.assertEqual(validateList(list_volumes)[0], PASS, "Check List volume response for volume %s" % volid)
-        self.assertEqual(len(list_volumes), 1, "There is no data disk attached to vm id:%s" % vmid)
-        self.assertEqual(list_volumes[0].virtualmachineid, vmid, "Check if volume state (attached) is reflected")
-        self.debug("volume id:%s successfully attached to vm id%s" % (volid, vmid))
-        return
+    list_volumes = Volume.list(self.userapiclient,
+                               id=volid
+                               )
+    self.assertEqual(
+        validateList(list_volumes)[0],
+        PASS,
+        "Check List volume response for volume %s" %
+        volid)
+    self.assertEqual(
+        len(list_volumes),
+        1,
+        "There is no data disk attached to vm id:%s" %
+        vmid)
+    self.assertEqual(
+        list_volumes[0].virtualmachineid,
+        vmid,
+        "Check if volume state (attached) is reflected")
+    self.debug("volume id:%s successfully attached to vm id%s" % (volid, vmid))
+    return
 
 
 def verify_detach_volume(self, vmid, volid):
-        list_volumes = Volume.list(self.userapiclient,
-                                   id=volid
-                                   )
-        self.assertEqual(validateList(list_volumes)[0], PASS, "Check List volume response for volume %s" % volid)
-        self.assertEqual(len(list_volumes), 1, "Detach data disk id: %s  for vm id :%s was not successful" % (volid, vmid))
-        self.assertEqual(list_volumes[0].virtualmachineid, None, "Check if volume state (attached) is reflected")
-        self.debug("volume id: %s successfully detached from vm id:%s" % (volid, vmid))
+    list_volumes = Volume.list(self.userapiclient,
+                               id=volid
+                               )
+    self.assertEqual(
+        validateList(list_volumes)[0],
+        PASS,
+        "Check List volume response for volume %s" %
+        volid)
+    self.assertEqual(
+        len(list_volumes),
+        1,
+        "Detach data disk id: %s  for vm id :%s was not successful" %
+        (volid,
+         vmid))
+    self.assertEqual(
+        list_volumes[0].virtualmachineid,
+        None,
+        "Check if volume state (attached) is reflected")
+    self.debug(
+        "volume id: %s successfully detached from vm id:%s" %
+        (volid, vmid))
 
 
 def verify_vm(self, vmid):
-        list_vm = list_virtual_machines(self.userapiclient,
-                                        account=self.account.name,
-                                        domainid=self.account.domainid,
-                                        id=vmid
-                                        )
-        self.assertEqual(validateList(list_vm)[0], PASS, "Check List vm response for vmid: %s" % vmid)
-        self.assertGreater(len(list_vm), 0, "Check the list vm response for vm id:  %s" % vmid)
-        vm = list_vm[0]
-        self.assertEqual(vm.id, str(vmid), "Vm deployed is different from the test")
-        self.assertEqual(vm.state, "Running", "VM is not in Running state")
-        self.debug("VM got created successfully %s" % vmid)
+    list_vm = list_virtual_machines(self.userapiclient,
+                                    account=self.account.name,
+                                    domainid=self.account.domainid,
+                                    id=vmid
+                                    )
+    self.assertEqual(
+        validateList(list_vm)[0],
+        PASS,
+        "Check List vm response for vmid: %s" %
+        vmid)
+    self.assertGreater(
+        len(list_vm),
+        0,
+        "Check the list vm response for vm id:  %s" %
+        vmid)
+    vm = list_vm[0]
+    self.assertEqual(
+        vm.id,
+        str(vmid),
+        "Vm deployed is different from the test")
+    self.assertEqual(vm.state, "Running", "VM is not in Running state")
+    self.debug("VM got created successfully %s" % vmid)
 
 
 class TestPathVolume(cloudstackTestCase):
+
     @classmethod
     def setUpClass(cls):
         testClient = super(TestPathVolume, cls).getClsTestClient()
         cls.apiclient = testClient.getApiClient()
         cls.testdata = testClient.getParsedTestDataConfig()
-        #Get Zone,Domain and templates
+        # Get Zone,Domain and templates
         cls.domain = get_domain(cls.apiclient)
         cls.zone = get_zone(cls.apiclient)
         cls.testdata["mode"] = cls.zone.networktype
-        cls.template = get_template(cls.apiclient, cls.zone.id, cls.testdata["ostype"])
+        cls.template = get_template(
+            cls.apiclient,
+            cls.zone.id,
+            cls.testdata["ostype"])
         cls.testdata["template"]["ostypeid"] = cls.template.ostypeid
         if cls.template == FAILED:
-                cls.fail("get_template() failed to return template with description %s" % cls.testdata["ostype"])
+            cls.fail(
+                "get_template() failed to return template with description \
+                %s" %
+                cls.testdata["ostype"])
         cls._cleanup = []
         try:
             cls.account = Account.create(cls.apiclient,
@@ -98,61 +143,77 @@ class TestPathVolume(cloudstackTestCase):
                                          domainid=cls.domain.id
                                          )
             cls._cleanup.append(cls.account)
-            #createa two service offerings
-            cls.service_offering_1 = ServiceOffering.create(cls.apiclient, cls.testdata["service_offerings"]["small"])
+            # createa two service offerings
+            cls.service_offering_1 = ServiceOffering.create(
+                cls.apiclient,
+                cls.testdata["service_offerings"]["small"])
             cls._cleanup.append(cls.service_offering_1)
             # Create Disk offerings
-            cls.disk_offering_1 = DiskOffering.create(cls.apiclient, cls.testdata["disk_offering"])
+            cls.disk_offering_1 = DiskOffering.create(
+                cls.apiclient,
+                cls.testdata["disk_offering"])
             cls._cleanup.append(cls.disk_offering_1)
-            #check if zone wide storage is enable
+            # check if zone wide storage is enable
             cls.list_storage = StoragePool.list(cls.apiclient,
                                                 scope="ZONE"
                                                 )
             if cls.list_storage:
                 cls.zone_wide_storage = cls.list_storage[0]
-                cls.debug("zone wide storage id is %s" % cls.zone_wide_storage.id)
+                cls.debug(
+                    "zone wide storage id is %s" %
+                    cls.zone_wide_storage.id)
                 cls.testdata["tags"] = "zp"
                 update1 = StoragePool.update(cls.apiclient,
                                              id=cls.zone_wide_storage.id,
                                              tags=cls.testdata["tags"]
                                              )
-                cls.debug("Storage %s pool tag%s" % (cls.zone_wide_storage.id, update1.tags))
+                cls.debug(
+                    "Storage %s pool tag%s" %
+                    (cls.zone_wide_storage.id, update1.tags))
                 cls.testdata["service_offerings"]["tags"] = "zp"
-                cls.tagged_so = ServiceOffering.create(cls.apiclient, cls.testdata["service_offerings"])
+                cls.tagged_so = ServiceOffering.create(
+                    cls.apiclient,
+                    cls.testdata["service_offerings"])
                 cls.testdata["service_offerings"]["tags"] = " "
                 cls._cleanup.append(cls.tagged_so)
-                #create tagged disk offerings
+                # create tagged disk offerings
                 cls.testdata["disk_offering"]["tags"] = "zp"
-                cls.disk_offering_tagged = DiskOffering.create(cls.apiclient, cls.testdata["disk_offering"])
+                cls.disk_offering_tagged = DiskOffering.create(
+                    cls.apiclient,
+                    cls.testdata["disk_offering"])
                 cls._cleanup.append(cls.disk_offering_tagged)
             else:
                 cls.debug("No zone wide storage found")
-            #check if local storage is enable
+            # check if local storage is enable
             if cls.zone.localstorageenabled:
                 cls.testdata["disk_offering"]["tags"] = " "
                 cls.testdata["service_offerings"]["storagetype"] = 'local'
-                cls.service_offering_2 = ServiceOffering.create(cls.apiclient, cls.testdata["service_offerings"])
+                cls.service_offering_2 = ServiceOffering.create(
+                    cls.apiclient,
+                    cls.testdata["service_offerings"])
                 cls._cleanup.append(cls.service_offering_2)
-                #craete a compute offering with local storage
+                # craete a compute offering with local storage
                 cls.testdata["disk_offering"]["storagetype"] = 'local'
-                cls.disk_offering_local = DiskOffering.create(cls.apiclient, cls.testdata["disk_offering"])
+                cls.disk_offering_local = DiskOffering.create(
+                    cls.apiclient,
+                    cls.testdata["disk_offering"])
                 cls._cleanup.append(cls.disk_offering_local)
                 cls.testdata["disk_offering"]["storagetype"] = ' '
             else:
                 cls.debug("No local storage found")
-            cls.userapiclient = testClient.getUserApiClient(UserName=cls.account.name,
-                                                            DomainName=cls.account.domain
-                                                            )
-            #Check if login is successful with new account
+            cls.userapiclient = testClient.getUserApiClient(
+                UserName=cls.account.name,
+                DomainName=cls.account.domain)
+            # Check if login is successful with new account
             response = User.login(cls.userapiclient,
                                   username=cls.account.name,
                                   password=cls.testdata["account"]["password"]
                                   )
             assert response.sessionkey is not None
-            #response should have non null value
+            # response should have non null value
         except Exception as e:
-                cls.tearDownClass()
-                raise e
+            cls.tearDownClass()
+            raise e
         return
 
     @classmethod
@@ -162,13 +223,19 @@ class TestPathVolume(cloudstackTestCase):
         except Exception as e:
             raise Exception("Warning:Exception during cleanup: %s" % e)
 
-    @attr(tags=["advanced", "advancedsg", "basic", ], required_hardware="false")
-    def test_01_positive_test_1(self):
+    @attr(
+        tags=[
+            "advanced",
+            "advancedsg",
+            "basic",
+        ],
+        required_hardware="false")
+    def test_01_positive_path(self):
         """
         positive test for volume life cycle
         # 1. Deploy a vm [vm1] with shared storage and data disk
         # 2. Deploy a vm [vm2]with shared storage without data disk
-        # 3.
+        # 3. TBD
         # 4. Create a new volume and attache to vm2
         # 5. Detach data disk from vm1 and download it
         #  Variance(1-9)
@@ -179,50 +246,63 @@ class TestPathVolume(cloudstackTestCase):
         # 10. Create new VM using the template created in step 9
         # 11. Delete the template
         # 12. Detach the disk from VM2 and re-attach the disk to VM1
-        # 13.
-        # 14.
+        # 13.TBD
+        # 14.TBD
         # 15.Migrate volume(detached) and then attach to a vm and live-migrate
-        # 16.Upload volume of size smaller  than storage.max.volume.upload.size(leaving the negative case)
-        # 17.NA
-        # 18.
-        # 19.NA
+        # 16.Upload volume of size smaller  than
+            storage.max.volume.upload.size(leaving the negative case)
+        # 17.TBD
+        # 18.TBD
+        # 19.TBD
         # 20.Detach data disks from VM2 and delete volume
 
         """
+
         # 1. Deploy a vm [vm1] with shared storage and data disk
-        self.virtual_machine_1 = VirtualMachine.create(self.userapiclient,
-                                                       self.testdata["small"],
-                                                       templateid=self.template.id,
-                                                       accountid=self.account.name,
-                                                       domainid=self.account.domainid,
-                                                       serviceofferingid=self.service_offering_1.id,
-                                                       zoneid=self.zone.id,
-                                                       diskofferingid=self.disk_offering_1.id,
-                                                       mode=self.testdata["mode"]
-                                                       )
+        self.virtual_machine_1 = VirtualMachine.create(
+            self.userapiclient,
+            self.testdata["small"],
+            templateid=self.template.id,
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering_1.id,
+            zoneid=self.zone.id,
+            diskofferingid=self.disk_offering_1.id,
+            mode=self.testdata["mode"])
         verify_vm(self, self.virtual_machine_1.id)
         # List data volume for vm1
         list_volume = Volume.list(self.userapiclient,
                                   virtualmachineid=self.virtual_machine_1.id,
                                   type='DATADISK'
                                   )
-        self.assertEqual(validateList(list_volume)[0], PASS, "Check List volume response for vm id  %s" % self.virtual_machine_1.id)
+        self.assertEqual(
+            validateList(list_volume)[0],
+            PASS,
+            "Check List volume response for vm id  %s" %
+            self.virtual_machine_1.id)
         list_data_volume_for_vm1 = list_volume[0]
-        self.assertEqual(len(list_volume), 1, "There is no data disk attached to vm id:%s" % self.virtual_machine_1.id)
-        self.assertEqual(list_data_volume_for_vm1.virtualmachineid, str(self.virtual_machine_1.id), "Check if volume state (attached) is reflected")
+        self.assertEqual(
+            len(list_volume),
+            1,
+            "There is no data disk attached to vm id:%s" %
+            self.virtual_machine_1.id)
+        self.assertEqual(
+            list_data_volume_for_vm1.virtualmachineid, str(
+                self.virtual_machine_1.id),
+            "Check if volume state (attached) is reflected")
         # 2. Deploy a vm [vm2]with shared storage without data disk
-        self.virtual_machine_2 = VirtualMachine.create(self.userapiclient,
-                                                       self.testdata["small"],
-                                                       templateid=self.template.id,
-                                                       accountid=self.account.name,
-                                                       domainid=self.account.domainid,
-                                                       serviceofferingid=self.service_offering_1.id,
-                                                       zoneid=self.zone.id,
-                                                       mode=self.testdata["mode"]
-                                                       )
+        self.virtual_machine_2 = VirtualMachine.create(
+            self.userapiclient,
+            self.testdata["small"],
+            templateid=self.template.id,
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering_1.id,
+            zoneid=self.zone.id,
+            mode=self.testdata["mode"])
         verify_vm(self, self.virtual_machine_2.id)
 
-        #4. Create a new volume and attache to vm2
+        # 4. Create a new volume and attache to vm2
         self.volume = Volume.create(self.userapiclient,
                                     services=self.testdata["volume"],
                                     diskofferingid=self.disk_offering_1.id,
@@ -232,152 +312,217 @@ class TestPathVolume(cloudstackTestCase):
         list_data_volume = Volume.list(self.userapiclient,
                                        id=self.volume.id
                                        )
-        self.assertEqual(validateList(list_data_volume)[0], PASS, "Check List volume response for volume %s" % self.volume.id)
-        self.assertEqual(list_data_volume[0].id, self.volume.id, "check list volume response for volume id:  %s" % self.volume.id)
-        self.debug("volume id %s got created successfully" % list_data_volume[0].id)
+        self.assertEqual(
+            validateList(list_data_volume)[0],
+            PASS,
+            "Check List volume response for volume %s" %
+            self.volume.id)
+        self.assertEqual(
+            list_data_volume[0].id,
+            self.volume.id,
+            "check list volume response for volume id:  %s" %
+            self.volume.id)
+        self.debug(
+            "volume id %s got created successfully" %
+            list_data_volume[0].id)
         # Attach volume to vm2
         self.virtual_machine_2.attach_volume(self.userapiclient,
                                              self.volume
                                              )
         verify_attach_volume(self, self.virtual_machine_2.id, self.volume.id)
 
-        #Variance
+        # Variance
         if self.zone.localstorageenabled:
             # V1.Create vm3 with local storage offering
-            self.virtual_machine_local_3=VirtualMachine.create(self.userapiclient,
-                                                               self.testdata["small"],
-                                                               templateid=self.template.id,
-                                                               accountid=self.account.name,
-                                                               domainid=self.account.domainid,
-                                                               serviceofferingid=self.service_offering_2.id,
-                                                               zoneid=self.zone.id,
-                                                               mode=self.testdata["mode"]
-                                                               )
+            self.virtual_machine_local_3 = VirtualMachine.create(
+                self.userapiclient,
+                self.testdata["small"],
+                templateid=self.template.id,
+                accountid=self.account.name,
+                domainid=self.account.domainid,
+                serviceofferingid=self.service_offering_2.id,
+                zoneid=self.zone.id,
+                mode=self.testdata["mode"])
             verify_vm(self, self.virtual_machine_local_3.id)
 
             # V2.create two data disk on local storage
             self.local_volumes = []
             for i in range(2):
 
-                    local_volume = Volume.create(self.userapiclient,
-                                                 services=self.testdata["volume"],
-                                                 diskofferingid=self.disk_offering_local.id,
-                                                 zoneid=self.zone.id
-                                                 )
+                local_volume = Volume.create(
+                    self.userapiclient,
+                    services=self.testdata["volume"],
+                    diskofferingid=self.disk_offering_local.id,
+                    zoneid=self.zone.id)
 
-                    list_local_data_volume = Volume.list(self.userapiclient,
-                                                         id=local_volume.id
-                                                         )
-                    self.assertEqual(validateList(list_local_data_volume)[0], PASS, "Check List volume response for volume %s" % local_volume.id)
-                    self.assertEqual(list_local_data_volume[0].id, local_volume.id, "check list volume response for volume id:  %s" % local_volume.id)
-                    self.debug("volume id %s got created successfully" % list_local_data_volume[0].id)
-                    self.local_volumes.append(local_volume)
+                list_local_data_volume = Volume.list(self.userapiclient,
+                                                     id=local_volume.id
+                                                     )
+                self.assertEqual(
+                    validateList(list_local_data_volume)[0],
+                    PASS,
+                    "Check List volume response for volume %s" %
+                    local_volume.id)
+                self.assertEqual(
+                    list_local_data_volume[0].id,
+                    local_volume.id,
+                    "check list volume response for volume id:  %s" %
+                    local_volume.id)
+                self.debug(
+                    "volume id %s got created successfully" %
+                    list_local_data_volume[0].id)
+                self.local_volumes.append(local_volume)
             # V3.Attach local disk to vm1
             self.virtual_machine_1.attach_volume(self.userapiclient,
                                                  self.local_volumes[0]
                                                  )
-            verify_attach_volume(self, self.virtual_machine_1.id, self.local_volumes[0].id)
+            verify_attach_volume(
+                self,
+                self.virtual_machine_1.id,
+                self.local_volumes[0].id)
         if self.list_storage:
             # V4.create vm4 with zone wide storage
-            self.virtual_machine_zone_4 = VirtualMachine.create(self.userapiclient,
-                                                                self.testdata["small"],
-                                                                templateid=self.template.id,
-                                                                accountid=self.account.name,
-                                                                domainid=self.account.domainid,
-                                                                serviceofferingid=self.tagged_so.id,
-                                                                zoneid=self.zone.id,
-                                                                mode=self.testdata["mode"]
-                                                                )
+            self.virtual_machine_zone_4 = VirtualMachine.create(
+                self.userapiclient,
+                self.testdata["small"],
+                templateid=self.template.id,
+                accountid=self.account.name,
+                domainid=self.account.domainid,
+                serviceofferingid=self.tagged_so.id,
+                zoneid=self.zone.id,
+                mode=self.testdata["mode"])
             verify_vm(self, self.virtual_machine_zone_4.id)
 
             # V5.Create two data disk on zone  wide storage
             self.zone_volumes = []
             for i in range(2):
 
-                    zone_volume = Volume.create(self.userapiclient,
-                                                services=self.testdata["volume"],
-                                                diskofferingid=self.disk_offering_tagged.id,
-                                                zoneid=self.zone.id
-                                                )
+                zone_volume = Volume.create(
+                    self.userapiclient,
+                    services=self.testdata["volume"],
+                    diskofferingid=self.disk_offering_tagged.id,
+                    zoneid=self.zone.id)
 
-                    list_zone_data_volume = Volume.list(self.userapiclient,
-                                                        id=zone_volume.id
-                                                        )
-                    self.assertEqual(validateList(list_zone_data_volume)[0], PASS, "Check List volume response for volume %s" % zone_volume.id)
-                    self.assertEqual(list_zone_data_volume[0].id, zone_volume.id, "check list volume response for volume id:  %s" % zone_volume.id)
-                    self.debug("volume id:%s got created successfully" % list_zone_data_volume[0].id)
-                    self.zone_volumes.append(zone_volume)
+                list_zone_data_volume = Volume.list(self.userapiclient,
+                                                    id=zone_volume.id
+                                                    )
+                self.assertEqual(
+                    validateList(list_zone_data_volume)[0],
+                    PASS,
+                    "Check List volume response for volume %s" %
+                    zone_volume.id)
+                self.assertEqual(
+                    list_zone_data_volume[0].id,
+                    zone_volume.id,
+                    "check list volume response for volume id:  %s" %
+                    zone_volume.id)
+                self.debug(
+                    "volume id:%s got created successfully" %
+                    list_zone_data_volume[0].id)
+                self.zone_volumes.append(zone_volume)
 
             # V6.Attach data disk running on ZWPS to VM1 (root disk on shared)
             self.virtual_machine_1.attach_volume(self.userapiclient,
                                                  self.zone_volumes[0]
                                                  )
-            verify_attach_volume(self, self.virtual_machine_1.id, self.zone_volumes[0].id)
-            # V7. Create a cluster wide volume and attach to vm running on zone wide storage
-            self.cluster_volume = Volume.create(self.userapiclient,
-                                                services=self.testdata["volume"],
-                                                diskofferingid=self.disk_offering_1.id,
-                                                zoneid=self.zone.id
-                                                )
+            verify_attach_volume(
+                self,
+                self.virtual_machine_1.id,
+                self.zone_volumes[0].id)
+            # V7. Create a cluster wide volume and attach to vm running on zone
+            # wide storage
+            self.cluster_volume = Volume.create(
+                self.userapiclient,
+                services=self.testdata["volume"],
+                diskofferingid=self.disk_offering_1.id,
+                zoneid=self.zone.id)
             list_cluster_volume = Volume.list(self.userapiclient,
                                               id=self.cluster_volume.id
                                               )
-            self.assertEqual(validateList(list_cluster_volume)[0], PASS, "Check List volume response for volume %s" % self.cluster_volume.id)
-            self.assertEqual(list_cluster_volume[0].id, str(self.cluster_volume.id), "volume does not exist %s" % self.cluster_volume.id)
-            self.debug("volume id %s got created successfuly" % list_cluster_volume[0].id)
+            self.assertEqual(
+                validateList(list_cluster_volume)[0],
+                PASS,
+                "Check List volume response for volume %s" %
+                self.cluster_volume.id)
+            self.assertEqual(
+                list_cluster_volume[0].id, str(
+                    self.cluster_volume.id), "volume does not exist %s" %
+                self.cluster_volume.id)
+            self.debug(
+                "volume id %s got created successfuly" %
+                list_cluster_volume[0].id)
             self.virtual_machine_zone_4.attach_volume(self.userapiclient,
                                                       self.cluster_volume
                                                       )
-            verify_attach_volume(self, self.virtual_machine_zone_4.id, self.cluster_volume.id)
+            verify_attach_volume(
+                self,
+                self.virtual_machine_zone_4.id,
+                self.cluster_volume.id)
         if self.list_storage and self.zone.localstorageenabled:
-            #V8.Attach zone wide volume to vm running on local storage
+            # V8.Attach zone wide volume to vm running on local storage
             self.virtual_machine_local_3.attach_volume(self.userapiclient,
                                                        self.zone_volumes[1]
                                                        )
-            verify_attach_volume(self, self.virtual_machine_local_3.id, self.zone_volumes[1].id)
+            verify_attach_volume(
+                self,
+                self.virtual_machine_local_3.id,
+                self.zone_volumes[1].id)
             # V9.Attach local volume to a vm running on zone wide storage
             self.virtual_machine_zone_4.attach_volume(self.userapiclient,
                                                       self.local_volumes[1]
                                                       )
-            verify_attach_volume(self, self.virtual_machine_zone_4.id, self.local_volumes[1].id)
+            verify_attach_volume(
+                self,
+                self.virtual_machine_zone_4.id,
+                self.local_volumes[1].id)
         # 5. Detach data disk from vm1 and download it
         self.virtual_machine_1.detach_volume(self.userapiclient,
                                              volume=list_data_volume_for_vm1
                                              )
-        verify_detach_volume(self, self.virtual_machine_1.id, list_data_volume_for_vm1.id)
+        verify_detach_volume(
+            self,
+            self.virtual_machine_1.id,
+            list_data_volume_for_vm1.id)
         # download detached volume
-        self.extract_volume = Volume.extract(self.userapiclient,
-                                             volume_id=list_data_volume_for_vm1.id,
-                                             zoneid=self.zone.id,
-                                             mode='HTTP_DOWNLOAD'
-                                             )
+        self.extract_volume = Volume.extract(
+            self.userapiclient,
+            volume_id=list_data_volume_for_vm1.id,
+            zoneid=self.zone.id,
+            mode='HTTP_DOWNLOAD')
 
         self.debug("extracted url is%s  :" % self.extract_volume.url)
         try:
 
             formatted_url = urllib.unquote_plus(self.extract_volume.url)
-            self.debug("Attempting to download volume at url %s" % formatted_url)
+            self.debug(
+                "Attempting to download volume at url %s" %
+                formatted_url)
             response = urllib.urlopen(formatted_url)
             self.debug("response from volume url %s" % response.getcode())
             fd, path = tempfile.mkstemp()
-            self.debug("Saving volume %s to path %s" % (list_data_volume_for_vm1.id, path))
+            self.debug(
+                "Saving volume %s to path %s" %
+                (list_data_volume_for_vm1.id, path))
             os.close(fd)
             with open(path, 'wb') as fd:
                 fd.write(response.read())
             self.debug("Saved volume successfully")
         except Exception:
-            self.fail("Extract Volume Failed with invalid URL %s (vol id: %s)" % (self.extract_volume, list_data_volume_for_vm1.id))
-        #Need to get format for downloaded volume ,for now using default format VHD
+            self.fail(
+                "Extract Volume Failed with invalid URL %s (vol id: %s)" %
+                (self.extract_volume, list_data_volume_for_vm1.id))
+        # checking  format of  downloaded volume and assigning to
+        # testdata["volume_upload"]
         if "OVA" in self.extract_volume.url.upper():
             self.testdata["upload_volume"]["format"] = "OVA"
         if "QCOW2" in self.extract_volume.url.upper():
             self.testdata["upload_volume"]["format"] = "QCOW2"
         # 6. Upload volume by providing url of downloaded volume in step 5
-        self.upload_response = Volume.upload(self.userapiclient,
-                                             zoneid=self.zone.id,
-                                             url=self.extract_volume.url,
-                                             services=self.testdata["upload_volume"]
-                                             )
+        self.upload_response = Volume.upload(
+            self.userapiclient,
+            zoneid=self.zone.id,
+            url=self.extract_volume.url,
+            services=self.testdata["upload_volume"])
         self.upload_response.wait_for_upload(self.userapiclient
                                              )
         self.debug("uploaded volume id is %s" % self.upload_response.id)
@@ -385,122 +530,201 @@ class TestPathVolume(cloudstackTestCase):
         self.virtual_machine_2.attach_volume(self.userapiclient,
                                              volume=self.upload_response
                                              )
-        verify_attach_volume(self, self.virtual_machine_2.id, self.upload_response.id)
+        verify_attach_volume(
+            self,
+            self.virtual_machine_2.id,
+            self.upload_response.id)
         # 8. Try to delete an attached volume
         try:
             self.volume.delete(self.userapiclient
                                )
-            self.fail("Volume got deleted in attached state %s " % self.volume.id)
+            self.fail(
+                "Volume got deleted in attached state %s " %
+                self.volume.id)
         except Exception as e:
             self.debug("Attached volume deletion failed because  %s" % e)
-        #9. Create template from root volume of VM1(stop VM->create template -> start vm)
+        # 9. Create template from root volume of VM1(stop VM->create template
+        # -> start vm)
 
         self.virtual_machine_1.stop(self.userapiclient
                                     )
 
-        self.list_root_disk_for_vm1 = Volume.list(self.userapiclient,
-                                                  virtualmachineid=self.virtual_machine_1.id,
-                                                  type='ROOT'
-                                                  )
-        self.assertEqual(validateList(self.list_root_disk_for_vm1)[0], PASS, "Check List volume response for vm %s" % self.virtual_machine_1.id)
-        self.assertEqual(len(self.list_root_disk_for_vm1), 1, "list root disk for vm1 is empty : %s" % self.virtual_machine_1.id)
-        self.template_from_vm1_root_disk = Template.create(self.userapiclient,
-                                                           self.testdata["template"],
-                                                           self.list_root_disk_for_vm1[0].id,
-                                                           account=self.account.name,
-                                                           domainid=self.account.domainid
-                                                           )
-        list_template = Template.list(self.userapiclient,
-                                      templatefilter=self.testdata["templatefilter"],
-                                      id=self.template_from_vm1_root_disk.id
-                                      )
-        self.assertEqual(validateList(list_template)[0], PASS, "Check List template response for template id %s" % self.template_from_vm1_root_disk.id)
-        self.assertEqual(len(list_template), 1, "list template response is empty for template id  : %s" % list_template[0].id)
-        self.assertEqual(list_template[0].id, self.template_from_vm1_root_disk.id, "list template id is not same as created template")
-        self.debug("Template id:%s got created successfully" % self.template_from_vm1_root_disk.id)
+        self.list_root_disk_for_vm1 = Volume.list(
+            self.userapiclient,
+            virtualmachineid=self.virtual_machine_1.id,
+            type='ROOT')
+        self.assertEqual(
+            validateList(
+                self.list_root_disk_for_vm1)[0],
+            PASS,
+            "Check List volume response for vm %s" %
+            self.virtual_machine_1.id)
+        self.assertEqual(
+            len(
+                self.list_root_disk_for_vm1),
+            1,
+            "list root disk for vm1 is empty : %s" %
+            self.virtual_machine_1.id)
+        self.template_from_vm1_root_disk = Template.create(
+            self.userapiclient,
+            self.testdata["template"],
+            self.list_root_disk_for_vm1[0].id,
+            account=self.account.name,
+            domainid=self.account.domainid)
+        list_template = Template.list(
+            self.userapiclient,
+            templatefilter=self.testdata["templatefilter"],
+            id=self.template_from_vm1_root_disk.id)
+        self.assertEqual(
+            validateList(list_template)[0],
+            PASS,
+            "Check List template response for template id %s" %
+            self.template_from_vm1_root_disk.id)
+        self.assertEqual(
+            len(list_template),
+            1,
+            "list template response is empty for template id  : %s" %
+            list_template[0].id)
+        self.assertEqual(
+            list_template[0].id,
+            self.template_from_vm1_root_disk.id,
+            "list template id is not same as created template")
+        self.debug(
+            "Template id:%s got created successfully" %
+            self.template_from_vm1_root_disk.id)
         self.virtual_machine_1.start(self.userapiclient
                                      )
         # 10. Deploy a vm using template ,created  from vm1's root disk
 
-        self.virtual_machine_3 = VirtualMachine.create(self.userapiclient,
-                                                       self.testdata["small"],
-                                                       templateid=self.template_from_vm1_root_disk.id,
-                                                       accountid=self.account.name,
-                                                       domainid=self.account.domainid,
-                                                       serviceofferingid=self.service_offering_1.id,
-                                                       zoneid=self.zone.id,
-                                                       mode=self.testdata["mode"]
-                                                       )
+        self.virtual_machine_3 = VirtualMachine.create(
+            self.userapiclient,
+            self.testdata["small"],
+            templateid=self.template_from_vm1_root_disk.id,
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering_1.id,
+            zoneid=self.zone.id,
+            mode=self.testdata["mode"])
         verify_vm(self, self.virtual_machine_3.id)
 
         # 11.delete the template created from root disk of vm1
         try:
             self.template_from_vm1_root_disk.delete(self.userapiclient
                                                     )
-            self.debug("Template id: %s got deleted successfuly" % self.template_from_vm1_root_disk.id)
+            self.debug(
+                "Template id: %s got deleted successfuly" %
+                self.template_from_vm1_root_disk.id)
         except Exception as e:
             raise Exception("Template deletion failed with error %s" % e)
-        list_template = Template.list(self.userapiclient,
-                                      templatefilter=self.testdata["templatefilter"],
-                                      id=self.template_from_vm1_root_disk.id
-                                      )
-        self.assertEqual(list_template, None, "Template is not deleted, id %s:" % self.template_from_vm1_root_disk.id)
-        self.debug("Template id%s got deleted successfully" % self.template_from_vm1_root_disk.id)
+        list_template = Template.list(
+            self.userapiclient,
+            templatefilter=self.testdata["templatefilter"],
+            id=self.template_from_vm1_root_disk.id)
+        self.assertEqual(
+            list_template,
+            None,
+            "Template is not deleted, id %s:" %
+            self.template_from_vm1_root_disk.id)
+        self.debug(
+            "Template id%s got deleted successfully" %
+            self.template_from_vm1_root_disk.id)
 
         # List vm and check the state of vm
         verify_vm(self, self.virtual_machine_3.id)
 
-        #12.Detach the disk from VM2 and re-attach the disk to VM1
+        # 12.Detach the disk from VM2 and re-attach the disk to VM1
         self.virtual_machine_2.detach_volume(self.userapiclient,
                                              volume=self.upload_response
                                              )
-        verify_detach_volume(self, self.virtual_machine_2.id, self.upload_response.id)
+        verify_detach_volume(
+            self,
+            self.virtual_machine_2.id,
+            self.upload_response.id)
 
         self.virtual_machine_1.attach_volume(self.userapiclient,
                                              volume=self.upload_response
                                              )
 
-        verify_attach_volume(self, self.virtual_machine_1.id, self.upload_response.id)
+        verify_attach_volume(
+            self,
+            self.virtual_machine_1.id,
+            self.upload_response.id)
 
         # 15.Migrate volume(detached) and then attach to a vm and live-migrate
-        self.migrate_volume = Volume.create(self.userapiclient,
-                                            services=self.testdata["volume"],
-                                            diskofferingid=self.disk_offering_1.id,
-                                            zoneid=self.zone.id
-                                            )
+        self.migrate_volume = Volume.create(
+            self.userapiclient,
+            services=self.testdata["volume"],
+            diskofferingid=self.disk_offering_1.id,
+            zoneid=self.zone.id)
         list_volume = Volume.list(self.apiclient,
                                   id=self.migrate_volume.id
                                   )
-        self.assertEqual(validateList(list_volume)[0], PASS, "Check List volume response for volume %s" % self.migrate_volume.id)
-        self.assertEqual(list_volume[0].id, str(self.migrate_volume.id), "volume does not exist %s" % self.migrate_volume.id)
+        self.assertEqual(
+            validateList(list_volume)[0],
+            PASS,
+            "Check List volume response for volume %s" %
+            self.migrate_volume.id)
+        self.assertEqual(
+            list_volume[0].id, str(
+                self.migrate_volume.id), "volume does not exist %s" %
+            self.migrate_volume.id)
         self.debug("volume id %s got created successfuly" % list_volume[0].id)
 
         self.virtual_machine_1.attach_volume(self.userapiclient,
                                              self.migrate_volume
                                              )
-        verify_attach_volume(self, self.virtual_machine_1.id, self.migrate_volume.id)
+        verify_attach_volume(
+            self,
+            self.virtual_machine_1.id,
+            self.migrate_volume.id)
 
         self.virtual_machine_1.detach_volume(self.userapiclient,
                                              volume=self.migrate_volume
                                              )
-        verify_detach_volume(self, self.virtual_machine_1.id, self.migrate_volume.id)
+        verify_detach_volume(
+            self,
+            self.virtual_machine_1.id,
+            self.migrate_volume.id)
 
         list_volume = Volume.list(self.apiclient,
                                   id=self.migrate_volume.id
                                   )
-        self.assertEqual(validateList(list_volume)[0], PASS, "Check List volume response for volume %s" % self.migrate_volume.id)
-        self.assertEqual(list_volume[0].id, str(self.migrate_volume.id), "volume does not exist %s" % self.migrate_volume.id)
+        self.assertEqual(
+            validateList(list_volume)[0],
+            PASS,
+            "Check List volume response for volume %s" %
+            self.migrate_volume.id)
+        self.assertEqual(
+            list_volume[0].id, str(
+                self.migrate_volume.id), "volume does not exist %s" %
+            self.migrate_volume.id)
         self.debug("volume id %s got created successfuly" % list_volume[0].id)
         list_pool = StoragePool.list(self.apiclient,
                                      id=list_volume[0].storageid
                                      )
-        self.assertEqual(validateList(list_pool)[0], PASS, "Check List pool response for storage id %s" % list_volume[0].storageid)
-        self.assertGreater(len(list_pool), 0, "Check the list list storagepoolresponse for vm id:  %s" % list_volume[0].storageid)
+        self.assertEqual(
+            validateList(list_pool)[0],
+            PASS,
+            "Check List pool response for storage id %s" %
+            list_volume[0].storageid)
+        self.assertGreater(
+            len(list_pool),
+            0,
+            "Check the list list storagepoolresponse for vm id:  %s" %
+            list_volume[0].storageid)
         list_pools = StoragePool.list(self.apiclient,
                                       scope=list_pool[0].scope
                                       )
-        self.assertEqual(validateList(list_pools)[0], PASS, "Check List pool response for scope %s" % list_pool[0].scope)
-        self.assertGreater(len(list_pools), 0, "Check the list vm response for scope :%s" % list_volume[0].scope)
+        self.assertEqual(
+            validateList(list_pools)[0],
+            PASS,
+            "Check List pool response for scope %s" %
+            list_pool[0].scope)
+        self.assertGreater(
+            len(list_pools),
+            0,
+            "Check the list vm response for scope :%s" %
+            list_volume[0].scope)
         storagepoolid = None
         for i in range(len(list_pools)):
             if list_volume[0].storageid != list_pools[i].id:
@@ -521,29 +745,43 @@ class TestPathVolume(cloudstackTestCase):
             self.virtual_machine_2.attach_volume(self.userapiclient,
                                                  self.migrate_volume
                                                  )
-            verify_attach_volume(self, self.virtual_machine_2.id, self.migrate_volume.id)
+            verify_attach_volume(
+                self,
+                self.virtual_machine_2.id,
+                self.migrate_volume.id)
 
-            pool_for_migration = StoragePool.listForMigration(self.apiclient,
-                                                              id=self.migrate_volume.id
-                                                              )
-            self.assertEqual(validateList(pool_for_migration)[0], PASS, "Check list pool For Migration response for volume %s" % self.migrate_volume.id)
-            self.assertGreater(len(pool_for_migration), 0, "Check the listForMigration response for volume :%s" % self.migrate_volume.id)
+            pool_for_migration = StoragePool.listForMigration(
+                self.apiclient,
+                id=self.migrate_volume.id)
+            self.assertEqual(
+                validateList(pool_for_migration)[0],
+                PASS,
+                "Check list pool For Migration response for volume %s" %
+                self.migrate_volume.id)
+            self.assertGreater(
+                len(pool_for_migration),
+                0,
+                "Check the listForMigration response for volume :%s" %
+                self.migrate_volume.id)
             try:
-                volume_migrate = Volume.migrate(self.apiclient,
-                                                storageid=pool_for_migration[0].id,
-                                                volumeid=self.migrate_volume.id,
-                                                livemigrate=True
-                                                )
+                volume_migrate = Volume.migrate(
+                    self.apiclient,
+                    storageid=pool_for_migration[0].id,
+                    volumeid=self.migrate_volume.id,
+                    livemigrate=True)
             except Exception as e:
                 raise Exception("Volume migration failed with error %s" % e)
         else:
             try:
                 self.migrate_volume.delete(self.userapiclient
                                            )
-                self.debug("volume id:%s got deleted successfully " % self.migrate_volume.id)
+                self.debug(
+                    "volume id:%s got deleted successfully " %
+                    self.migrate_volume.id)
             except Exception as e:
                 raise Exception("Volume deletion failed with error %s" % e)
-        # 16.Upload volume of size smaller  than storage.max.volume.upload.size(leaving the negative case)
+        # 16.Upload volume of size smaller  than
+        # storage.max.volume.upload.size(leaving the negative case)
         self.testdata["upload_volume"]["format"] = "VHD"
         volume_upload = Volume.upload(self.userapiclient,
                                       self.testdata["upload_volume"],
@@ -551,7 +789,9 @@ class TestPathVolume(cloudstackTestCase):
                                       )
         volume_upload.wait_for_upload(self.userapiclient
                                       )
-        self.debug("volume id :%s got uploaded successfully is " % volume_upload.id)
+        self.debug(
+            "volume id :%s got uploaded successfully is " %
+            volume_upload.id)
 
         # 20.Detach data disk from vm 2 and delete the volume
         self.virtual_machine_2.detach_volume(self.userapiclient,
@@ -562,6 +802,263 @@ class TestPathVolume(cloudstackTestCase):
         try:
             self.volume.delete(self.userapiclient
                                )
-            self.debug("volume id:%s got deleted successfully " % self.volume.id)
+            self.debug("volume id:%s got deleted successfully " %
+                       self.volume.id)
+        except Exception as e:
+            raise Exception("Volume deletion failed with error %s" % e)
+
+    @attr(
+        tags=[
+            "advanced",
+            "advancedsg",
+            "basic",
+        ],
+        required_hardware="false")
+    def test_02_negative_path(self):
+        """
+        negative test for volume life cycle
+        # 1. Deploy a vm [vm1] with shared storage and  data disk
+        #v1. Create VM2 with local storage offering disk offerings
+        # 2.TBD
+        # 3. Detach the data disk from VM1 and Download the volume
+        # 4.TBD
+        # 5. Attach volume with deviceid = 0
+        # 6. Attach volume, specify a VM which is destroyed
+        # 7.TBD
+        # 8.TBD
+        # 9.TBD
+        # 10.TBD
+        # 11.Upload the volume from T3 by providing the URL of the downloaded
+             volume, but specify a wrong format (not supported by the
+             hypervisor)
+        # 12.Upload the same volume from T4 by providing a wrong URL
+        # 13.Upload volume, provide wrong checksum
+        # 14.Upload a volume when maximum limit for the account is reached
+        # 15.TBD
+        # 16.Upload volume with all correct parameters
+             (covered in positive test path)
+        # 17.TBD
+        # 18.TBD
+        # 19.Now attach the volume with all correct parameters
+            (covered in positive test path)
+        # 20.Destroy and expunge all VMs
+
+        """
+
+        # 1. Deploy a vm [vm1] with shared storage and data disk
+        self.virtual_machine_1 = VirtualMachine.create(
+            self.userapiclient,
+            self.testdata["small"],
+            templateid=self.template.id,
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering_1.id,
+            zoneid=self.zone.id,
+            diskofferingid=self.disk_offering_1.id,
+            mode=self.testdata["mode"])
+        verify_vm(self, self.virtual_machine_1.id)
+        # List data volume for vm1
+        list_volume = Volume.list(self.userapiclient,
+                                  virtualmachineid=self.virtual_machine_1.id,
+                                  type='DATADISK'
+                                  )
+        self.assertEqual(
+            validateList(list_volume)[0],
+            PASS,
+            "Check List volume response for vm id  %s" %
+            self.virtual_machine_1.id)
+        list_data_volume_for_vm1 = list_volume[0]
+        self.assertEqual(
+            len(list_volume),
+            1,
+            "There is no data disk attached to vm id:%s" %
+            self.virtual_machine_1.id)
+        self.assertEqual(
+            list_data_volume_for_vm1.virtualmachineid, str(
+                self.virtual_machine_1.id),
+            "Check if volume state (attached) is reflected")
+        # Variance
+        if self.zone.localstorageenabled:
+            # V1.Create vm3 with local storage offering
+            self.virtual_machine_local_2 = VirtualMachine.create(
+                self.userapiclient,
+                self.testdata["small"],
+                templateid=self.template.id,
+                accountid=self.account.name,
+                domainid=self.account.domainid,
+                serviceofferingid=self.service_offering_2.id,
+                zoneid=self.zone.id,
+                mode=self.testdata["mode"])
+            verify_vm(self, self.virtual_machine_local_2.id)
+
+        # 3. Detach the data disk from VM1 and Download the volume
+        self.virtual_machine_1.detach_volume(self.userapiclient,
+                                             volume=list_data_volume_for_vm1
+                                             )
+        verify_detach_volume(
+            self,
+            self.virtual_machine_1.id,
+            list_data_volume_for_vm1.id)
+        # download detached volume
+        self.extract_volume = Volume.extract(
+            self.userapiclient,
+            volume_id=list_data_volume_for_vm1.id,
+            zoneid=self.zone.id,
+            mode='HTTP_DOWNLOAD')
+
+        self.debug("extracted url is%s  :" % self.extract_volume.url)
+        try:
+
+            formatted_url = urllib.unquote_plus(self.extract_volume.url)
+            self.debug(
+                "Attempting to download volume at url %s" %
+                formatted_url)
+            response = urllib.urlopen(formatted_url)
+            self.debug("response from volume url %s" % response.getcode())
+            fd, path = tempfile.mkstemp()
+            self.debug(
+                "Saving volume %s to path %s" %
+                (list_data_volume_for_vm1.id, path))
+            os.close(fd)
+            with open(path, 'wb') as fd:
+                fd.write(response.read())
+            self.debug("Saved volume successfully")
+        except Exception:
+            self.fail(
+                "Extract Volume Failed with invalid URL %s (vol id: %s)" %
+                (self.extract_volume, list_data_volume_for_vm1.id))
+
+        # 6. Attach volume, specify a VM which is destroyed
+        self.virtual_machine_2 = VirtualMachine.create(
+            self.userapiclient,
+            self.testdata["small"],
+            templateid=self.template.id,
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering_1.id,
+            zoneid=self.zone.id,
+            mode=self.testdata["mode"])
+        verify_vm(self, self.virtual_machine_2.id)
+        try:
+            self.virtual_machine_2.delete(self.apiclient)
+        except Exception as e:
+            raise Exception("Vm deletion failed with error %s" % e)
+        # Create a new volume
+        self.volume = Volume.create(self.userapiclient,
+                                    services=self.testdata["volume"],
+                                    diskofferingid=self.disk_offering_1.id,
+                                    zoneid=self.zone.id
+                                    )
+
+        list_data_volume = Volume.list(self.userapiclient,
+                                       id=self.volume.id
+                                       )
+        self.assertEqual(
+            validateList(list_data_volume)[0],
+            PASS,
+            "Check List volume response for volume %s" %
+            self.volume.id)
+        self.assertEqual(
+            list_data_volume[0].id,
+            self.volume.id,
+            "check list volume response for volume id:  %s" %
+            self.volume.id)
+        self.debug(
+            "volume id %s got created successfully" %
+            list_data_volume[0].id)
+        # try  Attach volume to vm2
+        try:
+            self.virtual_machine_2.attach_volume(self.userapiclient,
+                                                 self.volume
+                                                 )
+            self.fail("Volume got attached to a destroyed vm ")
+        except Exception:
+            self.debug("Volume cant not be attached to a destroyed vm ")
+
+        # 11.Upload the volume  by providing the URL of the downloaded
+        # volume, but specify a wrong format (not supported by the hypervisor)
+        if "OVA" in self.extract_volume.url.upper():
+            self.testdata["upload_volume"]["format"] = "VHD"
+        else:
+            self.testdata["upload_volume"]["format"] = "OVA"
+        try:
+            self.upload_response = Volume.upload(
+                self.userapiclient,
+                zoneid=self.zone.id,
+                url=self.extract_volume.url,
+                services=self.testdata["upload_volume"])
+            self.fail("Volume got uploaded with invalid format")
+        except Exception as e:
+            self.debug("upload volume failed due %s" % e)
+        # 12. Upload the same volume from T4 by providing a wrong URL
+        self.testdata["upload_volume"]["format"] = "VHD"
+        if "OVA" in self.extract_volume.url.upper():
+            self.testdata["upload_volume"]["format"] = "OVA"
+        if "QCOW2" in self.extract_volume.url.upper():
+            self.testdata["upload_volume"]["format"] = "QCOW2"
+        u1 = self.extract_volume.url.split('.')
+        u1[-2] = "wrong"
+        wrong_url = ".".join(u1)
+        try:
+            self.upload_response = Volume.upload(
+                self.userapiclient,
+                zoneid=self.zone.id,
+                url=wrong_url,
+                services=self.testdata["upload_volume"])
+            self.upload_response.wait_for_upload(self.userapiclient
+                                                 )
+            self.fail("volume got uploaded with wrong url")
+        except Exception as e:
+            self.debug("upload volume failed due to %s" % e)
+        # 13.Upload volume, provide wrong checksum
+        try:
+            self.upload_response = Volume.upload(
+                self.userapiclient,
+                zoneid=self.zone.id,
+                url=self.extract_volume.url,
+                services=self.testdata["upload_volume"],
+                checksome="123456")
+            self.upload_response.wait_for_upload(self.userapiclient
+                                                 )
+            self.fail("volume got uploaded with wrong checksome")
+        except Exception as e:
+            self.debug("upload volume failed due to %s" % e)
+
+        # 14.Upload a volume when maximum limit for the account is reached
+        account_update = Resources.updateLimit(self.apiclient,
+                                               resourcetype=2,
+                                               account=self.account.name,
+                                               domainid=self.account.domainid,
+                                               max=1
+                                               )
+        list_resource = Resources.list(self.apiclient,
+                                       account=self.account.name,
+                                       domainid=self.account.domainid,
+                                       resourcetype=2
+                                       )
+        self.assertEqual(
+            validateList(list_resource)[0],
+            PASS,
+            "Check List resource response for volume %s" %
+            self.account.name)
+        self.assertEqual(
+            str(
+                list_resource[0].max),
+            '1',
+            "check list List resource response for account id:  %s" %
+            self.account.name)
+        self.debug(
+            "Max resources got updated successfully for account %s" %
+            self.account.name)
+        try:
+            self.upload_response = Volume.upload(
+                self.userapiclient,
+                zoneid=self.zone.id,
+                url=self.extract_volume.url,
+                services=self.testdata["upload_volume"])
+            self.upload_response.wait_for_upload(self.userapiclient
+                                                 )
+            self.fail("volume got uploaded after account reached max limit for\
+                      volumes ")
         except Exception as e:
-            raise Exception("Volume deletion failed with error %s" % e)
\ No newline at end of file
+            self.debug("upload volume failed due to %s" % e)


[09/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
Revert "CLOUDSTACK-7408: Fixed - Private key of the ssh keypair was getting corrupted"

This reverts commit e921ec6ec79c50096d58264d60c15091969ff888.

CLOUDSTACK-7408: sshClient.py - removing function load_host_keys(). This function is used to load host keys from local host keys file and to save back the host key. It is not needed while running test cases because we are connecting to unknown host anyway and don't want to use any local host key file. We have the AutoAddPolicy for missing host key file, hence whenever ssh connects to a new host, it will save the host key in memory temporarily.

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: e87da186f3b094e76a174713d6933f83d1c00854
Parents: 591f468
Author: Gaurrav Aradhye <ga...@clogeny.com>
Authored: Thu Oct 30 12:23:49 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 14:51:54 2014 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/lib/base.py  |  8 +++-----
 tools/marvin/marvin/lib/utils.py |  7 ++-----
 tools/marvin/marvin/sshClient.py | 17 +----------------
 3 files changed, 6 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e87da186/tools/marvin/marvin/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py
index 77faeeb..7f53328 100755
--- a/tools/marvin/marvin/lib/base.py
+++ b/tools/marvin/marvin/lib/base.py
@@ -552,7 +552,7 @@ class VirtualMachine:
 
     def get_ssh_client(
             self, ipaddress=None, reconnect=False, port=None,
-            keyPairFileLocation=None, knownHostsFilePath=None):
+            keyPairFileLocation=None):
         """Get SSH object of VM"""
 
         # If NAT Rules are not created while VM deployment in Advanced mode
@@ -571,16 +571,14 @@ class VirtualMachine:
                 self.ssh_port,
                 self.username,
                 self.password,
-                keyPairFileLocation=keyPairFileLocation,
-                knownHostsFilePath=knownHostsFilePath
+                keyPairFileLocation=keyPairFileLocation
             )
         self.ssh_client = self.ssh_client or is_server_ssh_ready(
             self.ssh_ip,
             self.ssh_port,
             self.username,
             self.password,
-            keyPairFileLocation=keyPairFileLocation,
-            knownHostsFilePath=knownHostsFilePath
+            keyPairFileLocation=keyPairFileLocation
         )
         return self.ssh_client
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e87da186/tools/marvin/marvin/lib/utils.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/utils.py b/tools/marvin/marvin/lib/utils.py
index b58b59d..8788b3b 100644
--- a/tools/marvin/marvin/lib/utils.py
+++ b/tools/marvin/marvin/lib/utils.py
@@ -121,9 +121,7 @@ def cleanup_resources(api_client, resources):
         obj.delete(api_client)
 
 
-def is_server_ssh_ready(ipaddress, port, username, password, retries=20,
-        retryinterv=30, timeout=10.0, keyPairFileLocation=None,
-        knownHostsFilePath=None):
+def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryinterv=30, timeout=10.0, keyPairFileLocation=None):
     '''
     @Name: is_server_ssh_ready
     @Input: timeout: tcp connection timeout flag,
@@ -142,8 +140,7 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=20,
             keyPairFiles=keyPairFileLocation,
             retries=retries,
             delay=retryinterv,
-            timeout=timeout,
-            knownHostsFilePath=knownHostsFilePath)
+            timeout=timeout)
     except Exception, e:
         raise Exception("SSH connection has Failed. Waited %ss. Error is %s" % (retries * retryinterv, str(e)))
     else:

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e87da186/tools/marvin/marvin/sshClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/sshClient.py b/tools/marvin/marvin/sshClient.py
index f027890..e481109 100644
--- a/tools/marvin/marvin/sshClient.py
+++ b/tools/marvin/marvin/sshClient.py
@@ -24,7 +24,6 @@ from paramiko import (BadHostKeyException,
                       SFTPClient)
 import socket
 import time
-import os
 from marvin.cloudstackException import (
     internalError,
     GetDetailExceptionInfo
@@ -50,8 +49,7 @@ class SshClient(object):
     '''
 
     def __init__(self, host, port, user, passwd, retries=60, delay=10,
-                 log_lvl=logging.DEBUG, keyPairFiles=None, timeout=10.0,
-                 knownHostsFilePath=None):
+                 log_lvl=logging.DEBUG, keyPairFiles=None, timeout=10.0):
         self.host = None
         self.port = 22
         self.user = user
@@ -79,18 +77,6 @@ class SshClient(object):
             self.timeout = timeout
         if port is not None and port >= 0:
             self.port = port
-
-        # If the known_hosts file is not at default location,
-        # then its location can be passed, or else the default
-        # path will be considered (which is ~/.ssh/known_hosts)
-        if knownHostsFilePath:
-            self.knownHostsFilePath = knownHostsFilePath
-        else:
-            self.knownHostsFilePath = os.path.expanduser(
-                os.path.join(
-                    "~",
-                    ".ssh",
-                    "known_hosts"))
         if self.createConnection() == FAILED:
             raise internalError("SSH Connection Failed")
 
@@ -134,7 +120,6 @@ class SshClient(object):
                                      password=self.passwd,
                                      timeout=self.timeout)
                 else:
-                    self.ssh.load_host_keys(self.knownHostsFilePath)
                     self.ssh.connect(hostname=self.host,
                                      port=self.port,
                                      username=self.user,


[34/50] [abbrv] CLOUDSTACK-7833: VM Async work jobs log "Was unable to find lock for the key vm_instance" errors as warning

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07ba078e/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
index 46eb5da..7c20080 100644
--- a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
+++ b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
@@ -82,9 +82,6 @@ import com.cloud.utils.db.EntityManager;
 import com.cloud.utils.db.Filter;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.Transaction;
-import com.cloud.utils.db.TransactionCallback;
-import com.cloud.utils.db.TransactionStatus;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.vm.UserVmVO;
 import com.cloud.vm.VMInstanceVO;
@@ -853,44 +850,28 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
 
         final VMInstanceVO vm = _vmInstanceDao.findById(vmId);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                VmWorkJobVO workJob = null;
+        VmWorkJobVO workJob = new VmWorkJobVO(context.getContextId());
 
-                _vmInstanceDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                workJob = new VmWorkJobVO(context.getContextId());
-
-                workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                workJob.setCmd(VmWorkCreateVMSnapshot.class.getName());
+        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+        workJob.setCmd(VmWorkCreateVMSnapshot.class.getName());
 
-                workJob.setAccountId(callingAccount.getId());
-                workJob.setUserId(callingUser.getId());
-                workJob.setStep(VmWorkJobVO.Step.Starting);
-                workJob.setVmType(VirtualMachine.Type.Instance);
-                workJob.setVmInstanceId(vm.getId());
-                    workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
-
-                // save work context info (there are some duplications)
-                VmWorkCreateVMSnapshot workInfo = new VmWorkCreateVMSnapshot(callingUser.getId(), callingAccount.getId(), vm.getId(),
-                        VMSnapshotManagerImpl.VM_WORK_JOB_HANDLER, vmSnapshotId, quiesceVm);
-                workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        workJob.setAccountId(callingAccount.getId());
+        workJob.setUserId(callingUser.getId());
+        workJob.setStep(VmWorkJobVO.Step.Starting);
+        workJob.setVmType(VirtualMachine.Type.Instance);
+        workJob.setVmInstanceId(vm.getId());
+        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        // save work context info (there are some duplications)
+        VmWorkCreateVMSnapshot workInfo = new VmWorkCreateVMSnapshot(callingUser.getId(), callingAccount.getId(), vm.getId(),
+                VMSnapshotManagerImpl.VM_WORK_JOB_HANDLER, vmSnapshotId, quiesceVm);
+        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmInstanceDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVMSnapshotOutcome((VmWorkJobVO)result[0],
-                vmSnapshotId);
+        return new VmJobVMSnapshotOutcome(workJob,vmSnapshotId);
     }
 
     public Outcome<VMSnapshot> deleteVMSnapshotThroughJobQueue(final Long vmId, final Long vmSnapshotId) {
@@ -901,44 +882,28 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
 
         final VMInstanceVO vm = _vmInstanceDao.findById(vmId);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                VmWorkJobVO workJob = null;
+        VmWorkJobVO workJob = new VmWorkJobVO(context.getContextId());
 
-                _vmInstanceDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                workJob = new VmWorkJobVO(context.getContextId());
-
-                workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                workJob.setCmd(VmWorkDeleteVMSnapshot.class.getName());
+        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+        workJob.setCmd(VmWorkDeleteVMSnapshot.class.getName());
 
-                workJob.setAccountId(callingAccount.getId());
-                workJob.setUserId(callingUser.getId());
-                workJob.setStep(VmWorkJobVO.Step.Starting);
-                workJob.setVmType(VirtualMachine.Type.Instance);
-                workJob.setVmInstanceId(vm.getId());
-                    workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
-
-                // save work context info (there are some duplications)
-                VmWorkDeleteVMSnapshot workInfo = new VmWorkDeleteVMSnapshot(callingUser.getId(), callingAccount.getId(), vm.getId(),
-                        VMSnapshotManagerImpl.VM_WORK_JOB_HANDLER, vmSnapshotId);
-                workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        workJob.setAccountId(callingAccount.getId());
+        workJob.setUserId(callingUser.getId());
+        workJob.setStep(VmWorkJobVO.Step.Starting);
+        workJob.setVmType(VirtualMachine.Type.Instance);
+        workJob.setVmInstanceId(vm.getId());
+        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        // save work context info (there are some duplications)
+        VmWorkDeleteVMSnapshot workInfo = new VmWorkDeleteVMSnapshot(callingUser.getId(), callingAccount.getId(), vm.getId(),
+                VMSnapshotManagerImpl.VM_WORK_JOB_HANDLER, vmSnapshotId);
+        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmInstanceDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVMSnapshotOutcome((VmWorkJobVO)result[0],
-                vmSnapshotId);
+        return new VmJobVMSnapshotOutcome(workJob,vmSnapshotId);
     }
 
     public Outcome<VMSnapshot> revertToVMSnapshotThroughJobQueue(final Long vmId, final Long vmSnapshotId) {
@@ -949,44 +914,28 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
 
         final VMInstanceVO vm = _vmInstanceDao.findById(vmId);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                VmWorkJobVO workJob = null;
+        VmWorkJobVO workJob = new VmWorkJobVO(context.getContextId());
 
-                _vmInstanceDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                workJob = new VmWorkJobVO(context.getContextId());
-
-                workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                workJob.setCmd(VmWorkRevertToVMSnapshot.class.getName());
+        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+        workJob.setCmd(VmWorkRevertToVMSnapshot.class.getName());
 
-                workJob.setAccountId(callingAccount.getId());
-                workJob.setUserId(callingUser.getId());
-                workJob.setStep(VmWorkJobVO.Step.Starting);
-                workJob.setVmType(VirtualMachine.Type.Instance);
-                workJob.setVmInstanceId(vm.getId());
-                    workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
-
-                // save work context info (there are some duplications)
-                VmWorkRevertToVMSnapshot workInfo = new VmWorkRevertToVMSnapshot(callingUser.getId(), callingAccount.getId(), vm.getId(),
-                        VMSnapshotManagerImpl.VM_WORK_JOB_HANDLER, vmSnapshotId);
-                workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        workJob.setAccountId(callingAccount.getId());
+        workJob.setUserId(callingUser.getId());
+        workJob.setStep(VmWorkJobVO.Step.Starting);
+        workJob.setVmType(VirtualMachine.Type.Instance);
+        workJob.setVmInstanceId(vm.getId());
+        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        // save work context info (there are some duplications)
+        VmWorkRevertToVMSnapshot workInfo = new VmWorkRevertToVMSnapshot(callingUser.getId(), callingAccount.getId(), vm.getId(),
+                VMSnapshotManagerImpl.VM_WORK_JOB_HANDLER, vmSnapshotId);
+        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmInstanceDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVMSnapshotOutcome((VmWorkJobVO)result[0],
-                vmSnapshotId);
+        return new VmJobVMSnapshotOutcome(workJob,vmSnapshotId);
     }
 
     public Outcome<VirtualMachine> deleteAllVMSnapshotsThroughJobQueue(final Long vmId, final VMSnapshot.Type type) {
@@ -997,44 +946,28 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
 
         final VMInstanceVO vm = _vmInstanceDao.findById(vmId);
 
-        Object[] result = Transaction.execute(new TransactionCallback<Object[]>() {
-            @Override
-            public Object[] doInTransaction(TransactionStatus status) {
-                VmWorkJobVO workJob = null;
+        VmWorkJobVO workJob = new VmWorkJobVO(context.getContextId());
 
-                _vmInstanceDao.lockInLockTable(String.valueOf(vm.getId()), Integer.MAX_VALUE);
-                try {
-                workJob = new VmWorkJobVO(context.getContextId());
-
-                workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
-                workJob.setCmd(VmWorkDeleteAllVMSnapshots.class.getName());
+        workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);
+        workJob.setCmd(VmWorkDeleteAllVMSnapshots.class.getName());
 
-                workJob.setAccountId(callingAccount.getId());
-                workJob.setUserId(callingUser.getId());
-                workJob.setStep(VmWorkJobVO.Step.Starting);
-                workJob.setVmType(VirtualMachine.Type.Instance);
-                workJob.setVmInstanceId(vm.getId());
-                    workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
-
-                // save work context info (there are some duplications)
-                VmWorkDeleteAllVMSnapshots workInfo = new VmWorkDeleteAllVMSnapshots(callingUser.getId(), callingAccount.getId(), vm.getId(),
-                        VMSnapshotManagerImpl.VM_WORK_JOB_HANDLER, type);
-                workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
+        workJob.setAccountId(callingAccount.getId());
+        workJob.setUserId(callingUser.getId());
+        workJob.setStep(VmWorkJobVO.Step.Starting);
+        workJob.setVmType(VirtualMachine.Type.Instance);
+        workJob.setVmInstanceId(vm.getId());
+        workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());
 
-                _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
+        // save work context info (there are some duplications)
+        VmWorkDeleteAllVMSnapshots workInfo = new VmWorkDeleteAllVMSnapshots(callingUser.getId(), callingAccount.getId(), vm.getId(),
+                VMSnapshotManagerImpl.VM_WORK_JOB_HANDLER, type);
+        workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));
 
-                return new Object[] {workJob, new Long(workJob.getId())};
-                } finally {
-                    _vmInstanceDao.unlockFromLockTable(String.valueOf(vm.getId()));
-                }
-            }
-        });
+        _jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());
 
-        final long jobId = (Long)result[1];
-        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(jobId);
+        AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());
 
-        return new VmJobVirtualMachineOutcome((VmWorkJobVO)result[0],
-                vmId);
+        return new VmJobVirtualMachineOutcome(workJob,vmId);
     }
 
     @ReflectionUse


[42/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7372: [vGPU] When a host is put in maintenance mode, vGPU enabled VMs
failed to migrate to the other host in the cluster.

Migration for vGPU VMs is not supported in XS, so instead of migrating them to
new server, stopping them.


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

Branch: refs/heads/master
Commit: 9168d826dad42b73f03aaa1170d5387f7c19b07d
Parents: 2d58bb6
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Mon Nov 3 13:09:53 2014 +0530
Committer: Sanjay Tripathi <sa...@citrix.com>
Committed: Tue Nov 4 17:28:22 2014 +0530

----------------------------------------------------------------------
 server/src/com/cloud/resource/ResourceManagerImpl.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9168d826/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index a0a3adf..fcc4ddb 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -99,6 +99,7 @@ import com.cloud.exception.DiscoveryException;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.PermissionDeniedException;
 import com.cloud.exception.ResourceInUseException;
+import com.cloud.gpu.GPU;
 import com.cloud.gpu.HostGpuGroupsVO;
 import com.cloud.gpu.VGPUTypesVO;
 import com.cloud.gpu.dao.HostGpuGroupsDao;
@@ -125,6 +126,7 @@ import com.cloud.org.Grouping;
 import com.cloud.org.Grouping.AllocationState;
 import com.cloud.org.Managed;
 import com.cloud.serializer.GsonHelper;
+import com.cloud.service.dao.ServiceOfferingDetailsDao;
 import com.cloud.storage.GuestOSCategoryVO;
 import com.cloud.storage.StorageManager;
 import com.cloud.storage.StoragePool;
@@ -223,6 +225,8 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
     PlannerHostReservationDao _plannerHostReserveDao;
     @Inject
     private DedicatedResourceDao _dedicatedDao;
+    @Inject
+    private ServiceOfferingDetailsDao _serviceOfferingDetailsDao;
 
     private List<? extends Discoverer> _discoverers;
 
@@ -1193,7 +1197,9 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
 
             List<HostVO> hosts = listAllUpAndEnabledHosts(Host.Type.Routing, host.getClusterId(), host.getPodId(), host.getDataCenterId());
             for (final VMInstanceVO vm : vms) {
-                if (hosts == null || hosts.isEmpty() || !answer.getMigrate()) {
+                if (hosts == null || hosts.isEmpty() || !answer.getMigrate()
+                        || _serviceOfferingDetailsDao.findDetail(vm.getServiceOfferingId(), GPU.Keys.vgpuType.toString()) != null) {
+                    // Migration is not supported for VGPU Vms so stop them.
                     // for the last host in this cluster, stop all the VMs
                     _haMgr.scheduleStop(vm, hostId, WorkType.ForceStop);
                 } else if (HypervisorType.LXC.equals(host.getHypervisorType()) && VirtualMachine.Type.User.equals(vm.getType())){


[16/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7691: Fixed 'Exception not raised' issue in test_project_limits.py

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: e2ba1b614c7792856314cfa363f2a4e9cd667065
Parents: dc4b04f
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Thu Oct 9 14:56:34 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 15:32:24 2014 +0530

----------------------------------------------------------------------
 .../component/test_project_limits.py            | 51 ++++++++++++++------
 1 file changed, 37 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e2ba1b61/test/integration/component/test_project_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_project_limits.py b/test/integration/component/test_project_limits.py
index 5f33ad8..5d37f0b 100644
--- a/test/integration/component/test_project_limits.py
+++ b/test/integration/component/test_project_limits.py
@@ -5,9 +5,9 @@
 # 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
@@ -17,16 +17,35 @@
 """ P1 tests for Resource limits
 """
 #Import Local Modules
-import marvin
 from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
+from marvin.cloudstackTestCase import cloudstackTestCase
+#from marvin.cloudstackAPI import *
+from marvin.lib.utils import (cleanup_resources,
+                              validateList)
+from marvin.lib.base import (Account,
+                             Domain,
+                             Project,
+                             Template,
+                             Snapshot,
+                             Volume,
+                             NetworkOffering,
+                             ServiceOffering,
+                             VirtualMachine,
+                             DiskOffering,
+                             Configurations,
+                             Network,
+                             PublicIPAddress)
+from marvin.lib.common import (get_domain,
+                               get_zone,
+                               get_template,
+                               list_snapshots,
+                               list_volumes,
+                               list_configurations,
+                               list_resource_limits,
+                               update_resource_limit
+                               )
 from marvin.codes import PASS
-import datetime
-
+import time
 
 class Services:
     """Test Resource Limits Services
@@ -525,6 +544,11 @@ class TestResourceLimitsProject(cloudstackTestCase):
                             cls.services["account"],
                             domainid=cls.domain.id
                             )
+
+        cls.userapiclient = cls.testClient.getUserApiClient(
+                                    UserName=cls.account.name,
+                                    DomainName=cls.account.domain)
+
         # Create project as a domain admin
         cls.project = Project.create(
                                  cls.api_client,
@@ -713,7 +737,7 @@ class TestResourceLimitsProject(cloudstackTestCase):
 
         # Exception should be raised for second Public IP
         with self.assertRaises(Exception):
-            public_ip_2 = PublicIPAddress.create(
+            PublicIPAddress.create(
                                            self.apiclient,
                                            zoneid=virtual_machine_1.zoneid,
                                            services=self.services["server"],
@@ -772,7 +796,6 @@ class TestResourceLimitsProject(cloudstackTestCase):
                         True,
                         "Check for list volume response return valid data"
                         )
-        volume = volumes[0]
 
         self.debug("Creating snapshot from volume: %s" % volumes[0].id)
         # Create a snapshot from the ROOTDISK
@@ -915,7 +938,7 @@ class TestResourceLimitsProject(cloudstackTestCase):
         self.debug("Creating template from volume: %s" % volume.id)
         # Create a template from the ROOTDISK
         template_1 = Template.create(
-                            self.apiclient,
+                            self.userapiclient,
                             self.services["template"],
                             volumeid=volume.id,
                             projectid=self.project.id
@@ -932,7 +955,7 @@ class TestResourceLimitsProject(cloudstackTestCase):
         # Exception should be raised for second template
         with self.assertRaises(Exception):
             Template.create(
-                            self.apiclient,
+                            self.userapiclient,
                             self.services["template"],
                             volumeid=volume.id,
                             projectid=self.project.id


[50/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
Merge branch '4.5'


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

Branch: refs/heads/master
Commit: 4c5f792ca9cce82a0d49e9b4ee37c23bfad4cca8
Parents: 2b1ca20 2cd4ad2
Author: Rajani Karuturi <ra...@gmail.com>
Authored: Wed Nov 5 15:20:34 2014 +0530
Committer: Rajani Karuturi <ra...@gmail.com>
Committed: Wed Nov 5 15:20:34 2014 +0530

----------------------------------------------------------------------
 .../config/dao/ConfigurationDaoImpl.java          |  3 ---
 .../framework/config/impl/ConfigurationVO.java    | 18 +++++++++++++++---
 .../com/cloud/server/ConfigurationServerImpl.java |  3 +--
 3 files changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



[26/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7824: using debian 7.7.0 for systemvm template

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: e463d6d21c346b71b3d810f8dfb9dbe5f1a931fd
Parents: e1c788c
Author: SrikanteswaraRao Talluri <ta...@apache.org>
Authored: Thu Oct 30 17:31:47 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Fri Oct 31 19:06:07 2014 +0530

----------------------------------------------------------------------
 tools/appliance/definitions/systemvm64template/definition.rb | 6 +++---
 tools/appliance/definitions/systemvmtemplate/definition.rb   | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e463d6d2/tools/appliance/definitions/systemvm64template/definition.rb
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvm64template/definition.rb b/tools/appliance/definitions/systemvm64template/definition.rb
index 4186742..8dbf724 100644
--- a/tools/appliance/definitions/systemvm64template/definition.rb
+++ b/tools/appliance/definitions/systemvm64template/definition.rb
@@ -10,9 +10,9 @@ Veewee::Definition.declare({
   :memory_size=> '256',
   :disk_size => '2500', :disk_format => 'VDI', :hostiocache => 'off',
   :os_type_id => 'Debian_64',
-  :iso_file => "debian-7.5.0-amd64-netinst.iso",
-  :iso_src => "http://cdimage.debian.org/mirror/cdimage/archive/7.5.0/amd64/iso-cd/debian-7.5.0-amd64-netinst.iso",
-  :iso_md5 => "8fdb6715228ea90faba58cb84644d296",
+  :iso_file => "debian-7.7.0-amd64-netinst.iso",
+  :iso_src => "http://ftp.acc.umu.se/debian-cd/7.7.0/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso",
+  :iso_md5 => "0b31bccccb048d20b551f70830bb7ad0",
   :iso_download_timeout => "1000",
   :boot_wait => "10", :boot_cmd_sequence => [
      '<Esc>',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e463d6d2/tools/appliance/definitions/systemvmtemplate/definition.rb
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/definition.rb b/tools/appliance/definitions/systemvmtemplate/definition.rb
index d29efcd..91514bf 100644
--- a/tools/appliance/definitions/systemvmtemplate/definition.rb
+++ b/tools/appliance/definitions/systemvmtemplate/definition.rb
@@ -10,9 +10,9 @@ Veewee::Definition.declare({
   :memory_size=> '256',
   :disk_size => '2500', :disk_format => 'VDI', :hostiocache => 'off',
   :os_type_id => 'Debian',
-  :iso_file => "debian-7.5.0-i386-netinst.iso",
-  :iso_src => "http://cdimage.debian.org/mirror/cdimage/archive/7.5.0/i386/iso-cd/debian-7.5.0-i386-netinst.iso",
-  :iso_md5 => "0e6eaacb5a5828473afe90f6df9c8f16",
+  :iso_file => "debian-7.7.0-i386-netinst.iso",
+  :iso_src => "http://ftp.acc.umu.se/debian-cd/7.7.0/i386/iso-cd/debian-7.7.0-i386-netinst.iso",
+  :iso_md5 => "76d512c44a9b7eca53ea2812ad5ac36f",
   :iso_download_timeout => "1000",
   :boot_wait => "10", :boot_cmd_sequence => [
      '<Esc>',


[15/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7684: Fixed Exception not raised issue in secondary storage limits test suite test_ss_max_limits.py

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: dc4b04fbe87048849d51e9e4dbcce566de7f9cf0
Parents: b9fed95
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Wed Oct 8 11:57:45 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 15:31:19 2014 +0530

----------------------------------------------------------------------
 test/integration/component/test_ss_max_limits.py | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc4b04fb/test/integration/component/test_ss_max_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_ss_max_limits.py b/test/integration/component/test_ss_max_limits.py
index ba886e8..49a1e4f 100644
--- a/test/integration/component/test_ss_max_limits.py
+++ b/test/integration/component/test_ss_max_limits.py
@@ -101,7 +101,7 @@ class TestMaxSecondaryStorageLimits(cloudstackTestCase):
             self.services["template_2"]["hypervisor"] = builtin_info[1]
             self.services["template_2"]["format"] = builtin_info[2]
 
-            template = Template.register(self.apiclient,
+            template = Template.register(self.userapiclient,
                                      self.services["template_2"],
                                      zoneid=self.zone.id,
                                      account=self.child_do_admin.name if not inProject else None,
@@ -110,7 +110,7 @@ class TestMaxSecondaryStorageLimits(cloudstackTestCase):
 
             template.download(self.apiclient)
 
-            templates = Template.list(self.apiclient,
+            templates = Template.list(self.userapiclient,
                                       templatefilter=\
                                       self.services["template_2"]["templatefilter"],
                                       id=template.id)
@@ -131,6 +131,10 @@ class TestMaxSecondaryStorageLimits(cloudstackTestCase):
             self.child_do_admin = Account.create(self.apiclient, self.services["account"], admin=True,
                                              domainid=self.child_domain.id)
 
+            self.userapiclient = self.testClient.getUserApiClient(
+                                    UserName=self.child_do_admin.name,
+                                    DomainName=self.child_do_admin.domain)
+
             # Create project as a domain admin
             self.project = Project.create(self.apiclient, self.services["project"],
                                       account=self.child_do_admin.name,
@@ -195,11 +199,12 @@ class TestMaxSecondaryStorageLimits(cloudstackTestCase):
         self.assertEqual(response[0], PASS, response[1])
 
         with self.assertRaises(Exception):
-            template = Template.register(self.apiclient,
+            template = Template.register(self.userapiclient,
                                      self.services["template_2"],
                                      zoneid=self.zone.id,
                                      account=self.child_do_admin.name,
                                      domainid=self.child_do_admin.domainid)
+            template.delete(self.userapiclient)
         return
 
     @attr(tags=["advanced"], required_hardware="false")
@@ -231,11 +236,12 @@ class TestMaxSecondaryStorageLimits(cloudstackTestCase):
         self.assertEqual(response[0], PASS, response[1])
 
         with self.assertRaises(Exception):
-            template = Template.register(self.apiclient,
+            template = Template.register(self.userapiclient,
                                      self.services["template_2"],
                                      zoneid=self.zone.id,
                                      account=self.child_do_admin.name,
                                      domainid=self.child_do_admin.domainid)
+            template.delete(self.userapiclient)
         return
 
     @attr(tags=["advanced"], required_hardware="false")
@@ -256,7 +262,7 @@ class TestMaxSecondaryStorageLimits(cloudstackTestCase):
         self.assertEqual(response[0], PASS, response[1])
 
         try:
-            projects = Project.list(self.apiclient, id=self.project.id, listall=True)
+            projects = Project.list(self.userapiclient, id=self.project.id, listall=True)
         except Exception as e:
             self.fail("failed to get projects list: %s" % e)
 
@@ -272,8 +278,9 @@ class TestMaxSecondaryStorageLimits(cloudstackTestCase):
         self.assertEqual(response[0], PASS, response[1])
 
         with self.assertRaises(Exception):
-            template = Template.register(self.apiclient,
+            template = Template.register(self.userapiclient,
                                      self.services["template_2"],
                                      zoneid=self.zone.id,
                                      projectid=self.project.id)
+            template.delete(self.userapiclient)
         return


[24/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7820: Don't consider disabled hosts for calculating disable threshold.


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

Branch: refs/heads/master
Commit: c30d4ed1c27303aa20b2aa891a58aae906dc9ab0
Parents: 6df0b9f
Author: Nitin Mehta <ni...@citrix.com>
Authored: Thu Oct 30 16:54:00 2014 -0700
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Thu Oct 30 16:54:00 2014 -0700

----------------------------------------------------------------------
 engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c30d4ed1/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
index 9cae045..cea18bd 100755
--- a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
+++ b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
@@ -177,7 +177,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
         "ELSE (SELECT config.value FROM `cloud`.`configuration` config WHERE config.name = ?) " +
         "END configValue " +
         "FROM `cloud`.`op_host_capacity` capacity INNER JOIN `cloud`.`cluster_details` overcommit ON overcommit.cluster_id = capacity.cluster_id " +
-        "WHERE capacity.data_center_id = ? AND capacity.capacity_type = ? AND capacity.total_capacity > 0 AND overcommit.name = ?) cluster " +
+        "WHERE capacity.data_center_id = ? AND capacity.capacity_type = ? AND capacity.total_capacity > 0 AND overcommit.name = ? AND capacity.capacity_state='Enabled') cluster " +
 
         "GROUP BY cluster.cluster_id)  clusterList " +
         "WHERE clusterList.ratio > clusterList.value; ";


[33/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7832: Move some job db update and item purge to
    completeAsyncJob transaction to avoid MySQL deadlock.


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

Branch: refs/heads/master
Commit: 6830cbc15ae70d51c555f7f19348f6d87d0b5391
Parents: 3760fde
Author: Min Chen <mi...@citrix.com>
Authored: Mon Nov 3 10:41:36 2014 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Mon Nov 3 11:18:52 2014 -0800

----------------------------------------------------------------------
 .../db/src/com/cloud/utils/db/Transaction.java    |  8 ++++++++
 framework/ipc/pom.xml                             | 18 ++++++++++++++++++
 .../framework/messagebus/MessageBusBase.java      | 14 +++++++++++++-
 .../framework/jobs/impl/AsyncJobManagerImpl.java  | 11 ++++++-----
 4 files changed, 45 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6830cbc1/framework/db/src/com/cloud/utils/db/Transaction.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/Transaction.java b/framework/db/src/com/cloud/utils/db/Transaction.java
index 471e0cf..dd91a96 100755
--- a/framework/db/src/com/cloud/utils/db/Transaction.java
+++ b/framework/db/src/com/cloud/utils/db/Transaction.java
@@ -18,11 +18,15 @@ package com.cloud.utils.db;
 
 import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.log4j.Logger;
+
 public class Transaction {
     private final static AtomicLong counter = new AtomicLong(0);
     private final static TransactionStatus STATUS = new TransactionStatus() {
     };
 
+    private static final Logger s_logger = Logger.getLogger(Transaction.class);
+
     @SuppressWarnings("deprecation")
     public static <T, E extends Throwable> T execute(TransactionCallbackWithException<T, E> callback) throws E {
         String name = "tx-" + counter.incrementAndGet();
@@ -33,6 +37,10 @@ public class Transaction {
         }
         TransactionLegacy txn = TransactionLegacy.open(name, databaseId, false);
         try {
+//            if (txn.dbTxnStarted()){
+//                String warnMsg = "Potential Wrong Usage: TRANSACTION.EXECUTE IS WRAPPED INSIDE ANOTHER DB TRANSACTION!";
+//                s_logger.warn(warnMsg, new CloudRuntimeException(warnMsg));
+//            }
             txn.start();
             T result = callback.doInTransaction(STATUS);
             txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6830cbc1/framework/ipc/pom.xml
----------------------------------------------------------------------
diff --git a/framework/ipc/pom.xml b/framework/ipc/pom.xml
index 12b4a3d..09b0c41 100644
--- a/framework/ipc/pom.xml
+++ b/framework/ipc/pom.xml
@@ -39,4 +39,22 @@
       <version>${project.version}</version>
     </dependency>    
   </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <skipTests>true</skipTests>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>integration-test</phase>
+            <goals>
+              <goal>test</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>  
 </project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6830cbc1/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageBusBase.java
----------------------------------------------------------------------
diff --git a/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageBusBase.java b/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageBusBase.java
index e8f9bce..e3eeb7b 100644
--- a/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageBusBase.java
+++ b/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageBusBase.java
@@ -30,6 +30,9 @@ import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.framework.serializer.MessageSerializer;
 
+import com.cloud.utils.db.TransactionLegacy;
+import com.cloud.utils.exception.CloudRuntimeException;
+
 public class MessageBusBase implements MessageBus {
 
     private final Gate _gate;
@@ -158,7 +161,11 @@ public class MessageBusBase implements MessageBus {
 
     @Override
     public void publish(String senderAddress, String subject, PublishScope scope, Object args) {
-
+        // publish cannot be in DB transaction, which may hold DB lock too long, and we are guarding this here
+        if (!noDbTxn()){
+            String errMsg = "NO EVENT PUBLISH CAN BE WRAPPED WITHIN DB TRANSACTION!";
+            s_logger.error(errMsg, new CloudRuntimeException(errMsg));
+        }
         if (_gate.enter(true)) {
             if (s_logger.isTraceEnabled()) {
                 s_logger.trace("Enter gate in message bus publish");
@@ -256,6 +263,11 @@ public class MessageBusBase implements MessageBus {
         }
     }
 
+    private boolean noDbTxn() {
+        TransactionLegacy txn = TransactionLegacy.currentTxn();
+        return !txn.dbTxnStarted();
+    }
+
     //
     // Support inner classes
     //

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6830cbc1/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
index 04fab24..aab1683 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
@@ -258,6 +258,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
                 }
 
                 job.setLastUpdated(DateUtil.currentGMTTime());
+                job.setExecutingMsid(null);
                 _jobDao.update(jobId, job);
 
                 if (s_logger.isDebugEnabled()) {
@@ -266,6 +267,11 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
                 List<Long> wakeupList = wakeupByJoinedJobCompletion(jobId);
                 _joinMapDao.disjoinAllJobs(jobId);
 
+                // purge the job sync item from queue
+                if (job.getSyncSource() != null) {
+                    _queueMgr.purgeItem(job.getSyncSource().getId());
+                }
+
                 return wakeupList;
             }
         });
@@ -527,12 +533,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
                 } finally {
                     // guard final clause as well
                     try {
-                        AsyncJobVO jobToUpdate = _jobDao.findById(job.getId());
-                        jobToUpdate.setExecutingMsid(null);
-                        _jobDao.update(job.getId(), jobToUpdate);
-
                         if (job.getSyncSource() != null) {
-                            _queueMgr.purgeItem(job.getSyncSource().getId());
                             checkQueue(job.getSyncSource().getQueueId());
                         }
 


[23/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
SAMLUtils: SAML user id should fit within the UUID VARCHAR(40) column

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/master
Commit: 6df0b9f677984a85cc50fa964c4ead461f0a3063
Parents: cd52bed
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Oct 31 00:30:39 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Oct 31 00:39:20 2014 +0530

----------------------------------------------------------------------
 utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6df0b9f6/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
index 36c4d0f..d129309 100644
--- a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
+++ b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
@@ -102,7 +102,8 @@ public class SAMLUtils {
     public static final String CERTIFICATE_NAME = "SAMLSP_CERTIFICATE";
 
     public static String createSAMLId(String uid) {
-        return SAML_NS + uid;
+        String samlUuid = SAML_NS + uid;
+        return samlUuid.length() > 40 ? samlUuid.substring(0, 40) : samlUuid;
     }
 
     public static Boolean checkSAMLUserId(String uuid) {


[13/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7685: Fixed copy template method call in test_escalations_template.py. Removed unbound method of the same name as bound method from base library and changed method call accordingly

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: a1e7feead91b22350f96114add4bf8d75a74b8b1
Parents: b1ab888
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Wed Oct 8 16:08:44 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Thu Oct 30 15:15:52 2014 +0530

----------------------------------------------------------------------
 test/integration/component/test_escalations_templates.py |  3 +--
 tools/marvin/marvin/lib/base.py                          | 11 -----------
 2 files changed, 1 insertion(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1e7feea/test/integration/component/test_escalations_templates.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_escalations_templates.py b/test/integration/component/test_escalations_templates.py
index 78028bc..3dc24c1 100644
--- a/test/integration/component/test_escalations_templates.py
+++ b/test/integration/component/test_escalations_templates.py
@@ -839,9 +839,8 @@ class TestTemplates(cloudstackTestCase):
                     count = count + 1
 
             # Copying the Template from Zone1 to Zone2
-            copied_template = Template.copy(
+            copied_template = template_created.copy(
                                             self.userapiclient,
-                                            template_created.id,
                                             sourcezoneid=template_created.zoneid,
                                             destzoneid=zones_list[1].id
                                             )

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1e7feea/tools/marvin/marvin/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py
index 7f53328..580d0ab 100755
--- a/tools/marvin/marvin/lib/base.py
+++ b/tools/marvin/marvin/lib/base.py
@@ -1255,17 +1255,6 @@ class Template:
         [setattr(cmd, k, v) for k, v in kwargs.items()]
         return(apiclient.updateTemplate(cmd))
 
-    @classmethod
-    def copy(cls, apiclient, id, sourcezoneid, destzoneid):
-        "Copy Template from source Zone to Destination Zone"
-
-        cmd = copyTemplate.copyTemplateCmd()
-        cmd.id = id
-        cmd.sourcezoneid = sourcezoneid
-        cmd.destzoneid = destzoneid
-
-        return apiclient.copyTemplate(cmd)
-
     def copy(self, apiclient, sourcezoneid, destzoneid):
         "Copy Template from source Zone to Destination Zone"
 


[41/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CVE­2014­3566: Avoid using SSLv3 on apache2 webserver used by SSVM

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/master
Commit: 2d58bb6256af8bb71dc67075fd926744a661b945
Parents: 28d5b98
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Tue Nov 4 14:49:19 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Nov 4 14:49:19 2014 +0530

----------------------------------------------------------------------
 tools/appliance/definitions/systemvm64template/postinstall.sh | 1 +
 tools/appliance/definitions/systemvmtemplate/postinstall.sh   | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2d58bb62/tools/appliance/definitions/systemvm64template/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvm64template/postinstall.sh b/tools/appliance/definitions/systemvm64template/postinstall.sh
index 32e59d9..b634f11 100644
--- a/tools/appliance/definitions/systemvm64template/postinstall.sh
+++ b/tools/appliance/definitions/systemvm64template/postinstall.sh
@@ -223,6 +223,7 @@ configure_apache2() {
    # Backup stock apache configuration since we may modify it in Secondary Storage VM
    cp /etc/apache2/sites-available/default /etc/apache2/sites-available/default.orig
    cp /etc/apache2/sites-available/default-ssl /etc/apache2/sites-available/default-ssl.orig
+   sed -i 's/SSLProtocol all -SSLv2$/SSLProtocol all -SSLv2 -SSLv3/g' /etc/apache2/mods-available/ssl.conf
 }
 
 configure_services() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2d58bb62/tools/appliance/definitions/systemvmtemplate/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
index a292203..a1ae792 100644
--- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
@@ -213,6 +213,7 @@ configure_apache2() {
    # Backup stock apache configuration since we may modify it in Secondary Storage VM
    cp /etc/apache2/sites-available/default /etc/apache2/sites-available/default.orig
    cp /etc/apache2/sites-available/default-ssl /etc/apache2/sites-available/default-ssl.orig
+   sed -i 's/SSLProtocol all -SSLv2$/SSLProtocol all -SSLv2 -SSLv3/g' /etc/apache2/mods-available/ssl.conf
 }
 
 configure_services() {


[06/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7800: VMware - Hot plug/unplug NIC to/from VM only when vmware tools are installed, else assert for exception

Signed-off-by: SrikanteswaraRao Talluri <ta...@apache.org>


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

Branch: refs/heads/master
Commit: 070e689c4f4622f6a923cce61d4de2c20c2c28fe
Parents: 0d6a277
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Tue Oct 28 11:05:20 2014 +0530
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Wed Oct 29 15:06:08 2014 +0530

----------------------------------------------------------------------
 test/integration/smoke/test_nic.py | 352 ++++++++++++++++++--------------
 1 file changed, 200 insertions(+), 152 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/070e689c/test/integration/smoke/test_nic.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py
index 488ed0a..f130bbe 100644
--- a/test/integration/smoke/test_nic.py
+++ b/test/integration/smoke/test_nic.py
@@ -15,24 +15,27 @@
 # specific language governing permissions and limitations
 # under the License.
 """ NIC tests for VM """
-import marvin
-from marvin.codes import FAILED
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.sshClient import SshClient
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
+from marvin.cloudstackTestCase import cloudstackTestCase, unittest
+from marvin.lib.base import (Account,
+                             ServiceOffering,
+                             Network,
+                             VirtualMachine,
+                             NetworkOffering)
+from marvin.lib.common import (get_zone,
+                               get_template,
+                               get_domain)
 from nose.plugins.attrib import attr
 
 import signal
 import sys
 import time
 
+
 class TestNic(cloudstackTestCase):
 
     def setUp(self):
         self.cleanup = []
+
         def signal_handler(signal, frame):
             self.tearDown()
             sys.exit(0)
@@ -40,171 +43,217 @@ class TestNic(cloudstackTestCase):
         # assign the signal handler immediately
         signal.signal(signal.SIGINT, signal_handler)
 
-        hypervisor = self.testClient.getHypervisorInfo()
-        if hypervisor.lower() == "hyperv":
+        self.hypervisor = self.testClient.getHypervisorInfo()
+        if self.hypervisor.lower() == "hyperv":
             raise unittest.SkipTest("Not supported on Hyper-V")
 
         try:
             self.apiclient = self.testClient.getApiClient()
-            self.dbclient  = self.testClient.getDbConnection()
-            self.services  = self.testClient.getParsedTestDataConfig()
+            self.dbclient = self.testClient.getDbConnection()
+            self.services = self.testClient.getParsedTestDataConfig()
 
             # Get Zone, Domain and templates
             domain = get_domain(self.apiclient)
-            zone = get_zone(self.apiclient, self.testClient.getZoneForTests())
-            self.services['mode'] = zone.networktype
+            self.zone = get_zone(
+                self.apiclient,
+                self.testClient.getZoneForTests()
+                )
 
-            #if local storage is enabled, alter the offerings to use localstorage
-            #this step is needed for devcloud
-            if zone.localstorageenabled == True:
-                self.services["service_offerings"]["tiny"]["storagetype"] = 'local'
+            # if local storage is enabled, alter the offerings to use
+            # localstorage
+            # this step is needed for devcloud
+            if self.zone.localstorageenabled:
+                self.services["service_offerings"][
+                    "tiny"]["storagetype"] = 'local'
 
             template = get_template(
-                                self.apiclient,
-                                zone.id,
-                                self.services["ostype"]
-                                )
+                self.apiclient,
+                self.zone.id,
+                self.services["ostype"]
+            )
             # Set Zones and disk offerings
-            self.services["small"]["zoneid"] = zone.id
+            self.services["small"]["zoneid"] = self.zone.id
             self.services["small"]["template"] = template.id
 
-            self.services["iso1"]["zoneid"] = zone.id
-            self.services["network"]["zoneid"] = zone.id
+            self.services["iso1"]["zoneid"] = self.zone.id
+            self.services["network"]["zoneid"] = self.zone.id
 
             # Create Account, VMs, NAT Rules etc
             self.account = Account.create(
-                                self.apiclient,
-                                self.services["account"],
-                                domainid=domain.id
-                                )
+                self.apiclient,
+                self.services["account"],
+                domainid=domain.id
+            )
             self.cleanup.insert(0, self.account)
 
             self.service_offering = ServiceOffering.create(
-                                        self.apiclient,
-                                        self.services["service_offerings"]["tiny"]
-                                        )
+                self.apiclient,
+                self.services["service_offerings"]["tiny"]
+            )
             self.cleanup.insert(0, self.service_offering)
 
             ####################
-            ### Network offering
+            # Network offering
             self.network_offering = NetworkOffering.create(
-                                        self.apiclient,
-                                        self.services["network_offering"],
-                                        )
+                self.apiclient,
+                self.services["network_offering"],
+            )
             self.cleanup.insert(0, self.network_offering)
-            self.network_offering.update(self.apiclient, state='Enabled') # Enable Network offering
-            self.services["network"]["networkoffering"] = self.network_offering.id
+            self.network_offering.update(
+                self.apiclient,
+                state='Enabled')  # Enable Network offering
+            self.services["network"][
+                "networkoffering"] = self.network_offering.id
 
             self.network_offering_shared = NetworkOffering.create(
-                                        self.apiclient,
-                                        self.services["network_offering_shared"],
-                                        )
+                self.apiclient,
+                self.services["network_offering_shared"],
+            )
             self.cleanup.insert(0, self.network_offering_shared)
-            self.network_offering_shared.update(self.apiclient, state='Enabled') # Enable Network offering
-            self.services["network2"]["networkoffering"] = self.network_offering_shared.id
+            self.network_offering_shared.update(
+                self.apiclient,
+                state='Enabled')  # Enable Network offering
+            self.services["network2"][
+                "networkoffering"] = self.network_offering_shared.id
 
             ################
-            ### Test Network
+            # Test Network
             self.test_network = Network.create(
-                                                 self.apiclient,
-                                                 self.services["network"],
-                                                 self.account.name,
-                                                 self.account.domainid,
-                                                 )
+                self.apiclient,
+                self.services["network"],
+                self.account.name,
+                self.account.domainid,
+            )
             self.cleanup.insert(0, self.test_network)
             self.test_network2 = Network.create(
-                                                 self.apiclient,
-                                                 self.services["network2"],
-                                                 self.account.name,
-                                                 self.account.domainid,
-                                                 zoneid=self.services["network"]["zoneid"]
-                                                 )
+                self.apiclient,
+                self.services["network2"],
+                self.account.name,
+                self.account.domainid,
+                zoneid=self.services["network"]["zoneid"]
+            )
             self.cleanup.insert(0, self.test_network2)
         except Exception as ex:
             self.debug("Exception during NIC test SETUP!: " + str(ex))
 
-    @attr(tags = ["devcloud",  "smoke", "advanced", "advancedns"], required_hardware="true")
+    @attr(
+        tags=[
+            "devcloud",
+            "smoke",
+            "advanced",
+            "advancedns"],
+        required_hardware="true")
     def test_01_nic(self):
-        #TODO: SIMENH: add validation
+        # TODO: SIMENH: add validation
         """Test to add and update added nic to a virtual machine"""
 
-        try:
-            self.virtual_machine = VirtualMachine.create(
-                                        self.apiclient,
-                                        self.services["small"],
-                                        accountid=self.account.name,
-                                        domainid=self.account.domainid,
-                                        serviceofferingid=self.service_offering.id,
-                                        mode=self.services['mode'],
-                                        networkids=[self.test_network.id]
-                                    )
-            self.cleanup.insert(0, self.virtual_machine)
-            list_vm_response = list_virtual_machines(
-                                                     self.apiclient,
-                                                     id=self.virtual_machine.id
-                                                     )
-
-            self.debug(
-                    "Verify listVirtualMachines response for virtual machine: %s" \
-                    % self.virtual_machine.id
-                )
-
-            self.assertEqual(
-                                isinstance(list_vm_response, list),
-                                True,
-                                "Check list response returns a valid list"
-                            )
-
-            self.assertNotEqual(
-                                len(list_vm_response),
-                                0,
-                                "Check VM available in List Virtual Machines"
-                            )
-            vm_response = list_vm_response[0]
-
-            self.assertEqual(
-
-                                vm_response.id,
-                                self.virtual_machine.id,
-                                "Check virtual machine id in listVirtualMachines"
-                            )
-
-            self.assertEqual(
-                        vm_response.name,
-                        self.virtual_machine.name,
-                        "Check virtual machine name in listVirtualMachines"
-                        )
-
-            self.assertEqual(
-                        len(vm_response.nic),
-                        1,
-                        "Verify we only start with one nic"
-                        )
-
-            self.assertEqual(
-                vm_response.nic[0].isdefault,
-                True,
-                "Verify initial adapter is set to default"
-            )
-            existing_nic_ip = vm_response.nic[0].ipaddress
-            existing_nic_id = vm_response.nic[0].id
-
+        hypervisorIsVmware = False
+        isVmwareToolInstalled = False
+        assertForExceptionForNicOperations = False
+        if self.hypervisor.lower() == "vmware":
+            hypervisorIsVmware = True
+
+        self.virtual_machine = VirtualMachine.create(
+            self.apiclient,
+            self.services["small"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering.id,
+            networkids=[self.test_network.id],
+            mode=self.zone.networktype if hypervisorIsVmware else "default"
+        )
+
+        # If hypervisor is Vmware, then check if
+        # the vmware tools are installed and the process is running
+        # Vmware tools are necessary for add and remove nic operations
+        if hypervisorIsVmware:
+            sshClient = self.virtual_machine.get_ssh_client()
+            result = str(
+                sshClient.execute("service vmware-tools status")).lower()
+            self.debug("and result is: %s" % result)
+            if "running" in result:
+                isVmwareToolInstalled = True
+
+        # If Vmware tools are not installed in case of vmware hypervisor
+        # then check for exception while performing add and remove nic
+        # operations
+        if hypervisorIsVmware and not isVmwareToolInstalled:
+            assertForExceptionForNicOperations = True
+
+        self.cleanup.insert(0, self.virtual_machine)
+        list_vm_response = 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_vm_response, list),
+            True,
+            "Check list response returns a valid list"
+        )
+
+        self.assertNotEqual(
+            len(list_vm_response),
+            0,
+            "Check VM available in List Virtual Machines"
+        )
+        vm_response = list_vm_response[0]
+
+        self.assertEqual(
+
+            vm_response.id,
+            self.virtual_machine.id,
+            "Check virtual machine id in listVirtualMachines"
+        )
+
+        self.assertEqual(
+            vm_response.name,
+            self.virtual_machine.name,
+            "Check virtual machine name in listVirtualMachines"
+        )
+
+        self.assertEqual(
+            len(vm_response.nic),
+            1,
+            "Verify we only start with one nic"
+        )
+
+        self.assertEqual(
+            vm_response.nic[0].isdefault,
+            True,
+            "Verify initial adapter is set to default"
+        )
+        existing_nic_ip = vm_response.nic[0].ipaddress
+        existing_nic_id = vm_response.nic[0].id
+
+        if assertForExceptionForNicOperations:
+            with self.assertRaises(Exception):
+                self.virtual_machine.add_nic(
+                    self.apiclient,
+                    self.test_network2.id)
+
+        else:
             # 1. add a nic
-            add_response = self.virtual_machine.add_nic(self.apiclient, self.test_network2.id)
+            self.virtual_machine.add_nic(self.apiclient, self.test_network2.id)
 
             time.sleep(5)
             # now go get the vm list?
 
-            list_vm_response = list_virtual_machines(
-                                                self.apiclient,
-                                                id=self.virtual_machine.id
-                                                )
+            list_vm_response = VirtualMachine.list(
+                self.apiclient,
+                id=self.virtual_machine.id
+            )
 
             self.assertEqual(
-                        len(list_vm_response[0].nic),
-                        2,
-                        "Verify we have 2 NIC's now"
-                        )
+                len(list_vm_response[0].nic),
+                2,
+                "Verify we have 2 NIC's now"
+            )
 
             new_nic_id = ""
             for nc in list_vm_response[0].nic:
@@ -215,12 +264,13 @@ class TestNic(cloudstackTestCase):
 
             time.sleep(5)
 
-            list_vm_response = list_virtual_machines(
-                                                self.apiclient,
-                                                id=self.virtual_machine.id
-                                                )
+            list_vm_response = VirtualMachine.list(
+                self.apiclient,
+                id=self.virtual_machine.id
+            )
 
-            # iterate as we don't know for sure what order our NIC's will be returned to us.
+            # iterate as we don't know for sure what order our NIC's will be
+            # returned to us.
             for nc in list_vm_response[0].nic:
                 if nc.ipaddress == existing_nic_ip:
                     self.assertEqual(
@@ -235,33 +285,28 @@ class TestNic(cloudstackTestCase):
                         "Verify second adapter is set to default"
                     )
 
-            sawException = False
-            try:
+            with self.assertRaises(Exception):
                 self.virtual_machine.remove_nic(self.apiclient, new_nic_id)
-            except Exception as ex:
-                sawException = True
 
-            self.assertEqual(sawException, True, "Make sure we cannot delete the default NIC")
-            self.virtual_machine.update_default_nic(self.apiclient, existing_nic_id)
+            self.virtual_machine.update_default_nic(
+                self.apiclient,
+                existing_nic_id)
             time.sleep(5)
             self.virtual_machine.remove_nic(self.apiclient, new_nic_id)
             time.sleep(5)
 
-            list_vm_response = list_virtual_machines(
-                                                self.apiclient,
-                                                id=self.virtual_machine.id
-                                                )
+            list_vm_response = VirtualMachine.list(
+                self.apiclient,
+                id=self.virtual_machine.id
+            )
 
             self.assertEqual(
-                        len(list_vm_response[0].nic),
-                        1,
-                        "Verify we are back to a signle NIC"
-                        )
+                len(list_vm_response[0].nic),
+                1,
+                "Verify we are back to a signle NIC"
+            )
 
-            return
-        except Exception as ex:
-            self.debug("Exception during NIC test!: " + str(ex))
-            self.assertEqual(True, False, "Exception during NIC test!: " + str(ex))
+        return
 
     def tearDown(self):
         try:
@@ -270,7 +315,10 @@ class TestNic(cloudstackTestCase):
                     obj.delete(self.apiclient)
                     time.sleep(10)
                 except Exception as ex:
-                    self.debug("Error deleting: " + str(obj) + ", exception: " + str(ex))
+                    self.debug(
+                        "Error deleting: " +
+                        str(obj) +
+                        ", exception: " +
+                        str(ex))
         except Exception as e:
             self.debug("Warning! Exception in tearDown: %s" % e)
-


[32/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7826: UI - dialog widget - dependent dropdown field (dependsOn property specified) - fix a bug that default opton in dependent dropdown field didn't trigger change event handler until another option in dependent dropdown field was selected.


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

Branch: refs/heads/master
Commit: 3760fdeeb4a278600f30102dfa3f9e64752b724a
Parents: 6df396c
Author: Jessica Wang <je...@apache.org>
Authored: Fri Oct 31 15:31:24 2014 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Fri Oct 31 15:31:24 2014 -0700

----------------------------------------------------------------------
 ui/scripts/ui/dialog.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3760fdee/ui/scripts/ui/dialog.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js
index f7946dc..332b78f 100644
--- a/ui/scripts/ui/dialog.js
+++ b/ui/scripts/ui/dialog.js
@@ -237,7 +237,10 @@
 
                             if (($target.is(':checked') && !isReverse) ||
                                 ($target.is(':unchecked') && isReverse)) {
-                                $dependent.css('display', 'inline-block');
+                                
+                            	$dependent.css('display', 'inline-block'); //show dependent dropdown field
+                                $dependent.change(); //trigger event handler for default option in dependent dropdown field (CLOUDSTACK-7826)
+                                
                                 $dependent.each(function() {
                                     if ($(this).data('dialog-select-fn')) {
                                         $(this).data('dialog-select-fn')();


[02/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
CLOUDSTACK-7809: UI > remove unnecessary cookie 'capabilities', 'supportELB', 'kvmsnapshotenabled', 'regionsecondaryenabled', 'userpublictemplateenabled', 'userProjectsEnabled'.


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

Branch: refs/heads/master
Commit: 1ea6f7dd584b8817d025088431845949f8ed1825
Parents: 429ea8b
Author: Jessica Wang <je...@apache.org>
Authored: Tue Oct 28 15:02:05 2014 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Oct 28 15:02:05 2014 -0700

----------------------------------------------------------------------
 ui/scripts/cloudStack.js | 69 ++++++++-----------------------------------
 1 file changed, 12 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1ea6f7dd/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index ea6fc16..6b4e15a 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -172,37 +172,15 @@
                     dataType: "json",
                     async: false,
                     success: function(json) {
-                        g_capabilities = json.listcapabilitiesresponse.capability;
-                        $.cookie('capabilities', g_capabilities, {
-                            expires: 1
-                        });
-
-                        g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean
-                        $.cookie('supportELB', g_supportELB, {
-                            expires: 1
-                        });
-
-                        g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean
-                        $.cookie('kvmsnapshotenabled', g_kvmsnapshotenabled, {
-                            expires: 1
-                        });                        
-                                               
-                        g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
-                        $.cookie('regionsecondaryenabled', g_regionsecondaryenabled, {
-                            expires: 1
-                        }); 
-                                              
+                        g_capabilities = json.listcapabilitiesresponse.capability;                        
+                        g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean   
+                        g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean          
+                        g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean    
                         if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
-                            g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
-                            $.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, {
-                                expires: 1
-                            });
+                            g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean                            
                         }
-
                         g_userProjectsEnabled = json.listcapabilitiesresponse.capability.allowusercreateprojects;
-                        $.cookie('userProjectsEnabled', g_userProjectsEnabled, {
-                            expires: 1
-                        });
+                       
 
                         g_cloudstackversion = json.listcapabilitiesresponse.capability.cloudstackversion;
 
@@ -314,36 +292,14 @@
                             async: false,
                             success: function(json) {
                                 g_capabilities = json.listcapabilitiesresponse.capability;
-                                $.cookie('capabilities', g_capabilities, {
-                                    expires: 1
-                                });
-
-                                g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean
-                                $.cookie('supportELB', g_supportELB, {
-                                    expires: 1
-                                });
-
-                                g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean
-                                $.cookie('kvmsnapshotenabled', g_kvmsnapshotenabled, {
-                                    expires: 1
-                                });   
-                                
-                                g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
-                                $.cookie('regionsecondaryenabled', g_regionsecondaryenabled, {
-                                    expires: 1
-                                }); 
-                                
+                                g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean      
+                                g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean           
+                                g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean                               
                                 if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
-                                    g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
-                                    $.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, {
-                                        expires: 1
-                                    });
+                                    g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean                                    
                                 }
-
                                 g_userProjectsEnabled = json.listcapabilitiesresponse.capability.allowusercreateprojects;
-                                $.cookie('userProjectsEnabled', g_userProjectsEnabled, {
-                                    expires: 1
-                                });
+                                
 
                                 g_cloudstackversion = json.listcapabilitiesresponse.capability.cloudstackversion;
 
@@ -413,8 +369,7 @@
                         $.cookie('networktype', null);
                         $.cookie('timezoneoffset', null);
                         $.cookie('timezone', null);
-                        $.cookie('supportELB', null);
-
+                        
                         if (onLogoutCallback()) { //onLogoutCallback() will set g_loginResponse(single-sign-on variable) to null, then bypassLoginCheck() will show login screen.
                             document.location.reload(); //when onLogoutCallback() returns true, reload the current document.
                         }


[47/50] [abbrv] git commit: updated refs/heads/master to 4c5f792

Posted by ra...@apache.org.
Fixed CLOUDSTACK-7242: Adding a securing config using configDepo doesnt work

In ConfigurationVo, changed the setter to do the encryption if required
like the getter. Called the setter in constructor as well.

Removed references of encryption check in different places.

Reviewed-by: Santhosh Edukulla

This closes #35


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

Branch: refs/heads/master
Commit: c3e5964dcbbd3b3ff34562aeeb9f8daa154ee7d1
Parents: c15ed74
Author: Rajani Karuturi <ra...@gmail.com>
Authored: Tue Nov 4 18:16:50 2014 +0530
Committer: Rajani Karuturi <ra...@gmail.com>
Committed: Wed Nov 5 11:49:38 2014 +0530

----------------------------------------------------------------------
 .../config/dao/ConfigurationDaoImpl.java          |  3 ---
 .../framework/config/impl/ConfigurationVO.java    | 18 +++++++++++++++---
 .../com/cloud/server/ConfigurationServerImpl.java |  3 +--
 3 files changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c3e5964d/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
----------------------------------------------------------------------
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java b/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
index 2934b01..f3f0495 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
@@ -210,9 +210,6 @@ public class ConfigurationDaoImpl extends GenericDaoBase<ConfigurationVO, String
                     update(name, category, initValue);
                 }
             } else {
-                if (category.equals("Hidden") || category.equals("Secure")) {
-                    initValue = DBEncryptionUtil.encrypt(initValue);
-                }
                 ConfigurationVO newConfig = new ConfigurationVO(category, "DEFAULT", "management-server", name, initValue, desc);
                 persist(newConfig);
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c3e5964d/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigurationVO.java
----------------------------------------------------------------------
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigurationVO.java b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigurationVO.java
index cda96c9..b317ea2 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigurationVO.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigurationVO.java
@@ -73,8 +73,8 @@ public class ConfigurationVO implements Configuration {
         this.instance = instance;
         this.component = component;
         this.name = name;
-        this.value = value;
         this.description = description;
+        setValue(value);
     }
 
     public ConfigurationVO(String component, ConfigKey<?> key) {
@@ -122,11 +122,23 @@ public class ConfigurationVO implements Configuration {
 
     @Override
     public String getValue() {
-        return (("Hidden".equals(getCategory()) || "Secure".equals(getCategory())) ? DBEncryptionUtil.decrypt(value) : value);
+        if(isEncryptedConfig()) {
+            return DBEncryptionUtil.decrypt(value);
+        } else {
+            return value;
+        }
     }
 
     public void setValue(String value) {
-        this.value = value;
+        if(isEncryptedConfig()) {
+            this.value = DBEncryptionUtil.encrypt(value);
+        } else {
+            this.value = value;
+        }
+    }
+
+    private boolean isEncryptedConfig() {
+        return "Hidden".equals(getCategory()) || "Secure".equals(getCategory());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c3e5964d/server/src/com/cloud/server/ConfigurationServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java
index 990f2ff..7b0d898 100755
--- a/server/src/com/cloud/server/ConfigurationServerImpl.java
+++ b/server/src/com/cloud/server/ConfigurationServerImpl.java
@@ -203,7 +203,6 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
                     String instance = "DEFAULT";
                     String component = c.getComponent();
                     String value = c.getDefaultValue();
-                    value = ("Hidden".equals(category) || "Secure".equals(category)) ? DBEncryptionUtil.encrypt(value) : value;
                     String description = c.getDescription();
                     ConfigurationVO configVO = new ConfigurationVO(category, instance, component, name, value, description);
                     configVO.setDefaultValue(value);
@@ -635,7 +634,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
                 }
                 String base64Keystore = getBase64Keystore(keystorePath);
                 ConfigurationVO configVO =
-                        new ConfigurationVO("Hidden", "DEFAULT", "management-server", "ssl.keystore", DBEncryptionUtil.encrypt(base64Keystore),
+                        new ConfigurationVO("Hidden", "DEFAULT", "management-server", "ssl.keystore", base64Keystore,
                                 "SSL Keystore for the management servers");
                 _configDao.persist(configVO);
                 s_logger.info("Stored SSL keystore to database.");