def prepare_migration_vlan(api):
    usages = params.Usages(['migration'])

    nt.assert_true(
        network_utils.set_network_usages_in_cluster(api, VLAN200_NET,
                                                    CLUSTER_NAME, usages))

    # Set VLAN200's MTU to match the other VLAN's on the NIC.
    nt.assert_true(
        network_utils.set_network_mtu(api, VLAN200_NET, DC_NAME, DEFAULT_MTU))
示例#2
0
def prepare_migration_vlan(api):
    usages = params.Usages(['migration'])

    nt.assert_true(
        network_utils_v3.set_network_usages_in_cluster(api, MIGRATION_NETWORK,
                                                       CLUSTER_NAME, usages))

    # Set Migration_Network's MTU to match the other VLAN's on the NIC.
    nt.assert_true(
        network_utils_v3.set_network_mtu(api, MIGRATION_NETWORK, DC_NAME,
                                         DEFAULT_MTU))
def add_non_vm_network(api):
    VLAN200 = params.Network(
        name=VLAN200_NET,
        data_center=params.DataCenter(name=DC_NAME, ),
        description='Non VM Network on VLAN 200, MTU 9000',
        vlan=params.VLAN(id='200', ),
        usages=params.Usages(),
        mtu=9000,
    )

    nt.assert_true(api.networks.add(VLAN200))
    nt.assert_true(api.clusters.get(CLUSTER_NAME).networks.add(VLAN200))
def add_non_vm_network(api):
    network = network_utils_v3.create_network_params(
        MIGRATION_NETWORK,
        DC_NAME,
        description='Non VM Network on VLAN 200, MTU 9000',
        vlan=params.VLAN(id='200', ),
        usages=params.Usages(),
        mtu=9000,
    )

    nt.assert_true(api.networks.add(network))
    nt.assert_true(api.clusters.get(CLUSTER_NAME).networks.add(network))
def add_labeled_network(api):
    """
    Creates a labeled network
    """

    # create network
    labeled_net = params.Network(
        name=LABELED_NET_NAME,
        data_center=params.DataCenter(name=DC_NAME, ),
        description='Labeled network on VLAN {}'.format(LABELED_NET_VLAN_ID),
        usages=params.Usages(),
        # because only one non-VLAN network, here 'ovirtmgmt', can be assigned to each nic,
        # this additional network has to be a VLAN network
        vlan=params.VLAN(id=LABELED_NET_VLAN_ID, ),
    )
    net = api.networks.add(labeled_net)
    nt.assert_true(net)

    # assign label to the network
    nt.assert_true(net.labels.add(params.Label(id=NETWORK_LABEL)))
    nt.assert_equal(len(net.labels.list(id=NETWORK_LABEL)), 1)