예제 #1
0
def _create_host(system, default_cluster, host_facts):
    host = hostlib.Host(system)
    try:
        host.import_by_name(host_facts.hostname)
    except EntityNotFoundError:
        host.create(default_cluster, host_facts.hostname,
                    host_facts.ipv4_default, ROOT_PASSWORD)
    return host
예제 #2
0
def _create_host(system, default_cluster, host_facts):
    host = hostlib.Host(system)
    try:
        host.import_by_name(host_facts.hostname)
        host.root_password = host_facts.ssh_password
    except EntityNotFoundError:
        host.create(default_cluster, host_facts.hostname,
                    host_facts.ipv4_default_address, host_facts.ssh_password)
    return host
def cluster_hosts_up(default_cluster, system):
    cluster_host_ids = default_cluster.host_ids()
    cluster_hosts = []
    for host_id in cluster_host_ids:
        host = hostlib.Host(system)
        host.import_by_id(host_id)
        host.wait_for_up_status(timeout=hostlib.HOST_TIMEOUT_LONG)
        cluster_hosts.append(host)
    return cluster_hosts
예제 #4
0
def _create_host(env, system, default_cluster, domain_name):
    vm = env.get_vms()[domain_name]
    host = hostlib.Host(system)
    try:
        host.import_by_name(vm.name())
    except EntityNotFoundError:
        host.create(default_cluster, vm.name(), vm.ip(),
                    str(vm.root_password()))
    return host
예제 #5
0
def host_in_ovs_cluster(system, ovs_cluster, default_cluster,
                        default_data_center):
    host_id = default_cluster.host_ids()[0]
    host = hostlib.Host(system)
    host.import_by_id(host_id)
    host.wait_for_up_status(timeout=hostlib.HOST_TIMEOUT_LONG)
    with host.toggle_cluster(ovs_cluster):
        host.sync_all_networks()
        default_data_center.wait_for_up_status()
        yield host
    host.sync_all_networks()
    default_data_center.wait_for_up_status()
예제 #6
0
def cluster_host_up(system, default_cluster):
    any_host_id = default_cluster.host_ids()[0]
    host = hostlib.Host(system)
    host.import_by_id(any_host_id)
    host.wait_for_up_status(timeout=hostlib.HOST_TIMEOUT_LONG)
    yield host
예제 #7
0
def _non_spm_host(system, host_ids):
    for host_id in host_ids:
        host = hostlib.Host(system)
        host.import_by_id(host_id)
        if host.is_not_spm or id == host_ids[-1]:
            return host