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 <michalx.berger@intel.com>
Change-Id: Ie3da26eebcfb0de668166c4a0120c65aec104540
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7441
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
This commit is contained in:
Michal Berger 2021-04-16 10:34:43 +02:00 committed by Tomasz Zawadzki
parent 0c25e6fbbc
commit 7bea0a074f

View File

@ -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)