cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-3009) [VPC][VMware]Unable to execute NetworkUsage command on DomR (10.147.40.181), domR may not be ready yet. failure due to Exception: java.lang.Exception—when VPC/VPC VR is rebooted
Date Mon, 12 Nov 2018 13:50:00 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-3009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16683813#comment-16683813
] 

ASF GitHub Bot commented on CLOUDSTACK-3009:
--------------------------------------------

borisstoyanov commented on a change in pull request #3012: CLOUDSTACK-3009: Fixed resource
calculation CPU, RAM for accounts.
URL: https://github.com/apache/cloudstack/pull/3012#discussion_r232662467
 
 

 ##########
 File path: test/integration/smoke/test_resource_accounting.py
 ##########
 @@ -0,0 +1,243 @@
+# 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.
+
+from nose.plugins.attrib import attr
+
+# Import Local Modules
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.lib.base import (Domain,
+                             Account,
+                             ServiceOffering,
+                             VirtualMachine, updateResourceCount)
+from marvin.lib.common import (get_zone,
+                               get_test_template)
+from marvin.lib.utils import (cleanup_resources)
+
+
+class Services:
+    """Test Account Services
+    """
+
+    def __init__(self):
+        self.services = {
+            "domain": {
+                "name": "Domain",
+            },
+            "account": {
+                "email": "test@test.com",
+                "firstname": "Test",
+                "lastname": "User",
+                "username": "test",
+                # Random characters are appended for unique
+                # username
+                "password": "fr3sca",
+            },
+            "user": {
+                "email": "user@test.com",
+                "firstname": "User",
+                "lastname": "User",
+                "username": "User",
+                # Random characters are appended for unique
+                # username
+                "password": "fr3sca",
+            },
+            "service_offering_it_1": {
+                "name": "InstanceType-1",
+                "displaytext": "Tiny Instance",
+                "cpunumber": 1,
+                "cpuspeed": 100,
+                "memory": 128,
+            },
+            "service_offering_it_2": {
+                "name": "InstanceType-2",
+                "displaytext": "Tiny Instance",
+                "cpunumber": 4,
+                "cpuspeed": 100,
+                "memory": 512,
+            },
+            "virtual_machine_1": {
+                "displayname": "Test VM1",
+                "username": "root",
+                "password": "password",
+                "ssh_port": 22,
+                "hypervisor": 'XenServer',
+                "privateport": 22,
+                "publicport": 22,
+                "protocol": 'TCP',
+            },
+            "virtual_machine_2": {
+                "displayname": "Test VM2",
+                "username": "root",
+                "password": "password",
+                "ssh_port": 22,
+                "hypervisor": 'XenServer',
+                "privateport": 22,
+                "publicport": 22,
+                "protocol": 'TCP',
+            },
+            "template": {
+                "displaytext": "Public Template",
+                "name": "Public template",
+                "ostype": 'CentOS 5.6 (64-bit)',
+                "url": "",
+                "hypervisor": '',
+                "format": '',
+                "isfeatured": True,
+                "ispublic": True,
+                "isextractable": True,
+                "templatefilter": "self"
+            },
+            "natrule": {
+                "publicport": 22,
+                "privateport": 22,
+                "protocol": 'TCP',
+            },
+            "ostype": 'CentOS 5.6 (64-bit)',
+            "sleep": 60,
+            "timeout": 10,
+        }
+
+
+class TestRAMCPUResourceAccounting(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.testClient = super(
+            TestRAMCPUResourceAccounting,
+            cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+        cls.services['mode'] = cls.zone.networktype
+        cls.hypervisor = cls.testClient.getHypervisorInfo()
+        # Create an account, domain etc
+        cls.domain = Domain.create(
+            cls.api_client,
+            cls.services["domain"],
+        )
+        cls.account = Account.create(
+            cls.api_client,
+            cls.services["account"],
+            admin=True,
+            domainid=cls.domain.id
+        )
+
+        cls.template = get_test_template(
+            cls.api_client,
+            cls.zone.id,
+            cls.hypervisor)
+
+        cls.services["virtual_machine_1"]["zoneid"] = cls.zone.id
+        cls.services["virtual_machine_1"]["template"] = cls.template.id
+
+        cls.services["virtual_machine_2"]["zoneid"] = cls.zone.id
+        cls.services["virtual_machine_2"]["template"] = cls.template.id
+
+        cls._cleanup = [
+            cls.account,
+            cls.domain
+        ]
+
+    @classmethod
+    def tearDownClass(cls):
+        try:
+            # Cleanup resources used
+            cleanup_resources(cls.api_client, cls._cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+
+    def setUp(self):
+        self.apiclient = self.testClient.getApiClient()
+        self.dbclient = self.testClient.getDbConnection()
+        self.cleanup = []
+
+    def tearDown(self):
+        try:
+            # Clean up, terminate the created accounts
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+
+    def get_resource_amount(self, resource_type):
+        cmd = updateResourceCount.updateResourceCountCmd()
+        cmd.account = self.account.name
+        cmd.domainid = self.domain.id
+        cmd.resourcetype = resource_type
+        response = self.apiclient.updateResourceCount(cmd)
+        amount = response[0].resourcecount
+        return amount
+
+    @attr(tags=["advanced", "basic"], required_hardware="false")
+    def test_01_so_removal_resource_update(self):
+
+        self.service_offering_it_1 = ServiceOffering.create(
+            self.api_client,
+            self.services["service_offering_it_1"],
+            domainid=self.domain.id
+        )
+
+        self.cleanup.append(self.service_offering_it_1)
+
+        self.service_offering_it_2 = ServiceOffering.create(
+            self.api_client,
+            self.services["service_offering_it_2"],
+            domainid=self.domain.id
+        )
+
+        self.cleanup.append(self.service_offering_it_2)
+
+        vm_1 = VirtualMachine.create(
+            self.apiclient,
+            self.services["virtual_machine_1"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering_it_1.id
+        )
+
+        self.debug("Deployed VM in account: %s, ID: %s" % (self.account.name, vm_1.id))
+        self.cleanup.append(vm_1)
+
+        vm_2 = VirtualMachine.create(
+            self.apiclient,
+            self.services["virtual_machine_2"],
+            accountid=self.account.name,
+            domainid=self.account.domainid,
+            serviceofferingid=self.service_offering_it_2.id
+        )
+
+        self.debug("Deployed VM in account: %s, ID: %s" % (self.account.name, vm_2.id))
+        self.cleanup.append(vm_2)
+
+        CPU_RESOURCE_ID = 8
+        RAM_RESOURCE_ID = 9
+
+        cores = int(self.get_resource_amount(CPU_RESOURCE_ID))
+        ram = int(self.get_resource_amount(RAM_RESOURCE_ID))
+
+        self.assertEqual(cores, self.services['service_offering_it_1']['cpunumber'] + self.services['service_offering_it_2']['cpunumber'])
+        self.assertEqual(ram, self.services['service_offering_it_1']['memory'] + self.services['service_offering_it_2']['memory'])
+
+        self.service_offering_it_2.delete(self.apiclient)
+
+        self.cleanup = self.cleanup[0:-1]
+
+        cores = int(self.get_resource_amount(CPU_RESOURCE_ID))
+        ram = int(self.get_resource_amount(RAM_RESOURCE_ID))
+
+        self.assertEqual(cores, self.services['service_offering_it_1']['cpunumber'] + self.services['service_offering_it_2']['cpunumber'])
+        self.assertEqual(ram, self.services['service_offering_it_1']['memory'] + self.services['service_offering_it_2']['memory'])
 
 Review comment:
   Test LGMT, let's wait for the results 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> [VPC][VMware]Unable to execute NetworkUsage command on DomR (10.147.40.181), domR may
not be ready yet. failure due to Exception: java.lang.Exception—when VPC/VPC VR is rebooted
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-3009
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3009
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Network Controller
>    Affects Versions: 4.2.0
>            Reporter: manasaveloori
>            Assignee: Kishan Kavala
>            Priority: Critical
>             Fix For: 4.2.0
>
>         Attachments: management-server.zip
>
>
> Steps:
> 1.	Have a CS with advanced zone and with VMware host.
> 2.	Create VPC .
> 3.	Create a private gateway and a static route to it.
> 4.	Reboot  the VPC VR.
> 5.	After successful reboot of VR, now restart the VPC.
>            OR
> After step 3 Restart the VPC and after successful restart, now reboot VR.
> Observation:
> Observed the following exception when VPC is restarted/VR is rebooted.
> 2013-06-14 20:11:28,390 ERROR [vmware.resource.VmwareResource] (DirectAgent-142:10.147.40.29)
Unable to execute NetworkUsage command on DomR (10.147.40.184), domR may not be ready yet.
failure due to Exception: java.lang.Exception
> Message:  vpc network usage get returns empty
> java.lang.Exception:  vpc network usage get returns empty
>         at com.cloud.hypervisor.vmware.resource.VmwareResource.VPCNetworkUsage(VmwareResource.java:676)
>         at com.cloud.hypervisor.vmware.resource.VmwareResource.execute(VmwareResource.java:622)
>         at com.cloud.hypervisor.vmware.resource.VmwareResource.executeRequest(VmwareResource.java:472)
>         at com.cloud.agent.manager.DirectAgentAttache$Task.run(DirectAgentAttache.java:186)
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:679)
> 2013-06-14 20:11:28,400 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-142:null)
Seq 1-519307624: Response Received:
> Attaching the MS log.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message