def ipv6_iscsi_storage_domain(system, host, engine_storage_ipv6, lun_id):
    DOMAIN_NAME = 'iscsi-ipv6'
    ISCSI_ADDRESS = engine_storage_ipv6
    ISCSI_PORT = 3260
    ISCSI_TARGET = 'iqn.2014-07.org.ovirt:storage'

    lun = storagelib.LogicalUnit(
        id=lun_id,
        address=ISCSI_ADDRESS,
        port=ISCSI_PORT,
        target=ISCSI_TARGET,
    )

    host_storage_data = storagelib.HostStorageData(
        storage_type=storagelib.StorageType.ISCSI,
        address=None,
        path=None,
        logical_units=(lun, ),
    )

    with storage_domain(
            system,
            DOMAIN_NAME,
            storagelib.StorageDomainType.DATA,
            host,
            host_storage_data,
    ) as sd:
        yield sd
Beispiel #2
0
def ipv6_nfs_storage_domain(system, host, engine_storage_ipv6):
    DOMAIN_NAME = 'nfs-ipv6'
    DEFAULT_DOMAIN_PATH = '/exports/nfs/share2'

    sd = storagelib.StorageDomain(system)
    host_storage_data = storagelib.HostStorageData(
        storage_type=storagelib.StorageType.NFS,
        address='[' + engine_storage_ipv6 + ']',
        path=DEFAULT_DOMAIN_PATH,
        nfs_version=storagelib.NfsVersion.V4_2)

    with storage_domain(system, DOMAIN_NAME, storagelib.StorageDomainType.DATA,
                        host, host_storage_data) as sd:
        yield sd
Beispiel #3
0
def default_storage_domain(system, engine_ip, host_0_up, default_data_center):
    # workaround for BZ 1779280
    time.sleep(5)
    storage_domain = storagelib.StorageDomain(system)
    storage_domain.create(name=DEFAULT_DOMAIN_NAME,
                          domain_type=storagelib.StorageDomainType.DATA,
                          host=host_0_up,
                          host_storage_data=storagelib.HostStorageData(
                              storage_type=storagelib.StorageType.NFS,
                              address=engine_ip,
                              path=DEFAULT_DOMAIN_PATH,
                              nfs_version=storagelib.NfsVersion.V4_2))
    storage_domain.wait_for_unattached_status()

    default_data_center.attach_storage_domain(storage_domain)
    default_data_center.wait_for_sd_active_status(storage_domain)

    return storage_domain
Beispiel #4
0
def default_storage_domain(system, storage_facts, host_0_up,
                           default_data_center):
    host_0_up.workaround_bz_1779280()
    storage_domain = storagelib.StorageDomain(system)
    try:
        storage_domain.import_by_name(DEFAULT_DOMAIN_NAME)
    except EntityNotFoundError:
        storage_domain.create(
            name=DEFAULT_DOMAIN_NAME,
            domain_type=storagelib.StorageDomainType.DATA,
            host=host_0_up,
            host_storage_data=storagelib.HostStorageData(
                storage_type=storagelib.StorageType.NFS,
                address=storage_facts.default_ip(urlize=True),
                path=DEFAULT_DOMAIN_PATH,
                nfs_version=storagelib.NfsVersion.V4_2,
            ),
        )
        storage_domain.wait_for_unattached_status()
        default_data_center.attach_storage_domain(storage_domain)
    default_data_center.wait_for_sd_active_status(storage_domain)
    return storage_domain