Commit Graph

550 Commits

Author SHA1 Message Date
Gabriel Briones Sayeg
f634f4370b Merge branch 'master' of https://github.com/gbriones1/vagrant-libvirt 2015-08-06 11:01:09 -05:00
Gabriel Briones Sayeg
3277506627 Include custom UEFI loader
Domain XML has loader tag to read specific OVMF.fd path

Signed-off-by: Gabriel Briones Sayeg <gbriones.gdl@gmail.com>
2015-08-06 11:00:15 -05:00
Gabriel Briones Sayeg
71ca7cab1f Include custom UEFI loader
Domain XML has loader tag to read specific OVMF.fd path

Signed-off-by: Gabriel Briones Sayeg <gbriones.gdl@gmail.com>
2015-08-03 16:24:55 -05:00
Dmitry Vasilets
cc28c54a0f Merge pull request #433 from electrofelix/enable-travis
Enable travis CI testing of github PRs
2015-08-01 09:32:20 +02:00
Dmitry Vasilets
63ac8dfdca Merge pull request #432 from electrofelix/fix-logging
Ensure correct order of logger creation
2015-07-31 21:57:51 +02:00
Dmitry Vasilets
8f9fac8da9 Merge pull request #437 from electrofelix/add-cleanup-action
Enable provisionser cleanup hooks to be actioned
2015-07-31 21:53:43 +02:00
Darragh Bailey
edf730e9f5 Enable provisionser cleanup hooks to be actioned
Call the builtin ProvisionserCleanup action when destroying machines.
Part of vagrant since version 1.3.0.
2015-07-31 20:48:19 +01:00
Darragh Bailey
4c7a0d5db0 Enable travis CI testing of github PRs
Add travis CI and support testing against a matrix of vagrant versions.
2015-07-29 17:44:23 +01:00
Darragh Bailey
1f45c5a788 Ensure correct order of logger creation
Loggers must be defined in the correct heirarchial order to ensure that
child loggers inherit the level defined on the parent logger. Otherwise
need to traverse the entire tree to modify the level.
2015-07-29 17:23:16 +01:00
Dmitry Vasilets
a46545e66c Merge pull request #425 from infernix/boot-order
Use per device boot order when boot_order is set
2015-07-29 13:42:38 +02:00
Gerben Meijer
f47cb7c98b Describe changes to boot process due to boot order 2015-07-29 13:31:07 +02:00
Gerben Meijer
dc2f5cb4aa Use per device boot order when boot_order is set
This allows for network boot with any of the NICs that are defined instead of
only from the primary NIC.
2015-07-24 15:25:47 +02:00
Dmitry Vasilets
fd4efde95e Merge pull request #422 from grahamhayes/master
Really Limit p9 tag to 31 bytes
2015-07-23 08:00:49 +02:00
Dmitry Vasilets
5c65625fe8 Merge pull request #423 from anduslim/master
Ensure IP is a string and not an array before connecting via UDP socket.
2015-07-23 07:59:38 +02:00
Andus Lim
d90da43f85 Ensure IP is a string and not an array before connecting via UDP socket. 2015-07-23 10:05:22 +08:00
Graham Hayes
4dd13bf219 Really Limit p9 tag to 31 bytes
Libvirt p9 file system passthrough requires the tag be less than
31 bytes. Using the mount point as the tag can easily exceed this.

In KVM passthough the "target" attribuite in the XML is acutally the
mount tag.

Fixed the mounting script to use the same MD5 to mount the right
filesystem

Fixes #323
2015-07-21 15:45:43 +01:00
Dmitry Vasilets
c834ba3285 Merge pull request #417 from joejulian/allow_veryisolated_networks
Allow veryisolated networks
2015-07-21 08:40:13 +02:00
Joe Julian
fc24db479f Make lookup_network_by_name the default for veryisolated networks 2015-07-20 13:01:34 -07:00
Joe Julian
9b7c9def3c Removed comment
Vagrant only requires an ip **if** `type` is set **and** is not `dhcp`. The
only other type, currently, is `nfs`. Obviously nfs requires an IP so under
that circumstance or if `type` is set to anything but dhcp, vagrant will
error if an ip is not assigned.

If `type` is `nil`, it is deleted from the hash.
2015-07-17 17:23:32 -07:00
Joe Julian
546c98c0a2 Allow veryisolated networks without IP
* Moved network lookup by IP to `lookup_network_by_ip`
* Lookup by name only if lookup by ip fails *and* forward_mode is
  `veryisolated`. This will preserve existing functionality.
* Added network creation ability to `handle_network_name_option`
** Network **must** be veryisolated to be created by name
** Network **must not** have an ip address to be used in the
   `handle_network_name_option` path.

Minor changes:
* corrected inverted autostart logic
* screen formatting

Fixes #402
2015-07-17 17:23:19 -07:00
Joe Julian
6d8c45542e Select the network by name 2015-07-17 15:31:17 -07:00
Joe Julian
6083b613d9 Merge remote-tracking branch 'upstream/master' into allow_veryisolated_networks 2015-07-17 15:21:42 -07:00
Dmitry Vasilets
911966c8b4 Merge pull request #421 from electrofelix/parallel-ssh_info
Allow read actions to be called by other machines
2015-07-15 16:50:14 +02:00
Darragh Bailey
eeb4712c72 Allow read actions to be called by other machines
Disable action locks on read actions so that Vagrant may return ssh
configuration information while other actions are being run on the
machine.

Vagrant locks each machine when an action is being performed on it, to
ensure that it cannot be modified by multiple actions at the same time.
However certain read operations such as retrieving the ssh infomation
may be called either by other machines when executing in parallel or if
the user executes 'vagrant ssh <machine>', during a provision step. When
this occurs Vagrant will throw an error telling the user that multiple
actions may not be executed in parallel and they must wait until the
existing action is finished or see if vagrant/ruby must be terminated.

Example issue is that the ansible provisioner builds an inventory file
where for each machine executing it will query the ssh_info of all other
active machines. When run serially, this will work as expected, however
in parallel it will only succeed if all the actions associated with
ssh_info are complete before any machine begins executing ansible
itself.

Fixes #420
2015-07-14 17:17:50 +01:00
Joe Julian
81688f0fd9 Allow veryisolated networks
With veryisolated networks, there is no ip address assigned thus
matching the network name and ip address fails. This allows the null ip
address to match a named network when that forward_mode is set.
2015-07-13 15:52:26 -07:00
Dmitry Vasilets
1baecfd694 Merge pull request #416 from grahamhayes/limit-p9-tag-length
Limit p9 tag to 31 bytes
2015-07-13 15:55:11 +02:00
Graham Hayes
8d06588e8f Limit p9 tag to 31 bytes
Libvirt p9 file system passthrough requires the tag be less than
31 bytes. Using the mount point as the tag can easily exceed this.

Fixes #323
2015-07-13 14:29:14 +01:00
Dmitry Vasilets
bc82400832 Merge pull request #415 from skamithi/nic_count_as_variable
set nic adapter limit as a variable.
2015-07-13 12:50:24 +02:00
stanley karunditu
389c2d444d set nic adapter limit as a provider variable. default remains 8 like
it was hard coded before. only use case for changing this is if using
virtualized switch VMs that have support for many interfaces.
2015-07-13 06:37:51 -04:00
Dmitry Vasilets
9154ca6282 Merge pull request #413 from skamithi/add_tcp_tunnel_int_support
add libvirt interface tcp tunnel support.
2015-07-11 19:01:00 +02:00
stanley karunditu
a5cd2024ed update README. fix mention of test_vm1. should be test_vm2 2015-07-11 10:55:21 -04:00
stanley karunditu
555470efe3 update README. should say 'test_vm2' instead of 'test_vm1' 2015-07-11 10:53:23 -04:00
stanley karunditu
789fa369c8 add libvirt interface tcp tunnel support.
Useful when configuring Virtualized Switch topologies using Switch VMs like Cumulus
Linux.

vagrant network interface auto_config is disabled in the code. This may be
re-enabled in a future update, once it is better understood how to
auto configure these types of links. All guestOS ports, for now, that are
connected to a tcp tunnel are in a link down state.

TCP tunnels allow guest OSes to exchange STP and LLDP information as
if they are directly connected to each other.

This is not possible with the default virtual switch network mode.

Reference:
https://libvirt.org/formatdomain.html#elementsNICSTCP
2015-07-11 10:49:00 -04:00
Dmitry Vasilets
ab34b7d29b Merge pull request #408 from dcbw/dcbw/pass-mac-to-vagrant
Read MAC address from libvirt and pass up to Vagrant
2015-07-01 00:38:22 +02:00
Dan Williams
ee7afab369 Read MAC address from libvirt and pass up to Vagrant
Configuring networks based solely on slot numbers doesn't work very
well, since there's no way to guarantee that the interface Vagrant
finds is the same one that vagrant-libvirt created at that index.

For example, Vagrant's Fedora configure_networks action does this:

  machine.communicate.sudo("ls /sys/class/net | grep -v lo") do |_, result|
    interface_names = result.split("\n")
  end

  interface_names = networks.map do |network|
    "#{interface_names[network[:interface]]}"
  end

which means that if your image has 'docker' pre-installed, then
interface_names[0] = "docker0" and hilarity ensues, with the first
non-management network being assigned to the vagrant-libvirt
management interface.

Since interface names are very unreliable (they can be renamed by
udev at will or when hardware changes) the only way to ensure that
the interface vagrant-libvirt attaches to the domain maps to the
correct one inside the VM is by MAC address.  Pull the MAC address
out of the libvirt config once the interface has been attached and
pass that up to Vagrant so we have a chance of doing the right thing.
2015-06-30 16:24:30 -05:00
Dmitry Vasilets
b08420409e Merge pull request #406 from lxsli/master
Specify units for machine_virtual_size
2015-06-30 11:34:06 +02:00
Alexis Lee
cd0322ccaf Specify units for machine_virtual_size 2015-06-29 17:14:13 +01:00
Dmitry Vasilets
c01ba1075c Merge pull request #404 from electrofelix/support-volume-resizing
Support volume size resize configuration
2015-06-28 18:32:32 +02:00
Darragh Bailey
d4c72212eb Support volume size resize configuration
Allow control of the volume size to be increased from the box default
virtual_size value so that it is possible to use a box configured with a
minimal initial disk size and create virtual guests with larger disk
sizes.

Warn the user and ignore sizes that are less than the box size, and
inform them that a manual filesystem resize will be needed to take
advantage of the additional available disk space.

fixes: #37
2015-06-28 15:50:44 +01:00
Dmitry Vasilets
313c56e254 Merge pull request #400 from alexblackie/master
Do not remove `.ssh` on package
2015-06-22 12:38:24 +02:00
Alex Blackie
07c6fff1ac Do not remove .ssh on package
`virt-sysprep` will, by default, remove all `.ssh` directories from all
users' home directories. Since we need to have the default Vagrant
insecure keypair in the `authorized_keys`, this causes problems later
when trying to use the packaged box, as Vagrant is unable to log in.

`virt-sysprep` has the ability to disable options via the `--operations`
argument; the `ssh-userdir` option should be disabled.
2015-06-18 10:44:40 -07:00
Dmitry Vasilets
9b5801be50 simplify 2015-06-09 22:29:11 +02:00
Dmitry Vasilets
529588ff50 Merge pull request #389 from electrofelix/identify-disk-by-pool
Use storage pool to identify correct volume
2015-06-09 22:20:04 +02:00
Darragh Bailey
bc517934c2 Use storage pool to identify correct volume
Compare storage pool on the found volumes to avoid selecting a disk from
a different and unreachable to the domain storage pool.

Users may move between storage pools by configuring the driver which
will mean that it is possible to find the same image name in multiple
storage pools and incorrectly perform operations based on the one not
associated with the currently specified pool.

When using persistent images to attach to storage this will cause domain
creation to fail since although the image was found in one of the
storage pools, it may not be connected since it does not exist in the
storage pool requested for the VM.
2015-06-09 18:24:10 +01:00
Dmitry Vasilets
65f14f4fe6 Merge pull request #388 from electrofelix/fix-parallel-up
Fixes #387: Break from mutex synchronize before calling next action
2015-06-08 17:19:30 +02:00
Darragh Bailey
ac7563e6c3 Fixes #387: Break from mutex synchronize before calling next action
Exit the synchronize block before performing calling the next item in
the middleware chain otherwise the mutex lock applies to the entire
provision sequence from that point onwards until the entire chain has
returned to the same point.

Executing a return statement inside a block does not exit the block
automatically. Instead only when the statement returned has been
processed is the wrapping block exited.

Since the return call is actually calling the next action in the chain,
this change ensures that the mutex is not held for subsequent actions
and thus allows vagrant to perform remaining actions in parallel.

Without this all provisioning of machines will always occur serially
instead of parallel when requested.
2015-06-08 16:10:34 +01:00
dima
d12405ed82 0.0.30 2015-06-04 22:46:55 +02:00
Dmitry Vasilets
33850c2567 Merge pull request #383 from dc-bradwadsworth/add_boot_order
Add boot order
2015-06-03 08:18:25 +02:00
Brad Wadsworth
0851b5d804 fixed grammar 2015-06-02 20:33:37 -05:00
Brad Wadsworth
56818642e5 fixed indent and added example 2015-06-02 20:31:21 -05:00