Commit 7bea0a07 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

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: default avatarMichal Berger <michalx.berger@intel.com>
Change-Id: Ie3da26eebcfb0de668166c4a0120c65aec104540
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7441


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarMaciej Szwed <maciej.szwed@intel.com>
Reviewed-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
parent 0c25e6fb
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -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)