voxpupuli / beaker-vagrant Goto Github PK
View Code? Open in Web Editor NEWVagrant hypervisor library for beaker
License: Apache License 2.0
Vagrant hypervisor library for beaker
License: Apache License 2.0
Using beaker with beaker-vagrant versions 0.6.7 and above, when I call rsync_to it attempts to connect to the guest on port 2222. This fails as the guest is not listening on that port.
Here is a typical error:
rsync: localhost:/data/ to [email protected]:/data {:ignore => ["spec", "tests", ".git", ".vagrant", "vagrant"]}
rsync returned #<Rsync::Result:0x000055fcd247dd60 @raw="ssh: connect to host 10.255.137.136 port 2222: Connection refused\r\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: unexplained error (code 255) at io.c(228) [sender=3.2.3]\n", @exitcode=255>
Note, vagrant is forwarding port 22 on the guest to 2222 on the host so rsync_to could successfully connect to localhost port 2222, but not 10.255.137.136 port 2222.
This problem only occurs when using beaker-vagrant versions higher than 0.6.7. I believe the port to use is determined from the ssh config (https://github.com/voxpupuli/beaker/blob/master/lib/beaker/host.rb#L579) so is it possible that this commit in beaker-vagrant has introduced a bug? 5cd6320
The information below is being transferred from Jira:
Envrionment
Followed this blog post for environment setup
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
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.
https://github.com/voxpupuli/beaker-vagrant/blob/master/lib/beaker/hypervisor/vagrant_libvirt.rb#L36 causes hack_etc_hosts
to mangle the /etc/hosts
file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.