예제 #1
0
def disconnectVnic(portId):
    brName = devName("qbr", portId)
    vethBr = devName("qvb", portId)
    vethOvs = devName("qvo", portId)

    if deviceExists(brName):
        executeOrExit([EXT_BRCTL, 'delif', brName, vethBr])
        executeOrExit([EXT_IP, 'link', 'set', brName, 'down'])
        executeOrExit([EXT_BRCTL, 'delbr', brName])
        executeOrExit([ovs_vsctl.cmd, 'del-port', INTEGRATION_BRIDGE, vethOvs])
        executeOrExit([EXT_IP, 'link', 'delete', vethOvs])
예제 #2
0
def disconnectVnic(portId):
    brName = devName("qbr", portId)
    vethBr = devName("qvb", portId)
    vethOvs = devName("qvo", portId)

    if deviceExists(brName):
        executeOrExit([EXT_BRCTL, 'delif', brName, vethBr])
        executeOrExit([EXT_IP, 'link', 'set', brName, 'down'])
        executeOrExit([EXT_BRCTL, 'delbr', brName])
        executeOrExit([EXT_OVS_VSCTL, 'del-port', INTEGRATION_BRIDGE, vethOvs])
        executeOrExit([EXT_IP, 'link', 'delete', vethOvs])
예제 #3
0
def disconnectVnic(portId):
    executeOrExit([EXT_BRCTL, 'delif', DUMMY_BRIDGE, devName('tap', portId)])
예제 #4
0
def disconnectVnic(portId):
    executeOrExit(
        ['/usr/sbin/ip', 'link', 'set',
         devName('tap', portId), 'nomaster'])
예제 #5
0
def disconnectVnic(portId):
    executeOrExit([EXT_BRCTL, 'delif', DUMMY_BRIDGE, devName('tap', portId)])
예제 #6
0
def disconnectVnic(portId):
    executeOrExit([
        '/usr/sbin/ip', 'link', 'set', devName('tap', portId), 'nomaster'])
예제 #7
0
def addOvsHybridVnic(domxml, iface, portId):
    brName = devName("qbr", portId)

    # TODO: Remove this check after bz 1045626 is fixed
    if not deviceExists(brName):
        executeOrExit([EXT_BRCTL, 'addbr', brName])
        executeOrExit([EXT_BRCTL, 'setfd', brName, '0'])
        executeOrExit([EXT_BRCTL, 'stp', brName, 'off'])

    vethBr = devName("qvb", portId)
    vethOvs = devName("qvo", portId)

    # TODO: Remove this check after bz 1045626 is fixed
    if not deviceExists(vethOvs):
        executeOrExit([EXT_IP, 'link', 'add', vethBr, 'type', 'veth', 'peer',
                      'name', vethOvs])
        for dev in [vethBr, vethOvs]:
            executeOrExit([EXT_IP, 'link', 'set', dev, 'up'])
            executeOrExit([EXT_IP, 'link', 'set', dev, 'promisc', 'on'])

        executeOrExit([EXT_IP, 'link', 'set', brName, 'up'])
        executeOrExit([EXT_BRCTL, 'addif', brName, vethBr])

        mac = iface.getElementsByTagName('mac')[0].getAttribute('address')
        executeOrExit([ovs_vsctl.cmd, '--', '--may-exist', 'add-port',
                       INTEGRATION_BRIDGE, vethOvs,
                       '--', 'set', 'Interface', vethOvs,
                       'external-ids:iface-id=%s' % portId,
                       'external-ids:iface-status=active',
                       'external-ids:attached-mac=%s' % mac])

    defineLinuxBridge(domxml, iface, portId, brName)
예제 #8
0
def disconnectVnic(portId):
    executeOrExit([EXT_BRCTL, "delif", DUMMY_BRIDGE, devName("tap", portId)])
예제 #9
0
def addOvsHybridVnic(domxml, iface, portId):
    brName = devName("qbr", portId)

    # TODO: Remove this check after bz 1045626 is fixed
    if not deviceExists(brName):
        executeOrExit([EXT_BRCTL, 'addbr', brName])
        executeOrExit([EXT_BRCTL, 'setfd', brName, '0'])
        executeOrExit([EXT_BRCTL, 'stp', brName, 'off'])

    vethBr = devName("qvb", portId)
    vethOvs = devName("qvo", portId)

    # TODO: Remove this check after bz 1045626 is fixed
    if not deviceExists(vethOvs):
        executeOrExit([
            EXT_IP, 'link', 'add', vethBr, 'type', 'veth', 'peer', 'name',
            vethOvs
        ])
        for dev in [vethBr, vethOvs]:
            executeOrExit([EXT_IP, 'link', 'set', dev, 'up'])
            executeOrExit([EXT_IP, 'link', 'set', dev, 'promisc', 'on'])

        executeOrExit([EXT_IP, 'link', 'set', brName, 'up'])
        executeOrExit([EXT_BRCTL, 'addif', brName, vethBr])

        mac = iface.getElementsByTagName('mac')[0].getAttribute('address')
        executeOrExit([
            ovs_vsctl.cmd, '--', '--may-exist', 'add-port', INTEGRATION_BRIDGE,
            vethOvs, '--', 'set', 'Interface', vethOvs,
            'external-ids:iface-id=%s' % portId,
            'external-ids:iface-status=active',
            'external-ids:attached-mac=%s' % mac
        ])

    defineLinuxBridge(domxml, iface, portId, brName)