Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Done
-
None
-
None
-
None
-
None
-
[Followed this blog post for environment setup|https://www.onyxpoint.com/blog/vagrant-libvirt-on-centos-7/]
And then ran export BEAKER_HYPERVISOR=vagrant_libvirt'
After implementing the following code changes I was able to get the beaker nodes to work as intended with libvirt.
Suggested code changes:
lib/beaker/hypervisor/vagrant_libvirt.rbdef private_network_generator(host)
unless host['dhcp_ip'].nil? || host['dhcp_ip'].empty?
dhcp_ip = host['dhcp_ip']
else
dhcp_ip = "172.28.128.0"
end
private_network_string = " v.vm.network :private_network, :type => \"dhcp\", :libvirt__network_address => \"#{dhcp_ip}\"\n"
end
and
def shell_provisioner_generator(provisioner_config)
unless provisioner_config.nil?
shell_provisioner_string = " v.vm.provision 'shell', :inline => 'ip route del default', :run => 'always'\n"
else
shell_provisioner_string = " v.vm.provision 'shell', :inline => 'ip route del default', :run => 'always'\n"
end
end
[Followed this blog post for environment setup| https://www.onyxpoint.com/blog/vagrant-libvirt-on-centos-7/ ] And then ran export BEAKER_HYPERVISOR=vagrant_libvirt' After implementing the following code changes I was able to get the beaker nodes to work as intended with libvirt. Suggested code changes: lib/beaker/hypervisor/vagrant_libvirt.rb def private_network_generator(host) unless host[ 'dhcp_ip' ].nil? || host[ 'dhcp_ip' ].empty? dhcp_ip = host[ 'dhcp_ip' ] else dhcp_ip = "172.28.128.0" end private_network_string = " v.vm.network :private_network, :type => \"dhcp\", :libvirt__network_address => \"#{dhcp_ip}\"\n" end and def shell_provisioner_generator(provisioner_config) unless provisioner_config.nil? shell_provisioner_string = " v.vm.provision 'shell', :inline => 'ip route del default', :run => 'always'\n" else shell_provisioner_string = " v.vm.provision 'shell', :inline => 'ip route del default', :run => 'always'\n" end end
-
Needs Assessment
-
Needs Assessment
Description
beaker-vagrant's libvirt support was missing handling networking information. It should defer out to the defaults specified in the vagrant-libvirt plugin if no options are supplied in the nodeset.
Vagrant-libvirt functions differently than the VirtualBox defaults in that it can build a private network via Libvirt's internal private DHCP settings, and then it will establish an IP Masquerade to forward out the VM's traffic to the internet.
Also, the vagrant-libvirt plugin will handle the networking at the time of provisioning and updates to the Libvirt VM's, therefore the Vagrantfile should delete the default routes and let the plugin fix everything up.