Commit Graph

696 Commits

Author SHA1 Message Date
dima
f650843246 Merge branch 'master' of github.com:vagrant-libvirt/vagrant-libvirt 2017-02-11 12:52:10 +01:00
dima
fe5938ce26 simplify templates by nokogiri 2017-02-11 12:52:04 +01:00
Dmitry Vasilets
5ed93bd908 Merge pull request #730 from jarrpa/patch-1
Use slot number to report MAC address
2017-02-09 10:30:34 +01:00
dima
d2f4cf5708 xml by nokogiri instead of xml template 2017-02-09 00:07:56 +01:00
Dmitry Galkin
6fa527c977 Allow to specify libvirt NIC driver and number of queues for it. 2017-02-08 20:19:49 +01:00
Jose A. Rivera
cd8573777a Allow multiple MACs per network. 2017-02-06 15:13:43 +01:00
Jose A. Rivera
da87d06bfb Cleanup some public network MAC code. 2017-02-06 15:13:43 +01:00
Michal Sylwester
07dbb907bd Allow custom name for disk device
This is needed for example for xen in full virtualisation mode
as it won't allow the default vda
2017-02-02 10:02:03 +01:00
Michal Sylwester
ecea549e7f Be tolerant about drivers not supporting listing snapshots 2017-01-30 17:04:46 +01:00
Dmitry Vasilets
c065c1e6e5 test1 2017-01-16 16:40:23 +01:00
Steffen Froemer
e3181e10b6 fix issue #722 2017-01-13 13:29:06 +01:00
Dmitry Galkin
1248dc43e9 sound_type set to nil if UNSET_VALUE. 2017-01-12 19:58:42 +01:00
Liam Campbell
2f091b1cdc patch to include virtual sound card support 2017-01-12 18:31:44 +01:00
Steffen Froemer
639fb240b8 adding support for smartcard device 2017-01-12 09:31:12 +01:00
Steffen Froemer
93cc6fba20 adding watchdog device support
fixed spec file

updated spec file

fixed spec tests
2017-01-10 00:59:40 +01:00
Gerben Meijer
2337c35972 version 0.0.37 2017-01-09 15:47:31 +01:00
Michal Skalski
04b34f8c13 Autostart of libvirt networks
Add option for defining autostart behaviour for mgmt network.
Take into account 'autostart' value for private networks.
Fixes #615
2016-12-16 12:21:30 +01:00
Michal Skalski
8ef6df014d Make mgmt network detachable from no box VMs
Pxe nodes are not provisioned, mgmt network is not required for them.
Provide new domain option 'mgmt_attach' which one can use to remove mgmt
interface from VM. Default behaviour is not changed.
Also take into account bridge interfaces when set boot order, to support
scenario when we would like to use vagrant VM to pxe boot physical nodes
in existing network.
2016-12-13 21:43:59 +01:00
dima
8dfe8d5260 add some ipv6 support between vms 2016-12-07 00:40:44 +01:00
dima
c1898be3d6 rubocop 2016-12-06 23:20:29 +01:00
dima
b92b02b6d6 add ability for test pxe in private network 2016-12-06 19:45:27 +01:00
dima
981ca18b5e amazing rubocop -a autofix 2016-12-06 16:59:28 +01:00
Darragh Bailey
46e0d09ce6 Fix separate storage config blocks device assignment
Move device assignment for CDROM's and disk storage to occur during
finalize, to ensure that storage config blocks are merged before
assigning devices.

This ensures that defining multiple storage config blocks within the
same or different Vagrantfiles that are merged, works as expected to
create multiple separate storage devices without needing to explicitly
define the dev name.

Fixes #655
2016-11-25 17:14:54 +00:00
Darragh Bailey
4af944f9d6 Merge CDROM storage config blocks 2016-11-25 17:14:54 +00:00
Dmitry Vasilets
255146ec41 Merge pull request #677 from knumskull/vagrant-libvirt-redirdev
patch for include support of redirector devices
2016-11-02 21:02:26 +01:00
Erik van Pienbroek
c9123269f6 Use /sbin/ip when there is no 'ip' command in any of the default PATHs
While configuring NFS an attempt is done to find
out all guest IP addresses using the 'ip' tool.
On various distros like Fedora 25, RHEL6 and RHEL 7
this tool is located in /sbin folder which is not
in the default PATH. This can result in errors like:

 INFO warden: Calling OUT action: #<VagrantPlugins::ProviderLibvirt::Action::ShareFolders:0x007fc8689b14b8>
DEBUG host: Searching for cap: nfs_installed
DEBUG host: Checking in: redhat
DEBUG host: Checking in: linux
DEBUG host: Found cap: nfs_installed in linux
 INFO host: Execute capability: nfs_installed [#<Vagrant::Environment: /var/lib/jenkins/workspace/pipeline-test_wip-TG6O6HU2IAULWKZINVXPWYUIU4APVEDUCV4TIOMW3LHGUVGFESPQ>] (redhat)
 INFO nfs: Using NFS, preparing NFS settings by reading host IP and machine IP
DEBUG ssh: Checking key permissions: /var/lib/jenkins/.vagrant.d/insecure_private_key
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: ip addr show | grep -i 'inet ' | grep -v '127.0.0.1' | tr -s ' ' | cut -d' ' -f3 | cut -d'/' -f 1 (sudo=false)
DEBUG ssh: stderr: bash: line 2: ip: command not found

DEBUG ssh: Exit status: 0
 INFO nfs: guest IPs:
 INFO nfs: host IP: 127.0.0.1 machine IP: []
 INFO warden: Calling OUT action: #<VagrantPlugins::ProviderLibvirt::Action::PrepareNFSSettings:0x007fc868974b80>
 INFO warden: Calling OUT action: #<VagrantPlugins::ProviderLibvirt::Action::ForwardPorts:0x007fc868948b70>
 INFO warden: Calling OUT action: #<VagrantPlugins::ProviderLibvirt::Action::WaitTillUp:0x007fc868916120>
 INFO warden: Calling OUT action: #<VagrantPlugins::ProviderLibvirt::Action::StartDomain:0x0055a7c389c608>

and later on a fatal error occurs due to the wrong IP address being used:

 INFO guest: Execute capability: mount_nfs_folder [#<Vagrant::Machine: dev01 (VagrantPlugins::ProviderLibvirt::Provider)>, "127.0.0.1", {"/vagrant"=>{:type=>:"", :guestpath=>"/vagrant", :hostpath=>"/var/lib/jenkins/workspace/pipeline-test_rhsm_wip-TG6O6HU2IAULWKZINVXPWYUIU4APVEDUCV4TIOMW3LHGUVGFESPQ", :disabled=>false, :__vagrantfile=>true, :map_uid=>981, :map_gid=>980, :nfs_udp=>true, :nfs_version=>3, :uuid=>"519459908", :linux__nfs_options=>["rw", "no_subtree_check", "all_squash", "anonuid=981", "anongid=980", "fsid=519459908"]}, "/software"=>{:guestpath=>"/software", :hostpath=>"/home/shared/software", :disabled=>false, :__vagrantfile=>true, :map_uid=>1000, :map_gid=>1000, :nfs_udp=>true, :nfs_version=>3, :uuid=>"258980992", :linux__nfs_options=>["rw", "no_subtree_check", "all_squash", "anonuid=1000", "anongid=1000", "fsid=258980992"]}, "/yum_repos"=>{:guestpath=>"/yum_repos", :hostpath=>"/home/shared/yum_repos", :disabled=>false, :__vagrantfile=>true, :map_uid=>1000, :map_gid=>1000, :nfs_udp=>true, :nfs_version=>3, :uuid=>"1600717094", :linux__nfs_options=>["rw", "no_subtree_check", "all_squash", "anonuid=1000", "anongid=1000", "fsid=1600717094"]}}] (redhat)
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: set -e
mkdir -p /vagrant
mount -o vers=3,udp 127.0.0.1:/var/lib/jenkins/workspace/pipeline-test_wip-TG6O6HU2IAULWKZINVXPWYUIU4APVEDUCV4TIOMW3LHGUVGFESPQ /vagrant
if command -v /sbin/init && /sbin/init --version | grep upstart; then
  /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
fi
 (sudo=true)
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: echo; printf $SSH_AUTH_SOCK (sudo=false)
DEBUG ssh: Exit status: 0
DEBUG ssh: stdout:
/tmp/ssh-IQUlPd2203/agent.2203
 INFO ssh: Setting SSH_AUTH_SOCK remotely: /tmp/ssh-IQUlPd2203/agent.2203
DEBUG ssh: stderr: mount.nfs: requested NFS version or transport protocol is not supported

DEBUG ssh: Exit status: 32
 INFO retryable: Retryable exception raised: #<Vagrant::Errors::NFSMountFailed: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

Made the IP address detection more reliable by first
trying to find the location of the 'ip' tool using
'which' and when that fails (not in the default PATH),
then try to use '/sbin/ip'.
2016-11-02 18:02:55 +01:00
Steffen Froemer
fcf8dc19df Added support for redirected devices and USB filter. 2016-11-01 20:41:41 +01:00
Evgeni Golov
5091844c70 fold cpu_model assignment into one 2016-10-28 22:48:37 +02:00
Evgeni Golov
7ec7b8e35e also set the cpu_model in the config accordingly to the cpu_mode 2016-10-23 16:55:27 +02:00
Evgeni Golov
517da85cee only set the cpu model when using a custom cpu mode
according to https://libvirt.org/formatdomain.html#elementsCPU
setting the model is not supported when using "host-model" and
with recent libvirt this actually results in errors like this:
 Call to virDomainCreateWithFlags failed:
  the CPU is incompatible with host CPU:
  Host CPU does not provide required features: svm
2016-10-23 16:29:33 +02:00
Jiří Stránský
6c11ae7684 Fix default_prefix behavior
Call `dup` on default prefix before amending it via `concat` and
`<<`. Previously when default_prefix was used, it was amended in place,
so it was changing with every VM definition and kept getting longer,
leading to wrong domain names.
2016-10-09 21:34:57 +02:00
dima
7d2c600a40 version 0.0.36 2016-10-07 17:08:09 +02:00
Roman Mohr
1db61bc631 Add support for RNG passthrough
Allow passing through /dev/random from the host to the VM. This speeds
up pretty much everything which needs entropy inside the VM.
2016-09-15 21:39:28 +02:00
Dmitry Vasilets
f28cf2f63b fix numa_nodes value 2016-09-14 16:41:00 +02:00
Stephen Finucane
4d201e5d7e Handle invalid NUMA nodes-memory combinations
Raise an exception if the user specifies a memory allowance that cannot
be divided cleanly between available NUMA nodes.
2016-09-13 11:02:03 +01:00
Tobias Jungel
a609f5b17d add trustGuestRxFilters attribute to public interface
set :trust_guest_rx_filters => true in the network definition to enable
trustGuestRxFilters for the public interface.

Details from http://www.libvirt.org/formatdomain.html#elementsNICSDirect:
"If the model type is set to virtio and interface's trustGuestRxFilters
attribute is set to yes, changes made to the interface mac address,
unicast/multicast receive filters, and vlan settings in the guest will
be monitored and propagated to the associated macvtap device on the host
(Since 1.2.10). If trustGuestRxFilters is not set, or is not supported
for the device model in use, an attempted change to the mac address
originating from the guest side will result in a non-working network
connection."

closes #650
2016-09-13 09:20:46 +02:00
Dmitry Vasilets
7d034c93c5 Merge pull request #632 from matt8754/fix631
fix a regression introduced in 546c98c
2016-09-13 08:27:28 +02:00
Dmitry Vasilets
a7fc7b5499 Merge pull request #646 from stephenfin/feat/numa-nodes-param
Add NUMA topology support
2016-09-13 08:27:11 +02:00
Erik van Pienbroek
d78d896909 Add disk property 'shareable'
To simulate shared SAN storage an additional libvirt
disk property needs to be set which disables caching.

Also updated the documentation to document this new
property and added an example on how to simulate
shared SAN storage

Closes #648
2016-09-07 18:21:11 +02:00
Stephen Finucane
fec9fa4f6c Add NUMA topology support
libvirt has supported specification of a guest NUMA topology since
0.9.8. This functionality can be used for basic validation of some
NUMA-dependent features during development. Add basic configuration
support, by allowing the user to specify how many NUMA nodes the
instance may have.

The following options are added:

* numa_nodes - Defaults to none

For additional information on specifying NUMA nodes with Libvirt, see:

* https://libvirt.org/formatdomain.html#elementsCPU
2016-09-07 15:18:22 +01:00
Stephen Finucane
b2d1cfa38b trivial: Remove tabs
Don't mix tabs and spaces. Remove tabs across the board to prevent
confusion.
2016-09-07 13:04:53 +01:00
dima
945e84f9a4 0.0.35 2016-08-18 22:34:09 +02:00
Boris Schrijver
63e347a923 Add libvirt portgroup support. 2016-08-18 22:10:40 +02:00
Arturs Meinarts
34dca0550c Downcases MAC 2016-08-08 23:55:49 +02:00
Arturs Meinarts
0a36d64c88 Validator for network MAC configuration options. 2016-08-08 23:21:14 +02:00
Matt Jia
9967ad6943 fix a regression introduced in 546c98c 2016-07-22 14:43:55 +10:00
Eric Pulvino
cf4bdbb4a4 Fix for issue #627, catch both type='network' and type='udp' at the same time. 2016-07-05 17:16:06 -04:00
Shawn Lower
3dea208720 Add accessor for channel 2016-06-10 08:39:28 +07:00
Shawn Lower
74b1846a1c Default to not configuring any channel for guests 2016-06-10 08:18:30 +07:00
Shawn Lower
c6fbfb7e88 Add support for libvirt channels:
Example:

    config.vm.provider :libvirt do |libvirt|
        # Create a virtio channel for use by the qemu-guest agent (time sync, snapshotting, etc)
        libvirt.channel :type => 'unix', :target_name => 'org.qemu.guest_agent.0', :target_type => 'virtio'

        # Forward traffic to 1.2.3.4 from the guest, to the specified socket on the host
        libvirt.channel :type => 'unix', :target_type => 'guestfwd', :target_address => '1.2.3.4', :target_port => '9999',
                        :source_path => '/tmp/foo'
    end

- https://libvirt.org/formatdomain.html#elementCharChannel
- http://wiki.libvirt.org/page/Qemu_guest_agent
2016-05-31 06:41:54 +07:00