diff --git a/devstack/tools/ironic/scripts/configure-vm.py b/devstack/tools/ironic/scripts/configure-vm.py index 18590279ae..aeb25ff15c 100755 --- a/devstack/tools/ironic/scripts/configure-vm.py +++ b/devstack/tools/ironic/scripts/configure-vm.py @@ -79,6 +79,8 @@ def main(): help='The number of interfaces to add to VM.'), parser.add_argument('--mac', default=None, help='The mac for the first interface on the vm') + parser.add_argument('--mtu', default=None, + help='The mtu for the interfaces on the vm') parser.add_argument('--console-log', help='File to log console') parser.add_argument('--emulator', default=None, @@ -114,6 +116,7 @@ def main(): 'bootdev': args.bootdev, 'interface_count': args.interface_count, 'mac': args.mac, + 'mtu': args.mtu, 'nicdriver': args.libvirt_nic_driver, 'emulator': args.emulator, 'disk_format': args.disk_format, diff --git a/devstack/tools/ironic/scripts/create-node.sh b/devstack/tools/ironic/scripts/create-node.sh index 5cca0ffc25..4920f6d857 100755 --- a/devstack/tools/ironic/scripts/create-node.sh +++ b/devstack/tools/ironic/scripts/create-node.sh @@ -88,16 +88,8 @@ BLOCK_SIZE=${BLOCK_SIZE:-512} INTERFACE_COUNT=${INTERFACE_COUNT:-1} for int in $(seq 1 $INTERFACE_COUNT); do - tapif=tap-${NAME}i${int} ovsif=ovs-${NAME}i${int} - # NOTE(vsaienko) use veth pair here to ensure that interface - # exists in OVS even when VM is powered off. - sudo ip link add dev $tapif type veth peer name $ovsif - for l in $tapif $ovsif; do - sudo ip link set dev $l up - sudo ip link set $l mtu $INTERFACE_MTU - done - sudo ovs-vsctl add-port $BRIDGE $ovsif + sudo ovs-vsctl --no-wait add-port $BRIDGE $ovsif done if [ -n "$MAC_ADDRESS" ] ; then @@ -133,9 +125,9 @@ if ! virsh list --all | grep -q $NAME; then --arch $ARCH --cpus $CPU --memory $MEM --libvirt-nic-driver $LIBVIRT_NIC_DRIVER \ --disk-format $DISK_FORMAT $VM_LOGGING --engine $ENGINE $UEFI_OPTS $vm_opts \ --interface-count $INTERFACE_COUNT $MAC_ADDRESS --machine_type $MACHINE_TYPE \ - --block-size $BLOCK_SIZE >&2 + --block-size $BLOCK_SIZE --mtu ${INTERFACE_MTU} >&2 fi # echo mac in format mac1,ovs-node-0i1;mac2,ovs-node-0i2;...;macN,ovs-node0iN -VM_MAC=$(echo -n $(virsh domiflist $NAME |awk '/tap-/{print $5","$3}')|tr ' ' ';' |sed s/tap-/ovs-/g) +VM_MAC=$(echo -n $(virsh domiflist $NAME |awk '/ovs-/{print $5","$1}')|tr ' ' ';') echo -n "$VM_MAC $VBMC_PORT $PDU_OUTLET" diff --git a/devstack/tools/ironic/templates/vm.xml b/devstack/tools/ironic/templates/vm.xml index f91b166b78..eefd1b68bd 100644 --- a/devstack/tools/ironic/templates/vm.xml +++ b/devstack/tools/ironic/templates/vm.xml @@ -50,12 +50,12 @@ {% endfor %} {% for n in range(1, interface_count+1) %} - + {% if n == 1 and mac %} {% endif %} - - + + {% if uefi_loader and bootdev == 'network' %} {% endif %}