Skip to content

Commit

Permalink
Merge pull request #1103 from Martchus/multinet
Browse files Browse the repository at this point in the history
qemu: Don't use deprecated/removed vlan option for multinet
  • Loading branch information
Martchus committed Feb 27, 2019
2 parents 99bdddd + cb3f677 commit 488a332
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
6 changes: 0 additions & 6 deletions backend/qemu.pm
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,6 @@ sub start_qemu {

die "no kvm-img/qemu-img found\n" unless $qemuimg;
die "no Qemu/KVM found\n" unless $qemubin;
die "MULTINET is not supported with NICTYPE==tap\n" if ($vars->{MULTINET} && $vars->{NICTYPE} eq "tap");

$self->{proc}->qemu_bin($qemubin);
$self->{proc}->qemu_img_bin($qemuimg);
Expand Down Expand Up @@ -803,11 +802,6 @@ sub start_qemu {
sp(lc($attribute), $vars->{$attribute}) if $vars->{$attribute};
}

if ($vars->{MULTINET}) {
sp('net', [qv "nic vlan=1 model=$vars->{NICMODEL} macaddr=52:54:00:12:34:57"]);
sp('net', [qw(none vlan=1)]);
}

unless ($vars->{QEMU_NO_TABLET}) {
if ($vars->{OFW} || $vars->{ARCH} eq 'aarch64') {
sp('device', 'nec-usb-xhci');
Expand Down
1 change: 0 additions & 1 deletion doc/backend_vars.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ ISO_$i;filename;;Aditional ISO to be attached to VM. Up to 9
KEEPHDDS;boolean;;Leave created HDD after test finishes. Useful for debugging tests
LAPTOP;boolean or filename;0;If 1, loads Dell E6330 DMI. If filename, loads specified DMI
MAKETESTSNAPSHOTS;boolean;0;Save snapshot for each test module in qcow image
MULTINET;boolean;0;VM will have two virtual NIC. Can't be used with NICTYPE tap
MULTIPATH;boolean;0;Add HDD drives as multipath devices. Override HDDMODEL to virtio-scsi-pci
NBF;boolean;0;open source network boot firmware e.g. to attach iscsi target on boot http://ipxe.org/
NICMAC;any MAC address;52:54:00:12:34:56;MAC address to be assigned to virtual network card
Expand Down
33 changes: 20 additions & 13 deletions doc/networking.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
# Networking in OpenQA
There are three possible network configurations for OpenQA virtual machines (VM).
The configuration is controlled by NICTYPE and MULTINET variables passed from OpenQA.
# Networking in openQA
There are three possible network configurations for openQA virtual machines when using the
qemu backend.

## default situation
By default NICTYPE is set to "user" and MULTINET is not set. In this case, each VM is created
The configuration is controlled by NICTYPE, NICMAC and NICVLAN variables passed from openQA.

## Default situation
By default NICTYPE is set to "user". In this case, each VM is created
with one network device, QEMU provided DHCP configuration. "User" network mode does have a
limitation - only TCP and UDP are supported. However no additional configuration is needed.

## options for "user" mode
## Options for "user" mode
If options for "user" mode are required, they can be set in NICTYPE_USER_OPTIONS variable.

## multiple network devices
When MULTINET variable is set, only NICTYPE set to "user" is supported. In this case, each VM
is created with two network devices using "user" network mode.

## TAP device support
When advanced configurations, routing or better performance is required, NICTYPE can be set to
"tap". In this case, preconfigured TAP device on host system is used as VM network device.
Which TAP device is used depends on TAPDEV variable which is automatically set to "tap" + worker id - 1,
i.e. worker1 uses tap0, worker 6 uses tap5. This mode requires system administrator to create
TAP device for each running worker and to manually prepare any routing or bridging before "tap"
i.e. worker1 uses tap0, worker 6 uses tap5. This mode requires the system administrator to create
a TAP device for each running worker and to manually prepare any routing or bridging before "tap"
networking can be used. TAP devices need to be created with proper permissions so VMs can access
them, e.g. "tunctl -u _openqa-worker -p -t tap0"
them, e.g. "tunctl -u _openqa-worker -p -t tap0".

## Multiple network devices
To create multiple network devices, one can set multiple, comma-separated MAC addresses
via NICMAC. The TAPDEV variable supports multiple, comma-separated values, too.

---

Also have a look at [Multi Machine Tests Setup](http://open.qa/docs/#_multi_machine_tests_setup)
documentation.

0 comments on commit 488a332

Please sign in to comment.