Commit Graph

551 Commits

Author SHA1 Message Date
Michael Ablassmeier
59ef20812b fix handle_box_image.rb:89: syntax error 2020-04-21 13:49:29 +02:00
Darragh Bailey
4598cfc280 Merge pull request #974 from electrofelix/match-storage-pool-by-default
Default to storage pool if snapshot pool not defined
2020-03-27 18:34:33 +00:00
Darragh Bailey
2f2262774e Merge pull request #1030 from voxik/use-fog-libvirt-for-volume-management
Use fog-libvirt facilities to create volumes for QEMU session.
2020-03-27 18:30:33 +00:00
Tadej Janež
f8eae9984d Use fetch to obtain environment variable value in package_domain (#1035)
ENV is a Ruby Hash which doesn't have a get method but the fetch method.
2019-08-13 12:06:19 +01:00
Vít Ondruch
608037c15c Use fog-libvirt facilities to create volumes for QEMU session.
This is supported since fog-libvirt 0.6.0 via https://github.com/fog/fog-libvirt/pull/60
2019-07-17 18:27:00 +02:00
Darragh Bailey
8e85d0fc8c Merge pull request #985 from martin-schwenke/master
Avoid TOCTOU error in volume creation
2019-05-10 14:18:29 +01:00
Martin Schwenke
222b50925d Avoid TOCTOU error in volume creation
Checking if a volume exists before attempting to create it results in
a "time of check to time of use" race.  When the check is done the
volume doesn't exist but then, because it is shared storage, it is
then created by another node before the local attempt to create it.
This results in an unexpected failure.

It is better to simply attempt to create the volume and ignore EEXIST
in cases where this is permissible.

Implementing this properly is complicated by the fact that the
exception appears to contain only an error message and does not appear
to contain a useful error code.  Digging through the layers in, for
example, fog-libvirt provides no evidence why this is so.  However,
the error message seems fairly unique and matching it is easy, so just
do that.  A small hack to vastly improve stability.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2019-03-13 21:50:13 +11:00
Darragh Bailey
8f314cbb0e Fail on port collisions
Partial Fix #321 by enabling option ExitOnForwardFailure=yes to detect
and fail on forward port mappings failing to bind.
2019-03-06 11:34:23 +00:00
Zak B. Elep
deb36bef8b Allow customizing of virt-sysprep behaviour on package (#955)
Support `vagrant package` of e.g. bento-derived boxes that require SSH
hostkeys already set (as in the case of bento/debian-7 and above,) as
well as leave existing LVM UUIDs untouched (e.g. in bento/ubuntu-18.04.)

Instead of hard-coding sysprep operations, use an environment variable
to set these instead.

Use the Chef bento use case as an example for customizing sysprep
operations.
2019-02-27 12:32:37 +00:00
Darragh Bailey
4d2c26a926 Merge pull request #895 from mattandersen/default-forward-all-nics
Default Port Forwarding to All Host Addresses
2019-02-18 12:19:28 +00:00
Darragh Bailey
e40f1c67b4 Default to storage pool if snapshot pool not defined
Default to using the same storage pool in case the user defines
storage_pool_name without defining snapshot_pool_name and only use a
separate pool when snapshot_pool_name is explicitly set.

This will ensure that setting storage_pool_name to a different pool does
not also require setting snapshot_pool_name to match previous behaviour.

Additionally it is reasonable for a user to assume that if a Vagrantfile
sets storage_pool_name to something other than 'default', then there
should be no need for a default pool.
2019-02-13 16:52:20 +00:00
Darragh Bailey
c02905be14 Merge pull request #885 from brianjmurrell/patch-1
Don't add _ after user defined default_prefix
2019-02-13 15:24:42 +00:00
Evgeni Golov
53539f6ad4 add domain name for the management network
this allows users to have a dedicated domain for their vagrant VMs and
point their regular resolver at the libvirt dnsmasq for that domain to
make them reachable by a full name instead of the IP when accessing the
services on said VM.

an example for such a setup can be found in [1] and [2]

[1] https://liquidat.wordpress.com/2017/03/03/howto-automated-dns-resolution-for-kvmlibvirt-guests-with-a-local-domain/
[2] https://m0dlx.com/blog/Automatic_DNS_updates_from_libvirt_guests.html
2019-02-13 15:51:26 +01:00
Daniel T Chen
41e5b2f362 Updated Libvirt-based Vagrant box search reference and edited names for consistency 2019-02-11 20:18:02 -05:00
Peter Slootweg
c1d2144ec2 check for 'ssh' service to see if interface is up
the 'echo' service is often not available out-of-the-box,
so the 'ping' of the ssh interface fails. This results in the
wrong ip addresses being used in /etc/exports, which results in
the vm not being able to mount the vagrant shares.

The 'vagrant ssh interface' will have the service 'ssh' available
(you won't be able to login to your vagrant box else), so it makes
sense to use that service for the ping.

This fixes the vm not being able to mount the shares over nfs after
a reload due to the wrong ip addresses being used.
2019-01-17 09:38:34 +01:00
Michael Ablassmeier
d5ba63d413 #952 : support different storage pool for base box snapshot (#953) 2018-12-04 17:43:38 +01:00
Darragh Bailey
a725092ee9 Merge pull request #883 from pennsignals/fix/clean-forwarded-ports-darwin
Use ps keyword `command` instead of `cmd`
2018-11-27 19:19:47 +00:00
Darragh Bailey
4b85d12bae Merge pull request #884 from anton-dessiatov/configure_networks
Only use 'configure_networks' capability if there actually are networks to be configured
2018-11-27 18:30:29 +00:00
Chris Roberts
e968de7269 Include -n option for forwarded port ssh processes
In configurations where ControlMaster is used with ControlPersist
set, not including this option results in "stolen" input.
2018-11-05 15:41:23 -08:00
dima
6eedaea0ce 0.0.45 2018-10-23 11:19:27 +02:00
dima
57ed83c46d 0.0.44 2018-10-23 11:14:17 +02:00
David Scaife
e46b0d3d8a USB: Fix redirfilter parameter configuration 2018-08-14 20:40:09 +10:00
Matthew Andersen
24b12af31a Default Port Forwarding to All Host Addresses
Change the default scope of port forwarding from localhost to all host
devices.
2018-05-21 22:33:18 -07:00
Brian J. Murrell
9f203f75a2 Don't add _ after user defined default_prefix
Forcing an underscore between a defined default_prefix and the machine name
forces a naming format that the user might not want.

If they define their own default_prefix and want an underscore between that and
the machine name, they can/should add the underscore to the default_prefix.
2018-04-18 10:51:30 -04:00
Anton Dessiatov
8ba4865e0a Request 'configure_networks' capability only if there actually are networks to configure 2018-04-18 15:06:29 +07:00
jasonwalsh
45b588d7da Use ps keyword command instead of cmd
For Darwin operating systems, `cmd` is not a valid keyword, thus
resulting in the following error when executing Vagrant `reload` and
`destroy` commands:

    ps: cmd: keyword not found
    ps: no valid keywords; valid keywords:

This commit ensures that SSH sessions for forwarded ports are
terminated via their respective process ID for Darwin *and* Linux
operating systems.

Both Darwin and Linux operating systems support the `command` keyword,
as reflected in the following documents, respectively:

- https://apple.co/2H7jFwl
- https://bit.ly/2HakfW0
2018-04-17 18:25:29 -04:00
Antonio Huete Jimenez
6bdff043a7 Allow specifying Hypervisor HyperV features (#870) 2018-03-21 19:00:28 +01:00
Michael Shulbaev
92dc692b08 Fix for :public_network and :private_network in the same VM (#872)
* Clean properties between use. Fixes #842

* Remove empty log line
2018-03-19 13:08:51 +01:00
David Scaife
60e93d4925 USB controller configuration (#861)
* Add USB controller configuration

* Update README with USB controller configuration info

* Rename USB controller parameter to usb_controller

* Code style fixup
2018-03-18 09:25:01 +01:00
dima
99371fee2b bug fixes for qemu_use_session 2018-03-17 14:26:13 +01:00
dima
29ce8443b1 Merge branch 'qemu-session-support' of git://github.com/qazokm/vagrant-libvirt into qazokm-qemu-session-support 2018-03-17 13:51:29 +01:00
Dmitry Vasilets
48599ddfc6 Merge pull request #869 from Rommelag/libvirt_nvram_support
QEMU libvirt nvram support
2018-03-17 13:48:48 +01:00
Anastasiia
d05690d269 Merging svm and vmx cpu_features parameters 2018-03-09 18:01:48 +01:00
Anastasiia
6f45f107c9 Remove nested section in domain template 2018-03-05 17:39:29 +01:00
Tamara Herzog
64a076468e QEMU libvirt nvram support
Some UEFI firmwares may want to use a non-volatile memory to store
variables.
This requires to specify loader and nvram to use UEFI boot in QEMU.
Specifying loader and nvram at the same time will set loader to
type 'pflash' instead of 'rom'.
If loader is used without nvram option type will remain 'rom'.

Further information can be found at libvirt documentation:
https://libvirt.org/formatdomain.html#elementsOS
2018-03-02 11:59:14 +01:00
qazokm
7f50ca2a41 Add basic networking support for qemu session 2018-02-23 12:09:49 +08:00
qazokm
b0eddf6770 Create storage pools and volumes with correct permissions 2018-02-22 15:52:58 +08:00
Michael Darwish
1539f15d4a Fix issue where custom cpu model is ignored (Fixes #864) 2018-02-14 13:13:41 -05:00
dima
542f436fb4 0.0.43 2018-02-07 08:59:09 +01:00
Gerben Meijer
92a1e23d1a Merge pull request #849 from hugoboos/check-outdated
Check for box updates when starting
2018-02-03 14:14:19 +01:00
Nicholas Brown
c717353eea env is an instance variable 2018-02-03 13:01:24 +00:00
dima
5158b0e733 0.0.42 2018-02-03 11:21:07 +01:00
dima
34a0def7d1 0.0.41 2018-02-02 18:49:20 +01:00
Dmitry Vasilets
394cc34290 Revert "update to the recent changes of default behavior in netcat.openbsd (fixes #796)" 2018-02-02 18:42:50 +01:00
Dmitry Vasilets
3b91515bd8 Merge branch 'master' into pci_network 2018-02-02 17:48:00 +01:00
Dmitry Vasilets
ebea5d4a72 Merge pull request #852 from chulup/cpu_topology
Add option to specify CPU topology
2018-02-02 17:46:51 +01:00
Dmitry Vasilets
50f68cc018 Merge pull request #857 from bashims/forward_ports-keys_only
enable IdentitiesOnly when config.ssh.keys_only is specified.
2018-02-02 17:45:09 +01:00
Nicholas Brown
dea85d7cbc Don't silently ignore udp port forwarding option
Currently it ignores the option and turns it into a tcp port.
Instead warn about the UDP option and skip it.
2018-02-02 13:03:23 +00:00
Tomasz Madycki
ea7c01fec0 Specify PCI bus and slot for management net iface
Signed-off-by: Tomasz Madycki <tomasz.madycki@gmail.com>
2018-01-24 18:18:35 +01:00
Tomasz Madycki
c01ddb8dd4 Specify PCI bus and slot for net iface
Signed-off-by: Tomasz Madycki <tomasz.madycki@gmail.com>
2018-01-24 18:18:30 +01:00