def test_02_migrate_vm_from_ceph_to_storpool_live(self):
        """
        Migrate VMs/Volumes live
        """
        self.storage_pool = StoragePool.update(self.apiclient,
                                               id=self.storage_pool.id,
                                               tags=["ssd, ceph"])
        random_data = self.writeToFile(self.vm2)
        cmd = listHosts.listHostsCmd()
        cmd.type = "Routing"
        cmd.state = "Up"
        cmd.zoneid = self.zone.id
        hosts = self.apiclient.listHosts(cmd)
        destinationHost = self.helper.getDestinationHost(
            self.vm2.hostid, hosts)
        vol_pool_map = {}
        volumes = list_volumes(self.apiclient,
                               virtualmachineid=self.vm2.id,
                               listall=True)
        for v in volumes:
            vol_pool_map[v.id] = self.storage_pool.id

        # Migrate the vm2
        print(vol_pool_map)
        vm2 = self.vm2.migrate_vm_with_volume(self.apiclient,
                                              hostid=destinationHost.id,
                                              migrateto=vol_pool_map)
        self.checkFileAndContentExists(self.vm2, random_data)

        self.storage_pool = StoragePool.update(self.apiclient,
                                               id=self.storage_pool.id,
                                               tags=["ssd"])
Esempio n. 2
0
def list_hosts(apiclient, **kwargs):
    """List all Hosts matching criteria"""

    cmd = listHosts.listHostsCmd()
    [setattr(cmd, k, v) for k, v in kwargs.items()]
    if "account" in kwargs.keys() and "domainid" in kwargs.keys():
        cmd.listall = True
    return apiclient.listHosts(cmd)
Esempio n. 3
0
def list_hosts(api_client, **kwargs):
    """List all Hosts matching criteria"""

    cmd = listHosts.listHostsCmd()
    [setattr(cmd, k, v) for k, v in kwargs.items()]
    if 'account' in kwargs.keys() and 'domainid' in kwargs.keys():
        cmd.listall = True
    return api_client.listHosts(cmd)
Esempio n. 4
0
def get_hypervisor_type(apiclient):

    """Return the hypervisor type of the hosts in setup"""

    cmd = listHosts.listHostsCmd()
    cmd.type = 'Routing'
    cmd.listall = True
    hosts = apiclient.listHosts(cmd)
    hosts_list_validation_result = validateList(hosts)
    assert hosts_list_validation_result[0] == PASS, "host list validation failed"
    return hosts_list_validation_result[1].hypervisor
Esempio n. 5
0
def get_hypervisor_type(apiclient):
    """Return the hypervisor type of the hosts in setup"""

    cmd = listHosts.listHostsCmd()
    cmd.type = 'Routing'
    cmd.listall = True
    hosts = apiclient.listHosts(cmd)
    hosts_list_validation_result = validateList(hosts)
    assert hosts_list_validation_result[
        0] == PASS, "host list validation failed"
    return hosts_list_validation_result[1].hypervisor
Esempio n. 6
0
def list_hosts(apiclient, **kwargs):
    """List all Hosts matching criteria"""

    cmd = listHosts.listHostsCmd()
    [setattr(cmd, k, v) for k, v in kwargs.items()]
    return(apiclient.listHosts(cmd))
Esempio n. 7
0
 def list_hosts_by_cluster_id(cls, apiclient, clusterid):
     """List all Hosts matching criteria"""
     cmd = listHosts.listHostsCmd()
     cmd.clusterid = clusterid
     return (apiclient.listHosts(cmd))
Esempio n. 8
0
def list_hosts(apiclient, **kwargs):
    """List all Hosts matching criteria"""

    cmd = listHosts.listHostsCmd()
    [setattr(cmd, k, v) for k, v in kwargs.items()]
    return (apiclient.listHosts(cmd))
Esempio n. 9
0
 def list_hosts_by_cluster_id(self, clusterid):
     """List all Hosts matching criteria"""
     cmd = listHosts.listHostsCmd()
     cmd.clusterid = clusterid  
     return(self.testClass.apiclient.listHosts(cmd))