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])
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])
def disconnectVnic(portId): executeOrExit([EXT_BRCTL, 'delif', DUMMY_BRIDGE, devName('tap', portId)])
def disconnectVnic(portId): executeOrExit( ['/usr/sbin/ip', 'link', 'set', devName('tap', portId), 'nomaster'])
def disconnectVnic(portId): executeOrExit([ '/usr/sbin/ip', 'link', 'set', devName('tap', portId), 'nomaster'])
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)
def disconnectVnic(portId): executeOrExit([EXT_BRCTL, "delif", DUMMY_BRIDGE, devName("tap", portId)])
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)