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.
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.
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
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: #1011Closes: #1012
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>
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
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.
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.
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.
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.
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
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.
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
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
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.
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.
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.
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.
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.