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
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'.
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
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.
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
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
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
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
Use the more conservative path if either disks or cdroms present for
the domain configuration.
Domain destroy including volumes will attempt to delete any attached
CDROM images as they are registered as volumes. Resulting in the
following error message:
fog-libvirt-0.0.3/lib/fog/libvirt/requests/compute/volume_action.rb:6:in
`delete': Call to virStorageVol Delete failed: cannot unlink file
'<path-to-iso>': Success (Libvirt::Error)
Co-Authored-By: Darragh Bailey <dbailey@hpe.com>
Change-Id: Ia497aef0e871de88e65c46afe071b2618fda5588
Devices which do not support any default vga device (e.g. ARM boards)
can't be started when a video device is present. Libvirt automatically
adds a <video> device whenever a <graphics> element is defined.
Using 'none' was already documented as supported but did not work.
This allows for specific CPU selection and enforcement when cpu_mode =
custom, which is important when emulating CPUs of different architecture
than the host.