From 7bea0a074f28941724784c87971e082a5f7a7662 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Fri, 16 Apr 2021 10:34:43 +0200 Subject: [PATCH] scripts/vagrant: Create user netdev for openstack network The openstack tests require to have one interface available under specific ip, 10.0.2.15. This ip is a first lease VM receives from the user network which is preconfigured in libvirt environment. Use this instead of defining completely separate network which by the very default will serve its own DHCP service as well. This may result in a cosmetic issues (e.g. two ips, static one and dynamic one on the interface) of having inconsistent config on the VM depending on how the net device is configured by the underlying distribution. Signed-off-by: Michal Berger Change-Id: Ie3da26eebcfb0de668166c4a0120c65aec104540 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7441 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Reviewed-by: Maciej Szwed Reviewed-by: Maciej Wawryk --- scripts/vagrant/Vagrantfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/vagrant/Vagrantfile b/scripts/vagrant/Vagrantfile index 912786109..aab518e83 100644 --- a/scripts/vagrant/Vagrantfile +++ b/scripts/vagrant/Vagrantfile @@ -278,6 +278,14 @@ def setup_libvirt(config, vmcpu, vmram, distro) end } + # Add network interface for openstack tests + if ENV['SPDK_OPENSTACK_NETWORK'] == "1" + libvirt.qemuargs :value => "-device" + libvirt.qemuargs :value => "virtio-net,netdev=openstack.0" + libvirt.qemuargs :value => "-netdev" + libvirt.qemuargs :value => "user,id=openstack.0" + end + if ENV['VAGRANT_HUGE_MEM'] == "1" libvirt.memorybacking :hugepages end @@ -295,7 +303,6 @@ provider = (ENV['SPDK_VAGRANT_PROVIDER'] || "virtualbox") # Get all variables for creating vm vmcpu = (ENV['SPDK_VAGRANT_VMCPU'] || 2) vmram = (ENV['SPDK_VAGRANT_VMRAM'] || 4096) -openstack_network = (ENV['SPDK_OPENSTACK_NETWORK'] || false) # generic/freebsd boxes do not work properly with vagrant-proxyconf and # have issues installing rsync and sshfs for syncing files. NFS is @@ -319,10 +326,6 @@ Vagrant.configure(2) do |config| config.vm.box_check_update = false config.vm.synced_folder '.', '/vagrant', disabled: true - # Add network interface for openstack tests - if openstack_network == "1" - config.vm.network "private_network", ip: "10.0.2.15" - end # Copy in the .gitconfig if it exists copy_gitconfig(config)