aboutsummaryrefslogtreecommitdiffstats
path: root/patches/opnfv-fuel/0003-lib.sh-AArch64-virt-install-Use-virtio-net-pci.patch
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-07-10 17:32:57 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-07-11 19:51:24 +0200
commitde0b0f160f6ac408c2ba302507ede4d0a537b73f (patch)
treec9ea030e00a631ec07ef2d4f8d956a2bbad93eed /patches/opnfv-fuel/0003-lib.sh-AArch64-virt-install-Use-virtio-net-pci.patch
parent7ce3a621f2156110f5434e95a46e6aa6aa1fb9a1 (diff)
MCP: patches: AArch64: Add initial support
- p/fuel: classes: AArch64: virtio-pci-net sync - p/reclass-system-salt-model: Add Armband repos - mcp/config: AArch64: Use UEFI arm64 image Also, allow removal of VMs booted via guest UEFI (OVMF or AAVMF). While at it, bump default vCPU number from 2 to 6. - lib.sh: AArch64: Use VGA video mode for guests On AArch64, there is no Cirrus video, so use VGA mode instead. For now, we install vgabios package no matter the arch, although it is only used on AArch64. On Debian systems, also fix a missing link for vgabios-stdvga.bin. Based on previous Armband work from [1]. - lib.sh: AArch64: virt-install: Use virtio-net-pci AArch64 virt tools (i.e. libvirt) default to "virtio-mmio", instead of "virtio-net-pci", at least before libvirt 3.x (see [2]). Without PCI bus info, we can't really enforce a specific order for the guest ethernet devices. Moreover, predictable network interface naming is out of the question with virtio-mmio, as there is no bus information to rely on. Therefore we will enforce "virtio-net-pci" on AArch64, instead of the default "virtio" (which translates into "virtio-mmio" currently). - salt.sh, user-data: Add Saltstack arm64 repo - salt.sh: Clone armband repo, apply patches from it - classes: virtual: AArch64: virtio-pci-net sync Since AArch64 will be using virtio-net-pci NIC model for guests, predictable interface naming yields a slightly different scheme. Update all configuration to reflect this. FIXME: - Use https for fetching Armband GPG keys! - Revise the patching mechanism, make things more dynamic. [1] https://github.com/opnfv/armband/blob/danube.2.0/patches/fuel-library/ arm64-bug-fixes/0002-Install-vgabios-and-link-for-aarch64.patch [2] https://www.redhat.com/archives/libvir-list/2016-August/msg00931.html Change-Id: If5aae22066f75732652201a78357c4931438d58d Signed-off-by: Guillermo Herrero <Guillermo.Herrero@enea.com> Signed-off-by: Charalampos Kominos <Charalampos.Kominos@enea.com> Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'patches/opnfv-fuel/0003-lib.sh-AArch64-virt-install-Use-virtio-net-pci.patch')
-rw-r--r--patches/opnfv-fuel/0003-lib.sh-AArch64-virt-install-Use-virtio-net-pci.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/patches/opnfv-fuel/0003-lib.sh-AArch64-virt-install-Use-virtio-net-pci.patch b/patches/opnfv-fuel/0003-lib.sh-AArch64-virt-install-Use-virtio-net-pci.patch
new file mode 100644
index 00000000..e311f0f0
--- /dev/null
+++ b/patches/opnfv-fuel/0003-lib.sh-AArch64-virt-install-Use-virtio-net-pci.patch
@@ -0,0 +1,78 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Tue, 11 Jul 2017 19:06:47 +0200
+Subject: [PATCH] lib.sh: AArch64: virt-install: Use virtio-net-pci
+
+AArch64 virt tools (i.e. libvirt) default to "virtio-mmio", instead of
+"virtio-net-pci", at least before libvirt 3.x (see [1]).
+
+Without PCI bus info, we can't really enforce a specific order for
+the guest ethernet devices.
+
+This leads to a mismatch between cloud-init, who expects "pxe"
+network to reside on "eth0", while in fact it ends up on "eth3".
+As a consequence, we have no connectivity to the guest, as DHCP
+is only configured by cloud-init on "eth0", and also the boot
+sequence waits ~5 minutes for "eth0" to come up, before eventually
+giving up.
+
+Moreover, predictable network interface naming is out of the question
+with virtio-mmio, as there is no bus information to rely on.
+
+Therefore we will enforce "virtio-net-pci" on AArch64, instead of
+the default "virtio" (which translates into "virtio-mmio" currently).
+
+FIXME: Apparently, both legacy and modern virtio (0.9 and 1.0) are
+active, which leads to triggering bug[2].
+For now, throw some sed magic at it and disable legacy mode.
+
+[1] https://www.redhat.com/archives/libvir-list/2016-August/msg00931.html
+[2] https://bugzilla.redhat.com/show_bug.cgi?id=1370005
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ mcp/scripts/lib.sh | 19 +++++++++++++++----
+ 1 file changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
+index 282ca38..12b1ef1 100644
+--- a/mcp/scripts/lib.sh
++++ b/mcp/scripts/lib.sh
+@@ -57,23 +57,34 @@ create_vms() {
+
+ # AArch64: prepare arch specific arguments
+ local virt_extra_args=""
++ local virt_net_model="virtio"
+ if [ "$(uname -i)" = "aarch64" ]; then
+ # No Cirrus VGA on AArch64, use vga std
+ virt_extra_args="$virt_extra_args --video=vga --noautoconsole"
++ # AArch64 networking defaults to virtio-mmio before libvirt 3.x
++ virt_net_model="virtio-net-pci"
+ fi
+
+ # create vms with specified options
+ for node in "${vnodes[@]}"; do
+ virt-install --name ${node} --ram ${vnodes_ram[$node]} --vcpus=6 --cpu host --accelerate \
+- --network network:pxe,model=virtio \
+- --network network:mgmt,model=virtio \
+- --network network:internal,model=virtio \
+- --network network:public,model=virtio \
++ --network network:pxe,model=${virt_net_model} \
++ --network network:mgmt,model=${virt_net_model} \
++ --network network:internal,model=${virt_net_model} \
++ --network network:public,model=${virt_net_model} \
+ --disk path=$(pwd)/images/mcp_${node}.qcow2,format=qcow2,bus=virtio,cache=none,io=native \
+ --os-type linux --os-variant none \
+ --boot hd --vnc --console pty --autostart --noreboot \
+ --disk path=$(pwd)/images/mcp_${node}.iso,device=cdrom \
+ ${virt_extra_args}
++
++ # NOTE(armband): Disable legacy virtio (0.9) in favor of modern virtio (1.0)
++ # http://blog.vmsplice.net/2011/04/how-to-pass-qemu-command-line-options.html
++ # <qemu:commandline>
++ # <qemu:arg value='-global'/>
++ # <qemu:arg value='virtio-pci.disable-legacy=on'/>
++ # </qemu:commandline>
++ EDITOR="sed -i -e \"s|\(<domain.*\)>|\1 xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>|\" -e \"s|\(</domain>\)|<qemu:commandline><qemu:arg value='-global'/><qemu:arg value='virtio-pci.disable-legacy=on'/></qemu:commandline>\1|\"" virsh edit ${node}
+ done
+ }
+