Example #1
0
def get_luns(prefix, host, port, target, from_lun, to_lun=None):
    out = prefix.virt_env.get_vm(host).ssh(['cat', '/root/multipath.txt']).out
    if six.PY3:
        out = out.decode('utf-8')
    if to_lun is not None:  # take a range of LUNs
        lun_guids = out.splitlines()[from_lun:to_lun]
    else:  # take a single LUN from the list.
        lun_guids = [out.splitlines()[from_lun]]
    if prefix.virt_env.get_net(testlib.get_prefixed_name(
            'net-storage')):  # use -net-storage network
        ips = prefix.virt_env.get_vm(host).ips_in_net(
            testlib.get_prefixed_name('net-storage'))
    else:  # or get all IPs if suite doesn't have net-storage network
        ips = prefix.virt_env.get_vm(host).all_ips()
    luns = []
    for lun_id in lun_guids:
        for ip in ips:
            lun = types.LogicalUnit(
                id=lun_id,
                address=ip,
                port=port,
                target=target,
                username='******',
                password='******',
            )
            luns.append(lun)

    return luns
Example #2
0
def replace_ipv4_with_ipv6_addresses(prefix):
    mgmt_net = prefix.virt_env.get_net()
    mgmt_net.add_mapping(testlib.get_prefixed_name('engine'),
                         ipv6_utils.ENGINE_IPV6_ADDRESS)
    mgmt_net.add_mapping(testlib.get_prefixed_name('host-0'),
                         ipv6_utils.HOST0_IPV6_ADDRESS)
    mgmt_net.add_mapping(testlib.get_prefixed_name('host-1'),
                         ipv6_utils.HOST1_IPV6_ADDRESS)
    mgmt_net.add_mapping(testlib.get_prefixed_name('storage'),
                         ipv6_utils.STORAGE_IPV6_ADDRESS)
def add_generic_nfs_storage_domain_4(prefix, sd_nfs_name, nfs_host_name, mount_path, sd_format='v4', sd_type='data', nfs_version='v4_2'):
    if sd_type == 'data':
        dom_type = sdk4.types.StorageDomainType.DATA
    elif sd_type == 'iso':
        dom_type = sdk4.types.StorageDomainType.ISO
    elif sd_type == 'export':
        dom_type = sdk4.types.StorageDomainType.EXPORT

    if nfs_version == 'v3':
        nfs_vers = sdk4.types.NfsVersion.V3
    elif nfs_version == 'v4':
        nfs_vers = sdk4.types.NfsVersion.V4
    elif nfs_version == 'v4_1':
        nfs_vers = sdk4.types.NfsVersion.V4_1
    elif nfs_version == 'v4_2':
        nfs_vers = sdk4.types.NfsVersion.V4_2
    else:
        nfs_vers = sdk4.types.NfsVersion.AUTO

    api = prefix.virt_env.engine_vm().get_api(api_ver=4)
    ips = _get_host_ips_in_net(prefix, nfs_host_name, testlib.get_prefixed_name('net-storage'))
    p = sdk4.types.StorageDomain(
        name=sd_nfs_name,
        description='APIv4 NFS storage domain',
        type=dom_type,
        host=_random_host_from_dc_4(api, DC_NAME),
        storage=sdk4.types.HostStorage(
            type=sdk4.types.StorageType.NFS,
            address=ips[0],
            path=mount_path,
            nfs_version=nfs_vers,
        ),
    )

    _add_storage_domain_4(api, p)
def add_generic_nfs_storage_domain_4(prefix, sd_nfs_name, nfs_host_name, mount_path, sd_format='v4', sd_type='data', nfs_version='v4_2'):
    if sd_type == 'data':
        dom_type = sdk4.types.StorageDomainType.DATA
    elif sd_type == 'iso':
        dom_type = sdk4.types.StorageDomainType.ISO
    elif sd_type == 'export':
        dom_type = sdk4.types.StorageDomainType.EXPORT

    if nfs_version == 'v3':
        nfs_vers = sdk4.types.NfsVersion.V3
    elif nfs_version == 'v4':
        nfs_vers = sdk4.types.NfsVersion.V4
    elif nfs_version == 'v4_1':
        nfs_vers = sdk4.types.NfsVersion.V4_1
    elif nfs_version == 'v4_2':
        nfs_vers = sdk4.types.NfsVersion.V4_2
    else:
        nfs_vers = sdk4.types.NfsVersion.AUTO

    api = prefix.virt_env.engine_vm().get_api(api_ver=4)
    ips = _get_host_ips_in_net(prefix, nfs_host_name, testlib.get_prefixed_name('net-storage'))
    p = sdk4.types.StorageDomain(
        name=sd_nfs_name,
        description='APIv4 NFS storage domain',
        type=dom_type,
        host=_random_host_from_dc_4(api, DC_NAME),
        storage=sdk4.types.HostStorage(
            type=sdk4.types.StorageType.NFS,
            address=ips[0],
            path=mount_path,
            nfs_version=nfs_vers,
        ),
    )

    _add_storage_domain_4(api, p)
def add_hosts(prefix):
    hosts = get_fake_hosts() if USE_VDSMFAKE else prefix.virt_env.host_vms()
    if not USE_VDSMFAKE:
        for host in hosts:
            host.ssh(['ntpdate', '-4', testlib.get_prefixed_name('engine')])

    api = prefix.virt_env.engine_vm().get_api_v4()
    add_hosts_4(api, hosts)
def add_hosts(prefix):
    hosts = get_fake_hosts() if USE_VDSMFAKE else prefix.virt_env.host_vms()
    if not USE_VDSMFAKE:
        for host in hosts:
            host.ssh(['ntpdate', '-4', testlib.get_prefixed_name('engine')])

    api = prefix.virt_env.engine_vm().get_api_v4()
    add_hosts_4(api, hosts)
Example #7
0
def open_connection_to_api_with_ipv6_on_relevant_suite():
    if IPV6_ONLY:
        prefix = testlib.get_test_prefix()
        engine_vm = prefix.virt_env.engine_vm()
        with _create_url_from_ipv6_for_api(
                prefix,
                testlib.get_prefixed_name('engine')
        ):
            engine_vm.get_api(api_ver=4)
            engine_vm.get_api()
Example #8
0
def add_hosts(prefix):
    hosts = prefix.virt_env.host_vms()
    for host in hosts:
        host.ssh(['ntpdate', '-4', testlib.get_prefixed_name('engine')])

    if API_V4:
        api = prefix.virt_env.engine_vm().get_api_v4()
        add_hosts_4(api, hosts)
    else:
        api = prefix.virt_env.engine_vm().get_api()
        add_hosts_3(api, hosts)
def add_hosts(prefix):
    hosts = prefix.virt_env.host_vms()
    for host in hosts:
        host.ssh(['ntpdate', '-4', testlib.get_prefixed_name('engine')])

    if API_V4:
        api = prefix.virt_env.engine_vm().get_api_v4()
        add_hosts_4(api, hosts)
    else:
        api = prefix.virt_env.engine_vm().get_api()
        add_hosts_3(api, hosts)
Example #10
0
def add_hosts(prefix):
    hosts = prefix.virt_env.host_vms()
    for host in hosts:
        host.ssh(['chronyc', '-4', 'add', 'server', testlib.get_prefixed_name('engine')])
        host.ssh(['chronyc', '-4', 'makestep'])

    if API_V4:
        api = prefix.virt_env.engine_vm().get_api_v4()
        add_hosts_4(api, hosts)
    else:
        api = prefix.virt_env.engine_vm().get_api()
        add_hosts_3(api, hosts)
Example #11
0
def add_hosts(prefix):
    hosts = get_fake_hosts() if USE_VDSMFAKE else prefix.virt_env.host_vms()
    if not USE_VDSMFAKE:
        for host in hosts:
            host.ssh([
                'chronyc', '-4', 'add', 'server',
                testlib.get_prefixed_name('engine')
            ])
            host.ssh(['chronyc', '-4', 'makestep'])

    api = prefix.virt_env.engine_vm().get_api_v4()
    add_hosts_4(api, hosts)
def add_generic_nfs_storage_domain(prefix,
                                   sd_nfs_name,
                                   nfs_host_name,
                                   mount_path,
                                   sd_format='v4',
                                   sd_type='data',
                                   nfs_version='v4_2'):
    if sd_type == 'data':
        dom_type = sdk4.types.StorageDomainType.DATA
    elif sd_type == 'iso':
        dom_type = sdk4.types.StorageDomainType.ISO
    elif sd_type == 'export':
        dom_type = sdk4.types.StorageDomainType.EXPORT

    if nfs_version == 'v3':
        nfs_vers = sdk4.types.NfsVersion.V3
    elif nfs_version == 'v4':
        nfs_vers = sdk4.types.NfsVersion.V4
    elif nfs_version == 'v4_1':
        nfs_vers = sdk4.types.NfsVersion.V4_1
    elif nfs_version == 'v4_2':
        nfs_vers = sdk4.types.NfsVersion.V4_2
    else:
        nfs_vers = sdk4.types.NfsVersion.AUTO

    api = prefix.virt_env.engine_vm().get_api_v4()
    ips = _get_host_ips_in_net(prefix, nfs_host_name,
                               testlib.get_prefixed_name('net-management'))
    kwargs = {}
    if sd_format >= 'v4':
        if not versioning.cluster_version_ok(4, 1):
            kwargs['storage_format'] = sdk4.types.StorageFormat.V3
        elif not versioning.cluster_version_ok(4, 3):
            kwargs['storage_format'] = sdk4.types.StorageFormat.V4
    random_host = _random_host_from_dc_4(api, DC_NAME)
    LOGGER.debug('random host: {}'.format(random_host.name))
    p = sdk4.types.StorageDomain(name=sd_nfs_name,
                                 description='APIv4 NFS storage domain',
                                 type=dom_type,
                                 host=random_host,
                                 storage=sdk4.types.HostStorage(
                                     type=sdk4.types.StorageType.NFS,
                                     address=ips[0],
                                     path=mount_path,
                                     nfs_version=nfs_vers,
                                 ),
                                 **kwargs)

    _add_storage_domain(api, p)
Example #13
0
def add_hosts(prefix):
    hosts = prefix.virt_env.host_vms()
    for host in hosts:
        host.ssh([
            'chronyc', '-4', 'add', 'server',
            testlib.get_prefixed_name('engine')
        ])
        host.ssh(['chronyc', '-4', 'makestep'])

    if API_V4:
        api = prefix.virt_env.engine_vm().get_api_v4()
        add_hosts_4(api, hosts)
    else:
        api = prefix.virt_env.engine_vm().get_api()
        add_hosts_3(api, hosts)
def add_hosts_3(prefix):
    api = prefix.virt_env.engine_vm().get_api()

    def _add_host(vm):
        p = params.Host(
            name=vm.name(),
            address=vm.ip(),
            cluster=params.Cluster(
                name=CLUSTER_NAME,
            ),
            root_password=vm.root_password(),
            override_iptables=True,
        )

        return api.hosts.add(p)

    def _host_is_up():
        cur_state = api.hosts.get(host.name()).status.state

        if cur_state == 'up':
            return True

        if cur_state == 'install_failed':
            raise RuntimeError('Host %s failed to install' % host.name())
        if cur_state == 'non_operational':
            raise RuntimeError('Host %s is in non operational state' % host.name())

    hosts = prefix.virt_env.host_vms()

    for host in hosts:
        host.ssh(['ntpdate', '-4', testlib.get_prefixed_name('engine')])

    vec = utils.func_vector(_add_host, [(h,) for h in hosts])
    vt = utils.VectorThread(vec)
    vt.start_all()
    nt.assert_true(all(vt.join_all()))

    for host in hosts:
        testlib.assert_true_within(_host_is_up, timeout=15 * 60)

    for host in hosts:
        host.ssh(['rm', '-rf', '/dev/shm/yum', '/dev/shm/*.rpm'])
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
#
# Refer to the README and COPYING files for full details of the license
#

from lago import utils
from netaddr.ip import IPAddress
import nose.tools as nt
from ovirtlago import testlib
from ovirtsdk4.types import Bonding, HostNic, Option

import test_utils
from test_utils import network_utils_v4

# Environment (see control.sh and LagoInitFile.in)
LIBVIRT_NETWORK_FOR_MANAGEMENT = testlib.get_prefixed_name(
    'net-management')  # eth0
LIBVIRT_NETWORK_FOR_BONDING = testlib.get_prefixed_name(
    'net-bonding')  # eth2, eth3

# DC/Cluster
DC_NAME = 'test-dc'
CLUSTER_NAME = 'test-cluster'

# Networks
VM_NETWORK = 'VM_Network'
VM_NETWORK_IPv4_ADDR = '192.0.2.1'
VM_NETWORK_IPv4_MASK = '255.255.255.0'
VM_NETWORK_IPv6_ADDR = '2001:0db8:85a3:0000:0000:8a2e:0370:7331'
VM_NETWORK_IPv6_MASK = '64'
VM_NETWORK_VLAN_ID = 100
Example #16
0
# Refer to the README and COPYING files for full details of the license
#

import nose.tools as nt
import os
import tempfile

from ovirtsdk.xml import params

from ovirtlago import testlib


# AAA
AAA_LDAP_USER = '******'
AAA_LDAP_AUTHZ_PROVIDER = 'lago.local-authz'
HOSTNAME_389DS = testlib.get_prefixed_name('engine')


@testlib.with_ovirt_prefix
def add_ldap_provider(prefix):
    engine = prefix.virt_env.engine_vm()
    machine_389ds = prefix.virt_env.get_vm(HOSTNAME_389DS)

    answer_file_src = os.path.join(
        os.environ.get('SUITE'),
        'aaa-ldap-answer-file.conf'
    )

    with open(answer_file_src, 'r') as f:
        content = f.read()
        content = content.replace('@389DS_IP@', machine_389ds.ip())
from lago import utils
from ovirtlago import testlib

# DC/Cluster
DC_NAME = 'Default'
DC_VER_MAJ = 4
DC_VER_MIN = 1
SD_FORMAT = 'v4'
CLUSTER_NAME = 'Default'
DC_QUOTA_NAME = 'DC-QUOTA'

# Storage
MASTER_SD_TYPE = 'glusterfs'
MASTER_SD_GLUSTER_VOL = 'vmstore'
MASTER_SD_NAME = 'vmstore'
GLUSTER_HOST0 = testlib.get_prefixed_name('host0')
GLUSTER_HOST1 = testlib.get_prefixed_name('host1')
GLUSTER_HOST2 = testlib.get_prefixed_name('host2')

SD_NFS_NAME = 'nfs'
SD_NFS_HOST_NAME = testlib.get_prefixed_name('storage')
SD_NFS_PATH = '/exports/nfs/share1'

SD_ISCSI_NAME = 'iscsi'
SD_ISCSI_HOST_NAME = testlib.get_prefixed_name('engine')
SD_ISCSI_TARGET = 'iqn.2014-07.org.ovirt:storage'
SD_ISCSI_PORT = 3260
SD_ISCSI_NR_LUNS = 2

SD_ISO_NAME = 'iso'
SD_ISO_HOST_NAME = SD_NFS_HOST_NAME
Example #18
0
#
# Refer to the README and COPYING files for full details of the license
#

import nose.tools as nt
import os
import tempfile

from ovirtsdk.xml import params

from ovirtlago import testlib

# AAA
AAA_LDAP_USER = '******'
AAA_LDAP_AUTHZ_PROVIDER = 'lago.local-authz'
HOSTNAME_389DS = testlib.get_prefixed_name('storage')


@testlib.with_ovirt_prefix
def add_ldap_provider(prefix):
    engine = prefix.virt_env.engine_vm()
    machine_389ds = prefix.virt_env.get_vm(HOSTNAME_389DS)

    answer_file_src = os.path.join(os.environ.get('SUITE'),
                                   'aaa-ldap-answer-file.conf')

    with open(answer_file_src, 'r') as f:
        content = f.read()
        content = content.replace('@389DS_IP@', machine_389ds.ip())

    with tempfile.NamedTemporaryFile(delete=False) as temp:
# Refer to the README and COPYING files for full details of the license
#

from lago import utils
from netaddr.ip import IPAddress
import nose.tools as nt
from ovirtlago import testlib
from ovirtsdk4.types import Bonding, HostNic, Option, VnicProfile, VnicPassThrough, VnicPassThroughMode

import test_utils
from test_utils import network_utils_v4
from test_utils import versioning


# Environment (see control.sh and LagoInitFile.in)
LIBVIRT_NETWORK_FOR_MANAGEMENT = testlib.get_prefixed_name('net-management')  # eth0
LIBVIRT_NETWORK_FOR_BONDING = testlib.get_prefixed_name('net-bonding')  # eth2, eth3

# DC/Cluster
DC_NAME = 'test-dc'
CLUSTER_NAME = 'test-cluster'

# Networks
VM_NETWORK = u'VM Network with a very long name and עברית'
VM_NETWORK_IPv4_ADDR = '192.0.2.{}'
VM_NETWORK_IPv4_MASK = '255.255.255.0'
VM_NETWORK_IPv6_ADDR = '2001:0db8:85a3:0000:0000:8a2e:0370:733{}'
VM_NETWORK_IPv6_MASK = '64'
VM_NETWORK_VLAN_ID = 100

MIGRATION_NETWORK = 'Migration_Net'  # MTU 9000
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
#
# Refer to the README and COPYING files for full details of the license
#
import nose.tools as nt
from ovirtsdk.xml import params

from ovirtlago import testlib
from lago import utils

import test_utils
from test_utils import network_utils

# Environment (see control.sh and LagoInitFile.in)
LIBVIRT_NETWORK_FOR_BONDING = testlib.get_prefixed_name('net-bonding')

# DC/Cluster
DC_NAME = 'test-dc'
CLUSTER_NAME = 'test-cluster'

# Networks
NIC_NAME = 'eth0'

VM_NETWORK = 'VM_Network'
VM_NETWORK_IPv4_ADDR = '192.0.2.1'
VM_NETWORK_IPv4_MASK = '255.255.255.0'
VM_NETWORK_IPv6_ADDR = '2001:0db8:85a3:0000:0000:8a2e:0370:7331'
VM_NETWORK_IPv6_MASK = '64'
VLAN_IF_NAME = '%s.100' % (NIC_NAME, )
Example #21
0
    API_V4 = True


# DC/Cluster
DC_NAME = 'test-dc'
DC_VER_MAJ, DC_VER_MIN = versioning.cluster_version()
SD_FORMAT = 'v4'
CLUSTER_NAME = 'test-cluster'
DC_QUOTA_NAME = 'DC-QUOTA'

# Storage
MASTER_SD_TYPE = 'iscsi'

SD_NFS_NAME = 'nfs'
SD_SECOND_NFS_NAME = 'second-nfs'
SD_NFS_HOST_NAME = testlib.get_prefixed_name('engine')
SD_NFS_PATH = '/exports/nfs/share1'
SD_SECOND_NFS_PATH = '/exports/nfs/share2'

SD_ISCSI_NAME = 'iscsi'
SD_ISCSI_HOST_NAME = testlib.get_prefixed_name('engine')
SD_ISCSI_TARGET = 'iqn.2014-07.org.ovirt:storage'
SD_ISCSI_PORT = 3260
SD_ISCSI_NR_LUNS = 2

SD_ISO_NAME = 'iso'
SD_ISO_HOST_NAME = SD_NFS_HOST_NAME
SD_ISO_PATH = '/exports/nfs/iso'

SD_TEMPLATES_NAME = 'templates'
SD_TEMPLATES_HOST_NAME = SD_NFS_HOST_NAME
from lago import utils
from ovirtlago import testlib

# DC/Cluster
DC_NAME = 'Default'
DC_VER_MAJ = 4
DC_VER_MIN = 1
SD_FORMAT = 'v4'
CLUSTER_NAME = 'Default'
DC_QUOTA_NAME = 'DC-QUOTA'

# Storage
MASTER_SD_TYPE = 'glusterfs'
MASTER_SD_GLUSTER_VOL = 'vmstore'
MASTER_SD_NAME = 'vmstore'
GLUSTER_HOST0 = testlib.get_prefixed_name('host0')
GLUSTER_HOST1 = testlib.get_prefixed_name('host1')
GLUSTER_HOST2 = testlib.get_prefixed_name('host2')

SD_NFS_NAME = 'nfs'
SD_NFS_HOST_NAME = testlib.get_prefixed_name('storage')
SD_NFS_PATH = '/exports/nfs/share1'

SD_ISCSI_NAME = 'iscsi'
SD_ISCSI_HOST_NAME = testlib.get_prefixed_name('engine')
SD_ISCSI_TARGET = 'iqn.2014-07.org.ovirt:storage'
SD_ISCSI_PORT = 3260
SD_ISCSI_NR_LUNS = 2

SD_ISO_NAME = 'iso'
SD_ISO_HOST_NAME = SD_NFS_HOST_NAME
Example #23
0
import nose.tools as nt
import os
import tempfile

from ovirtsdk.xml import params
import ovirtsdk4.types as types

from ovirtlago import testlib


# AAA
AAA_LDAP_USER = '******'
AAA_LDAP_GROUP = 'mygroup'
AAA_LDAP_AUTHZ_PROVIDER = 'lago.local-authz'
HOSTNAME_389DS = testlib.get_prefixed_name('engine')


@testlib.with_ovirt_prefix
def add_ldap_provider(prefix):
    engine = prefix.virt_env.engine_vm()
    machine_389ds = prefix.virt_env.get_vm(HOSTNAME_389DS)

    answer_file_src = os.path.join(
        os.environ.get('SUITE'),
        'aaa-ldap-answer-file.conf'
    )

    with open(answer_file_src, 'r') as f:
        content = f.read()
        content = content.replace('@389DS_IP@', machine_389ds.ip())
from lago import utils
from ovirtlago import testlib

# DC/Cluster
DC_NAME = 'test-dc'
DC_VER_MAJ = 4
DC_VER_MIN = 0
CLUSTER_NAME = 'test-cluster'
CLUSTER_CPU_FAMILY = 'Intel Conroe Family'
DC_QUOTA_NAME = 'DC-QUOTA'

# Storage
MASTER_SD_TYPE = 'iscsi'

SD_NFS_NAME = 'nfs'
SD_NFS_HOST_NAME = testlib.get_prefixed_name('storage-nfs')
SD_NFS_PATH = '/exports/nfs_clean/share1'

SD_ISCSI_NAME = 'iscsi'
SD_ISCSI_HOST_NAME = testlib.get_prefixed_name('storage-iscsi')
SD_ISCSI_TARGET = 'iqn.2014-07.org.ovirt:storage'
SD_ISCSI_PORT = 3260
SD_ISCSI_NR_LUNS = 2

SD_ISO_NAME = 'iso'
SD_ISO_HOST_NAME = SD_NFS_HOST_NAME
SD_ISO_PATH = '/exports/iso'

SD_TEMPLATES_NAME = 'templates'
SD_TEMPLATES_HOST_NAME = SD_ISO_HOST_NAME
SD_TEMPLATES_PATH = '/exports/nfs_exported'
Example #25
0
# DC/Cluster
DC_NAME = 'Default'
DC_VER_MAJ = 4
DC_VER_MIN = 2
SD_FORMAT = 'v4'
CLUSTER_NAME = 'Default'
DC_QUOTA_NAME = 'DC-QUOTA'
HE_DC_NAME = 'Default'
HE_CLUSTER_NAME = 'Default'

# Storage
MASTER_SD_TYPE = 'iscsi'

SD_NFS_NAME = 'nfs'
SD_NFS_HOST_NAME = testlib.get_prefixed_name('storage')
SD_NFS_PATH = '/exports/nfs/share1'

SD_ISCSI_NAME = 'iscsi'
SD_ISCSI_HOST_NAME = testlib.get_prefixed_name('storage')
SD_ISCSI_TARGET = 'iqn.2014-07.org.ovirt:storage'
SD_ISCSI_PORT = 3260
SD_ISCSI_NR_LUNS = 2

SD_ISO_NAME = 'iso'
SD_ISO_HOST_NAME = SD_NFS_HOST_NAME
SD_ISO_PATH = '/exports/nfs/iso'

SD_TEMPLATES_NAME = 'templates'
SD_TEMPLATES_HOST_NAME = SD_NFS_HOST_NAME
SD_TEMPLATES_PATH = '/exports/nfs/exported'
TEMPLATE_CENTOS7 = 'centos7_template'
TEMPLATE_CIRROS = 'CirrOS_0.3.4_for_x86_64_glance_template'

SD_NFS_NAME = 'nfs'
SD_SECOND_NFS_NAME = 'second-nfs'
SD_ISCSI_NAME = 'iscsi'

VM0_NAME = 'vm0'
VM1_NAME = 'vm1'
VM2_NAME = 'vm2'
DISK0_NAME = '%s_disk0' % VM0_NAME
DISK1_NAME = '%s_disk1' % VM1_NAME
DISK2_NAME = '%s_disk2' % VM2_NAME
GLANCE_DISK_NAME = 'CirrOS_0.3.4_for_x86_64_glance_disk'

SD_ISCSI_HOST_NAME = testlib.get_prefixed_name('engine')
SD_ISCSI_TARGET = 'iqn.2014-07.org.ovirt:storage'
SD_ISCSI_PORT = 3260
SD_ISCSI_NR_LUNS = 2
DLUN_DISK_NAME = 'DirectLunDisk'
SD_TEMPLATES_NAME = 'templates'


@testlib.with_ovirt_api
def add_vm_blank(api):
    vm_memory = 512 * MB
    vm_params = params.VM(
        memory=vm_memory,
        os=params.OperatingSystem(type_='other_linux', ),
        type_='server',
        high_availability=params.HighAvailability(enabled=True, ),
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
#
# Refer to the README and COPYING files for full details of the license
#
import nose.tools as nt
from ovirtsdk.xml import params

from lago import utils
from ovirtlago import testlib

import test_utils
from test_utils import network_utils_v3


# Environment (see control.sh and LagoInitFile.in)
LIBVIRT_NETWORK_FOR_BONDING = testlib.get_prefixed_name('net-bonding')  # eth2, eth3

# DC/Cluster
DC_NAME = 'test-dc'
CLUSTER_NAME = 'test-cluster'

# Networks
VM_NETWORK = 'VM_Network'
VM_NETWORK_IPv4_ADDR = '192.0.2.1'
VM_NETWORK_IPv4_MASK = '255.255.255.0'
VM_NETWORK_IPv6_ADDR = '2001:0db8:85a3:0000:0000:8a2e:0370:7331'
VM_NETWORK_IPv6_MASK = '64'
NIC_NAME = 'eth0'
VM_NETWORK_VLAN_ID = 100
VLAN_IF_NAME = '{}.{}'.format(NIC_NAME, VM_NETWORK_VLAN_ID)