Before this change, vagrant-libvirt assumed that all
port forwards should be done on eth0 adapter. Now
user can provide a custom adapter via "adapter" option
when calling forwarded_port.
Added TPM device support to include switching out the TPM device on
reboot if necessary.
The following options were added:
* tpm_model - Defaults to 'tpm-tis'
* tpm_type - Defaults to 'passthrough'
* tpm_path - Must be specified, other options are ignored if this is
not specified. Most users will set this to /dev/tpm0.
For additional information on using a TPM with Libvirt see the following:
* http://wiki.qemu.org/Features/TPM
* https://libvirt.org/formatdomain.html#elementsTpm
Change the return format of the nic_mac_addresses capability to comply
with the format expected by Vagrant:
# Vagrant expects a hash with an index starting at 1 as key
# and the mac as uppercase string without colons as value
This fixes the configuration of additional network interfaces for
Windows guests. Other guests don't require the mac address of a
interface to configure it, thus this only affected windows guests.
Background
----------
The default private_network template we supply has the following tag:
<network ipv6='yes'>
This enables ipv6 on guest interfaces for guest-to-guest communication.
This causes a problem on hosts that either do not have ipv6 enabled or
configured correctly, resulting in an error on 'vagrant up' as follows:
Error while activating network: Call to virNetworkCreate failed: internal error: Failed to apply firewall rules /usr/sbin/ip6tables --table filter --insert FORWARD --in-interface virbr1 --jump REJECT: ip6tables v1.4.21: can't initialize ip6tables table `filter': Address family not supported by protocol
Perhaps ip6tables or your kernel needs to be upgraded.
Reading here:
http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=705e67d40b09a905cd6a4b8b418d5cb94eaa95a8
would suggest the above option should really be off by default, however,
I don't want to break existing behaviour or setups. This patch adds two
new config items, one for the default management network, and one for
additional user defined private networks.
Usage
-----
To disable ipv6 for the managment network:
config.vm.provider :libvirt do |libvirt|
libvirt.management_network_guest_ipv6 = "no"
end
To disable for a custom private network:
config.vm.network "private_network", ip: "192.168.33.10", libvirt__guest_ipv6: "no"
Extra Notes:
------------
Also note, if you get hit by the above error and want to apply the above
fix, you will need to clear out the management network manually:
$ sudo virsh net-list --all
Name State Autostart Persistent
----------------------------------------------------------
default active yes yes
vagrant-libvirt inactive no yes
$ sudo virsh net-undefine vagrant-libvirt
Network vagrant-libvirt has been undefined
As we are sometimes using FQDNs as box names, it would be nice to keep the dots.
I tested this minor change on version 0.0.32 and it creates domain/disk correctly.
If you need me to do anything else, just let me know. Thanks
Allow the user to specify what the domif name will be for an interface
by defining a name in the Vagrantfile. This allows one to later build link
toggling from within vagrant or easily toggle the link using virsh. An
example using virsh.
By default the name of tunnel interfaces will be "tnet" + interface
number.
Given a Vagrantfile snippet:
node.vm.network :private_network,
:libvirt__tunnel_type => 'udp',
:libvirt__tunnel_port => 8001,
:libvirt__tunnel_local_port => 8002,
:libvirt__iface_name => 'test1'
Generates named domain interface called 'test1':
$ virsh -c qemu:///system domiflist vagrant_default
Interface Type Source Model MAC
-------------------------------------------------------
vnet0 network vagrant-libvirt virtio 52:54:00:2f:c1:82
vnet1 network switch_mgmt virtio 12:11:22:33:44:11
test1 udp - virtio 52:54:00:7d:8a:2a
tnet3 udp - virtio 52:54:00:ec:39:12
To toggle the interface link status one can do the following, toggle
the link up:
$ virsh -c qemu:///system domif-setlink vagrant_default test1 up
$ vagrant ssh -- sudo ip link set eth2 up
$ vagrant ssh -- ip link show eth2
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:7d:8a:2a brd ff:ff:ff:ff:ff:ff
Toggle the link down:
$ virsh -c qemu:///system domif-setlink vagrant_default test1 down
$ vagrant ssh -- sudo ip link set eth2 up
$ vagrant ssh -- ip link show eth2
4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast
state DOWN mode DEFAULT group default qlen 1000
link/ether 52:54:00:7d:8a:2a brd ff:ff:ff:ff:ff:ff
Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>
Allows one to set a empty prefix for domain names
and it would create domain with the same name as set by define
method in the Vagrantfile.
Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
When the path to the Vagrant environment contains spaces, the IdentityFile argument to SSH does not get parsed correctly. The result is that the command fails and no ports are forwarded to the host. Log Output: command-line line 0: garbage at end of line;
This update places a double quote around the private key path with another pair of single quotes outside of it. With single or double quotes alone, the command fails. Combining the double quotes embedded in single quotes results in SSH parsing the argument correctly and the ports are forwarded properly.