You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Chandan Purushothama (JIRA)" <ji...@apache.org> on 2014/11/08 03:05:34 UTC

[jira] [Created] (CLOUDSTACK-7866) [Automation] Fix the script "/maint/test_host_high_availability.py" - ListHosts is picking System VMs as the hosts for VM migration

Chandan Purushothama created CLOUDSTACK-7866:
------------------------------------------------

             Summary: [Automation] Fix the script "/maint/test_host_high_availability.py" - ListHosts is picking System VMs as the hosts for VM migration
                 Key: CLOUDSTACK-7866
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7866
             Project: CloudStack
          Issue Type: Test
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Automation, Test
    Affects Versions: 4.5.0
            Reporter: Chandan Purushothama
            Assignee: Gaurav Aradhye
             Fix For: 4.5.0


The following code in test_04 is picking SSVM or CPVM as the host to be migrated to. This code needs to be changed.

{code}
        #Find out Non-Suitable host for VM migration
        list_hosts_response = list_hosts(
            self.apiclient,
        )
        self.assertEqual(
            isinstance(list_hosts_response, list),
            True,
            "listHosts returned invalid object in response."
        )

        self.assertNotEqual(
            len(list_hosts_response),
            0,
            "listHosts returned empty response."
        )

        notSuitableHost = None
        for host in list_hosts_response:
            if not host.suitableformigration and host.hostid != vm.hostid:
                notSuitableHost = host
                break

        self.assertTrue(notSuitableHost is not None, "notsuitablehost should not be None")

        #Migrate VM to Non-Suitable host
        self.debug("Migrating VM-ID: %s to Host: %s" % (vm.id, notSuitableHost.id))

        cmd = migrateVirtualMachine.migrateVirtualMachineCmd()
        cmd.hostid = notSuitableHost.id
        cmd.virtualmachineid = vm.id
        self.apiclient.migrateVirtualMachine(cmd)

{code}

*Error Message*:

{noformat}
Job failed: {jobprocstatus : 0, created : u'2014-11-05T17:13:56+0000', cmd : u'org.apache.cloudstack.api.command.admin.vm.MigrateVMCmd', userid : u'd9e7cf4a-649d-11e4-9ff3-ea75aeb47f80', jobstatus : 2, jobid : u'bc426924-e6be-4f40-91ca-1cbe13b3f09c', jobresultcode : 530, jobresulttype : u'object', jobresult : {errorcode : 431, errortext : u'The specified host(s-2-VM) is not suitable to migrate the VM, please specify another one'}, accountid : u'd9e7c22a-649d-11e4-9ff3-ea75aeb47f80'}  

Stacktrace

  File "/usr/lib/python2.7/unittest/case.py", line 332, in run
    testMethod()
  File "/root/cloudstack/test/integration/component/maint/test_host_high_availability.py", line 520, in test_04_cant_migrate_vm_to_host_with_ha_negative
    self.apiclient.migrateVirtualMachine(cmd)
  File "/usr/local/lib/python2.7/dist-packages/marvin/cloudstackAPI/cloudstackAPIClient.py", line 776, in migrateVirtualMachine
    response = self.connection.marvinRequest(command, response_type=response, method=method)
  File "/usr/local/lib/python2.7/dist-packages/marvin/cloudstackConnection.py", line 379, in marvinRequest
    raise e
'Job failed: {jobprocstatus : 0, created : u\'2014-11-05T17:13:56+0000\', cmd : u\'org.apache.cloudstack.api.command.admin.vm.MigrateVMCmd\', userid : u\'d9e7cf4a-649d-11e4-9ff3-ea75aeb47f80\', jobstatus : 2, jobid : u\'bc426924-e6be-4f40-91ca-1cbe13b3f09c\', jobresultcode : 530, jobresulttype : u\'object\', jobresult : {errorcode : 431, errortext : u\'The specified host(s-2-VM) is not suitable to migrate the VM, please specify another one\'}, accountid : u\'d9e7c22a-649d-11e4-9ff3-ea75aeb47f80\'}\n
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)