Commit Graph

942 Commits

Author SHA1 Message Date
Paul Bourke
9869213a4f Allow disabling guest-to-guest ipv6 comms in libvirt networks
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
2015-11-09 17:45:10 +00:00
Dmitry Vasilets
e9ce3096f3 Merge pull request #502 from svigneux/patch-1
Allow dots in domain_name
2015-11-08 09:32:48 +01:00
Simon Vigneux
70e0f4e6c7 Allow dots in domain_name
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
2015-11-06 12:23:16 -05:00
Dmitry Vasilets
883db81df5 Merge pull request #498 from jtoppins/named-interfaces
interfaces: allow user to specify an interface name
2015-11-03 09:49:20 +01:00
Dmitry Vasilets
f62a199998 Merge pull request #501 from mandre/fix-wrong-interpolation-argument
Fix wrong interpolation argument
2015-11-03 09:43:41 +01:00
Martin André
30600f4ac3 Fix wrong interpolation argument
This caused an ugly stacktrace when the requested virtual size is
smaller than the actual image size.
2015-11-01 21:53:06 +09:00
Dmitry Vasilets
2bc60c5196 Merge pull request #500 from bcambl/readme_updates
network interface definition example indentation
2015-11-01 00:26:02 +01:00
bcambl
b48d0b3e5b network interface definition example indentation
Match indentation for consistency with all other code examples
2015-10-31 17:14:14 -06:00
Jonathan Toppins
c197d0f11c interfaces: allow user to specify an interface name
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>
2015-10-30 14:45:52 -04:00
Dmitry Vasilets
5ed8a2a4f2 Merge pull request #491 from giacomolozito/9p_nomount
Option to disable p9 automounting at boot
2015-10-26 14:06:18 +01:00
Giacomo Lozito
bd112300c5 Add info for 9p mount: option in README 2015-10-25 19:20:30 +00:00
Dmitry Vasilets
3bac45efb6 Merge pull request #490 from petRUShka/add_pcis
Add PCI device passthrough functionality
2015-10-25 19:58:24 +01:00
Giacomo Lozito
b3fd0c36f0 Provide a mount: option to disable automount for p9 synced folders 2015-10-25 18:22:59 +00:00
Giacomo Lozito
79e08cf2d9 Do not mount folders with an empty guest path 2015-10-25 18:21:28 +00:00
Dmitry Vasilets
d1a0d80cd7 Merge pull request #489 from petRUShka/readme_development
README: Rakefile no longer provide test run. Switch to rspec
2015-10-23 10:46:18 +02:00
Maxim Petrunin
be30311e5f Fix README.md, PCI section 2015-10-23 11:19:13 +03:00
Maxim Petrunin
b2684d310f Add PCI device passthrough functionality 2015-10-23 11:12:57 +03:00
Maxim Petrunin
f9827479c6 README: Rakefile no longer provide test run. Switch to rspec 2015-10-22 08:43:06 +03:00
Dmitry Vasilets
71e82ca8e5 Merge pull request #488 from raghavendra-talur/empty-default-prefix
Allow empty prefix for domain names
2015-10-19 09:17:26 +02:00
raghavendra talur
97dd1f20f2 Allow empty prefix for domain names
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>
2015-10-19 12:28:32 +05:30
Dmitry Vasilets
1ad103181e Merge pull request #487 from devopsjedi/master
Update forward_ports.rb to fix spaces in private key path
2015-10-18 23:36:44 +02:00
devopsjedi
9b7f5b2cc1 Update forward_ports.rb to fix spaces in private key path
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.
2015-10-18 15:34:30 -04:00
Dmitry Vasilets
686a42446d typo 2015-10-10 09:45:43 +02:00
Dmitry Vasilets
0d1c572218 Merge pull request #482 from bcambl/fix_indent
Fix indentation from commit 2525be90
2015-10-10 09:43:00 +02:00
bcambl
e75ea34b93 Fix indentation from commit 2525be90 2015-10-09 18:32:47 -06:00
Dmitry Vasilets
5d2e3099ab Merge pull request #481 from jcsmith/master
Add 1GB to the size of virtual disk as defined in metadata.json.
2015-10-09 22:15:18 +02:00
Josh Smith
b9a61d8e26 Add 1GB to the size of virtual disk as defined in metadata.json. Since teh awk int function truncates (not rounds) soemtimes the virtual disk was defined a bit too small causing sporadic boot failusres. 2015-10-09 15:55:03 -04:00
dima
5840a95ab4 0.0.32 2015-10-06 11:50:52 +02:00
Dmitry Vasilets
0d374eccf2 Merge pull request #477 from mkutsevol/master
Fix regression with additional disks + additional disk reload support #418
2015-10-06 11:50:21 +02:00
Max Kutsevol
1fd789534d Customising libvirt settings can only be done when creating a box #418
* Fixed regression when using additional disks. Now disk_bus setting
applies only to main disk.
* Added ability to change additional disk bus on reload. Updated readme.

Task-Url: https://github.com/pradels/vagrant-libvirt/issues/418
Signed-off-by: Max Kutsevol <max@coolvds.com>
2015-10-06 12:39:11 +03:00
Maxym Kutsevol
233133b54c Merge pull request #3 from pradels/master
Update base
2015-10-06 11:10:03 +03:00
Dmitry Vasilets
ec7d32ebb5 Merge pull request #476 from infernix/no_box_handling_error
Use env[:machine].config.vm.box variable, not .box
2015-10-06 06:01:11 +02:00
Dmitry Vasilets
75e5ab69dd Merge pull request #474 from jcsmith/master
If the disk size is specified as a decimal number the generated metad…
2015-10-06 06:00:34 +02:00
Gerben Meijer
3bbba3240b Use env[:machine].config.vm.box variable, not .box
In some cases env[:machine].box is 'nil' when a box is
not already locally present. Combined with the box_optional
flag this causes the box definition in the Vagrantfile to be
ignored completely, yielding unexpected results. All references
are changed to ensure it does not cause other issues.
2015-10-06 01:07:25 +02:00
Josh Smith
163896aceb Added comment to describe cahanges as requested 2015-10-05 13:43:38 -04:00
Josh Smith
b59c007f85 No need to use both grep and awk here - just grep will do. 2015-10-05 12:41:49 -04:00
Josh Smith
0aea938dea If the disk size is specified as a decimil number the generated metadat.json file is invalid resulting in a broken vagrant box. Wraped this in the awk int() function to only print the integer part of the disk size. 2015-10-05 12:31:37 -04:00
Maxym Kutsevol
994b096854 Merge pull request #2 from pradels/master
Update base
2015-09-30 18:11:34 +03:00
Dmitry Vasilets
15d12d1053 Merge pull request #470 from mkutsevol/issue_411
Issue 411
2015-09-29 20:32:20 +02:00
Dmitry Vasilets
62dfca0842 Merge pull request #469 from mkutsevol/issue_418
Issue 418
2015-09-29 20:31:46 +02:00
Max Kutsevol
0345bc3bd0 suspend to disk? #411
* Error handler in case of error when saving domain state with a hint
how to handle the problem. 
* Managed saves are deleted prior to undefining a domain.

Task-Url: https://github.com/pradels/vagrant-libvirt/issues/411
Signed-off-by: Max Kutsevol <max@coolvds.com>
2015-09-27 15:13:22 +03:00
Max Kutsevol
837a344724 suspend to disk? #411
* Added the suspend_mode domain specific option. Now it can perform a
managed save/resume. Switching this domain specific option can be done
when the domain is supended, it will correctly resume the domain. 

Task-Url: https://github.com/pradels/vagrant-libvirt/issues/411
Signed-off-by: Max Kutsevol <max@coolvds.com>
2015-09-27 14:23:09 +03:00
Max Kutsevol
45e293748a Customising libvirt settings can only be done when creating a box #418
* Changed logging level on error when changing xml description from info
to error.

Task-Url: https://github.com/pradels/vagrant-libvirt/issues/418
Signed-off-by: Max Kutsevol <max@coolvds.com>
2015-09-27 12:40:08 +03:00
Max Kutsevol
d11b0b970f Customising libvirt settings can only be done when creating a box #418
* Added support to modify domain specific options on already defined
domain, updated relevant documentation. For list of modifiable options
please see updated documentation.
* Added new domain specific option - uuid. To force domain UUID when
creating new VM.


Task-Url: https://github.com/pradels/vagrant-libvirt/issues/418
Signed-off-by: Max Kutsevol <max@coolvds.com>
2015-09-26 20:46:33 +03:00
Maxym Kutsevol
329725740b Merge pull request #1 from pradels/master
I hope this will go to my fork.
2015-09-26 16:23:38 +03:00
dima
2a880b8e76 0.0.31 2015-09-25 20:16:38 +02:00
Dmitry Vasilets
8489077089 Merge pull request #468 from Paulche/table_of_content
Add Table of Contents
2015-09-25 15:55:08 +02:00
Paul Chechetin
bb03b6bd62 Add Table of Contents
Readme file is large, so navigation may be quite compilated.
Table of contents improves navigation but adds a little work when the content is changed.

Table of Contents was generated with http://doctoc.herokuapp.com/
2015-09-25 16:52:42 +03:00
Dmitry Vasilets
4193485670 Merge pull request #467 from Paulche/master
Improve decoration
2015-09-25 14:47:04 +02:00
Paul Chechetin
334f14b6e2 Improve decoration 2015-09-25 15:36:24 +03:00