Commit Graph

294 Commits

Author SHA1 Message Date
s-vx
e6c68358cf Fix minor typo in README.md 2021-06-04 13:10:53 -04:00
Darragh Bailey
31cc8aa91e Add basic vagrant package integration test (#1302)
Simple integration test for vagrant package to ensure the execution
completes successfully to allow for some refactoring to be performed.

Ensure libguestfs-tools installed to provide virt-sysprep for tests and
update docs to reflect.
2021-06-01 17:45:02 +01:00
Rui Lopes
c96364575a add pxe boot public_network example 2021-05-27 07:42:04 +01:00
Darragh Bailey
7ce85f2216 Make disks attribute path required check for name collisions (#1293)
Ensure the path attribute for disks in the new format is required to
ensure there is always one parameter required for the hash element in
the array of disks. This avoids a certain amount of magical behaviour.

Identify that the name attribute is optional, however add checks for
collisions in volume names generated, as well as ensuring the volumes
are still prefixed in a way to prevent accidental collisions between
boxes utilizing the same names.

Add notes to the README identifying the format as experimental, with
notes on how the format should appear.
2021-05-22 16:59:11 +01:00
Darragh Bailey
981642afeb Invert forward ssh port behaviour (#1289)
Multi machines environments will result in collisions until auto
correction is implemented. Therefore invert to keep the forwarding of
the default ssh port disabled by default initially until can handle the
port collisions detection and resolving.

Relates: #1012
2021-05-18 18:30:56 +01:00
Matthias Blümel
07391048af Enable forward ssh-port to host
Provides an option to disable the forwarding in case it causes issues.
However based on original PRs adding the forwarded behaviour, it does
not appear to be intentional to exclude it permanently.

Closes: #1011
Closes: #1012
2021-05-16 19:55:54 +01:00
Darragh Bailey
14b57df49d Improve the development instructions (#1282)
Add some details to ensure correct execution of the rspec tests locally.

Closes: #1064
2021-05-15 14:47:05 +01:00
Zdenek Zambersky
3b1b17a5c9 Add support for spinlocks hyperv feature 2021-05-12 20:50:23 +02:00
Wong Hoi Sing Edison
e2766d563e Add virtiofs Support to vagrant-libvirt
From <https://virtio-fs.gitlab.io/index.html#overview>:

> Virtio-fs is a shared file system that lets virtual machines access a directory tree on the host. Unlike existing approaches, it is designed to offer local file system semantics and performance.

From <https://virtio-fs.gitlab.io/index.html#faq>:

> Existing solutions to this problem, such as virtio-9p, are based on existing network protocols that are not optimized for virtualization use cases. As a result they do not perform as well as local file systems and do not provide the semantics that some applications rely on.

This PR add `virtiofs` support to vagrant-libvirt, which simply clone-and-hack from our existing 9p implementation. It also tidy up and synchronize naming for 9p implementation.

Tested with:

  - Host: Ubuntu 20.10 + Linux 5.10.30 + QEMU 5.0.0 + Libvirt 6.6.0 + Vagrant 2.2.15
  - Guest: Ubuntu 20.04 + Linux 5.4.0

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2021-04-17 11:20:34 +00:00
Jacek Tomasiak
8f65aec9eb Add option to set management network MTU (#1233)
This adds option to specify non-standard MTU for created management
network.
2021-04-06 14:25:14 +00:00
Darragh Bailey
3d35c52372 Replace obsolete usage of Vagrant.require_plugin (#1234)
Fixes #509
2021-03-22 11:51:41 +00:00
Darragh Bailey
a16c3f7898 Move proxy_command to config and support templating (#1226)
Migrate the proxy_command specification to the config and add support
for user override template to be used for edge cases. Moving it to the
config allows mistakes in the interpolation to be caught before the
machine is brought up.

Note this uses a more restrictive replacement to avoid requiring
escaping of '%' or '$'.

Issue #921 already partially resolved thanks to @ElArtista, this
completes the fix by allowing users to override as needed.

Fixes: #921
2021-03-21 15:19:53 +00:00
Darragh Bailey
4ee40728b3 Make LIBVIRT_DEFAULT_URI a fackball mechanism (#1223)
Switch to only picking up LIBVIRT_DEFAULT_URI if no settings that could
affect the uri have been explicitly set. Some of these may not actually
appear in the URI depending on what is actually set or not set, however
it is important that should only use the env variable if the user has
not explicitly configured options relevant and instead allow them to
configure as needed.
2021-03-17 14:41:14 +00:00
Nick Maludy
1db7db2410 Added notes on how to download source RPMS for CentOS 8 stream (#1213)
Adds notes on how to download the SRPMS for CentOS 8 stream to 
facilitate rebuilding.

Inspiration came from the following email chain 
https://www.spinics.net/lists/centos-devel/msg19439.html, which only 
provides part of the solution.
2021-03-13 15:15:52 +00:00
Darragh Bailey
48c1a55153 Use correct shell variable for options pass-thru (#1197)
Switch using "$@" to ensure that options provided on the command line to
be interpreted by vagrant are correctly passed on with appropriate
quoting. This fixes the issue where running the docker container with
`vagrant ssh -c 'ls -la'` would fail as the `-la` option was interpreted
by vagrant instead of being passed as part of the value for the `-c`
option.
2021-01-06 10:48:22 +00:00
pgillich
441bcc24bf Improving Docker based Installation (#1194)
To be able to use 'vagrant ssh' from within the docker container, it is 
necessary to run within the host network context.

Include a helper alias suggestion and a note about a current issue in 
passing arguments to vagrant options which impacts the 'vagrant ssh -c 
...' syntax with an alternative.
2021-01-05 10:35:20 +00:00
David Scaife
5471caabe5 Add disk driver options with minor refactor (#1000)
Adds disk driver options: io, copy_on_read, discard and detect_zeroes
for both the primary vm disk and additional disks.

Minor refactor of existing volume_cache to deprecate and replace with a
single call to disk_driver that contains all of the options. Usage of
the volume_cache option will now result in a message to ui that it has
been replaced, as well as a warning that it is ignored if disk_driveris
set.

The old option volume_cache is only used if disk_driver is not present
(even if :cache is not set - in that case, the hypervisor default is
always used).

Resolves #998
2020-12-17 11:03:47 +00:00
zzambers
d0787c803d Add support for clock setup (#1047)
This adds support for setting clock offset and timers.

See https://libvirt.org/formatdomain.html#elementsTime for more info.
2020-12-16 19:19:24 +00:00
Darragh Bailey
92964823d0 Update TOC with recent additions (#1189)
Trigger a refresh on the TOC to pick up recent additions.
2020-12-16 13:14:22 +00:00
Edmund Rhudy
a11750cc3b Add support for configuring memballoon-related settings (#1083)
Allow configuration of various memballoon-related settings. It was 
discovered that it may be needed to be able to control the memballoon's 
PCI slot/bus location in order to prevent it from conflicting with 
other explicit PCI location assignments. For example when configuring 
the management network NIC to go to slot 0x05, libvirt would try to put 
the memballoon there as well and resulting in a fatal error.
2020-12-15 17:40:05 +00:00
Jason Tarasovic
1251189145 Add ability to use emulated tpm (#1166)
Qemu has supported tpm 2 and the ability to start swtpm. Additionally 
it expands the tests for the tpm configuration to ensure that only when 
the options cause a change to the domain XML will the domain be updated 
on a subsequent start. This change just allows passing through the 
necessary config.

Vagrant.configure("2") do |config|
  config.vm.provider :libvirt do |libvirt|
    libvirt.tpm_model = "tpm-crb"
    libvirt.tpm_type = "emulator"
    libvirt.tpm_version = "2.0"
  end
end

closes #965
2020-12-15 12:43:46 +00:00
Darragh Bailey
c12b0de254 Add doc on ssh key replacement if repackaging (#1169)
If planning to repackage a machine that is brought up with vagrant and
modified, it is necessary to avoid the default ssh replacement that
normally takes place to ensure the subsequent box that is halted and
packaged can be accessed by vagrant using the default ssh key
subsequently.

Add some small documentation notes to help users be aware to this so
that they know to set `config.ssh.insert_key = false` when using vagrant
to build a box.

Fixes: #1116
2020-11-17 19:31:19 +00:00
IPv4v6
f91e1784ff Add forward mode 'open' to README (#1118)
Document forward mode 'open' as this is passed to libvirt to handle.
2020-11-16 16:45:09 +00:00
Michael Ablassmeier
027910d236 Support setting ovs interface id (#1156)
Support setting the ovs interfaceid parameter

Fixes: #1155
2020-11-16 15:11:59 +00:00
Brad Smith
b2b40e1149 Additional install notes for Fedora (#1107)
Provides steps for how to build and copy across the required libraries
to avoid a number of runtime failures on Fedora when using upstream
releases of vagrant.

These steps also remove the need to provide `CONFIGURE_ARGS=..`
as part of the install process.
2020-11-16 15:03:30 +00:00
Radix10
8f37a78290 fix typo (#1154) 2020-10-09 09:53:59 +01:00
Darragh Bailey
d4d82d9773 Add docker image for vagrant-libvirt (#1149)
Provide a docker image that supports execution of vagrant-libvirt
provided the host system has docker and libvirt installed. This can help
side step many of the library compatibility issues experienced by users
by providing an alternative way to run the latest code should their
distribution not have a natively packaged vagrant.
2020-10-03 17:16:00 +01:00
Darragh Bailey
d7debb68c6 Merge pull request #1123 from cvoltz/wwn
Add WWN support
2020-08-16 19:49:15 +01:00
Rui Lopes
19cd1d5629 let the user set the domain title and description 2020-08-12 22:06:05 +01:00
Christopher Voltz
437fc3f3b0 Add WWN support
Add the disk attribute wwn to set the WWN of a disk drive.

Signed-off-by: christopher@voltz.us
2020-06-14 20:00:15 -05:00
Michael Ablassmeier
5e77446297 add snapshot_pool_name to README (#1114) 2020-06-04 15:19:34 +01:00
Tim Hughes
2ba06a168f update examples to use fedora/32-cloud-base
fixes #1070
2020-06-04 01:04:18 +01:00
Petr Ruzicka
d75c9ffda3 Improve Fedora installation procedure (#1101) 2020-05-10 14:54:56 +01:00
Julio Lajara
f00bc0eaae Add qemu commandline environment variable support. (#961)
Make it easier to tweak some qemu options by allowing passthru of
command line environment variables.

- Also cleans up weird variable indirection used for qemu commandline args
  variable through `qargs` in various constructors.
- Addresses some functionality discussed in #776.
2020-05-10 14:37:31 +01:00
Darragh Bailey
f5f9e34da0 Tidy up README and TOC (#1108)
Bring the TOC in line with recent additions and enable the ability to
use a vim plugin to quickly regenerate in lieu of a better alternative.

Using https://github.com/mzlogin/vim-markdown-toc

Clean up any trailing whitespace so that subsequent file updates
by other PRs will be able to simply regen using appropriate tooling
without pulling in additional changes unrelated.
2020-05-10 14:23:25 +01:00
Quinten Johnson
7e966febbd Allow setting of PCI domain (#927) 2020-05-10 11:40:29 +01:00
Quinten Johnson
618c8b251d Allow specification of domain shares (#925)
Weighted priority of the domain relative to others on the host.
2020-05-10 11:24:06 +01:00
Quinten Johnson
d9c5f63410 Allow specification of numa nodeset (#924)
This specifies the physical numa nodes on which the virtual memory can be
placed.
2020-05-10 10:52:46 +01:00
Quinten Johnson
60ef4b03d1 Allow specification of cpuset (#923)
Allows the pinning of vcpus to physical cpus.
2020-04-29 19:08:01 +01:00
Michael Ablassmeier
509671c3a3 provide working link to documentation about nested virtualization 2020-04-29 16:46:56 +02:00
Michael Ablassmeier
d39a9a302a Allow setting of Sysprep options and multiple hyperv features (#1089)
Allow setting of multiple hyperv features and support for virt-sysprep options

Fixes #1039 and #1077
2020-04-21 11:37:03 +01:00
Darragh Bailey
a8e6551332 Merge pull request #1041 from kittydoor/user-session-doc
Added more details on how to use vagrant-libvirt with QEMU user sessions
2019-12-05 19:14:49 +00:00
Vadym Haidamaka
2947a1d52c docs: update build dependencies for newer Debian-based distros
See https://lists.debian.org/debian-user/2016/11/msg00518.html
2019-10-20 15:36:06 +03:00
Jeff Welling
1739809a12 Update readme doc howto troubleshoot (#1052)
Note common troubleshooting tools/steps in README
2019-10-10 20:39:58 +01:00
Katherine Pata
330b0f83cd Added more details on how to use vagrant-libvirt with QEMU user sessions 2019-08-30 11:02:16 +02:00
Dario Maiocchi
e45f6a5110 Update readme with openSUSE installation
Update readme with openSUSE installation
2019-07-05 13:46:53 +02:00
Darragh Bailey
3f30606021 Update versions tested in README (#1006) 2019-07-01 10:43:21 +01: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
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