Commit Graph

1455 Commits

Author SHA1 Message Date
Darragh Bailey
07e4a69a50
Ensure dependency on ip tool is satisfied (#1681)
Additionally ensure that the default docker run commands allow vagrant
to request user input by allocating a tty.
2022-11-24 10:48:45 +00:00
Darragh Bailey
6bbde74be0
Ensure acceptance tests are executed (#1680)
Ensure the acceptance tests are actually executed and resolve any issues
that have crept in since they were not running as expected.

Call the ResolveDiskSettings on reload to ensure that the start domain
action will have all of the necessary configuration for any additional
storage disks added.

Tidy up create domain output when disks are attached.

Fixes: #1678
2022-11-23 17:33:10 +00:00
Darragh Bailey
f25a375d18
Clear and create forwarded ports on suspend/resume (#1679)
Ensure forwarded ports are cleared on suspend and recreated on resume.
Included tests to exercise the entire up/start behaviour to ensure the
expected actions are called in various scenarios, moving config validate
to only occur at the entrypoints and dropping it from being called
during start. Also eliminate a duplicate SetupComplete call.

Fixes: #1115
2022-11-23 13:44:32 +00:00
David Davis
451c6f6c53
Add libvirt-dev to Ubuntu install (#1676)
Installation of vagrant-libvirt requires the libvirt-dev package.
2022-11-21 11:15:24 +00:00
Uli Fahrer
0363459bec
feat: add websocket graphics config (#1672)
This adds websocket functionality for VNC. The websocket attribute may 
be used to specify the port to listen on (with -1 meaning 
auto-allocation and autoport having no effect due to security reasons).
2022-11-21 11:05:51 +00:00
Bram de Greve
6c4b7758aa
Adding disk_address_type option. (#954)
This patch allows to specify the virtio-mmio address type, which is
needed for debian guests on virt machines that don't support the PCI
address type.

See also 
https://translatedcode.wordpress.com/2016/11/03/installing-debian-on-qemus-32-bit-arm-virt-board/
where it is explicitly said to use `virtio-blk-device` and
`virtio-net-device` instead of `virtio-blk-pci` and `virtio-net-pci`, for
that reason.

Apparently, libvirt will use the `virtio-blk-pci` and `virtio-net-pci`
by default. By setting address type to `virtio-mmio`, it uses
`virtio-blk-device` instead. It seems not necessary to do the same for
the network controller, since libvirt will also use `virtio-net-device`
if the disk address type is set to `virtio-mmio`.

While this should help with ARM machines, it won't solve all issues
as some machines will boot perfectly with the existing defaults
provided the correct loader binary is used.

Relates-to: #1608
2022-11-14 12:52:22 +00:00
Darragh Bailey
df41f6f037
Ensure default public_network :dev shown on error (#1670)
During validation ensure that the default value for public network
devices is selected and shown on error if it's not one of the host
devices that are currently discovered.
2022-11-10 18:49:46 +00:00
Darragh Bailey
980db1049a
Adding SEV support (#1664)
Secure Encryption Virtualization is supported by libvirt and this
change adds support for vagrant-libvirt to enable it.

It requires a UEFI base box and needs a combination of options to be
configured for it to work.

Co-authored-by: PELLET Norman <norman.pellet@csem.ch>
Co-authored-by: MUNTANÉ CALVO Enric <emc@csem.ch>
Co-authored-by: Darragh Bailey <daragh.bailey@gmail.com>
Closes: #1372
2022-11-10 12:22:37 +00:00
Darragh Bailey
4fe53477b2
Support running tests in parallel (#1667)
To allow for faster execution of the unit tests locally, allow running
them in parallel.
2022-11-08 16:28:32 +00:00
Darragh Bailey
1c7e9d8bd0
Use ruby 3.1.2 by default for development (#1666)
Update to recent ruby for main development env.
2022-11-08 15:21:04 +00:00
Darragh Bailey
4be8c8ada4
Include distro matrix status badge from qa project (#1665) 2022-11-07 14:53:13 +01:00
Darragh Bailey
cb93b5a168
Tweak fedora installation instructions (#1663)
To ensure dependencies are installed from fedora install
of directly from rubygems, restore retrieval of the
dependencies from repositories, with adjustments now
that vagrant-libvirt is marked as disabled.
2022-11-06 13:38:33 +00:00
Darragh Bailey
d384e63235
Reject cpu features enabled without model (#1658)
Recent Libvirt will silently drop cpu features set without a model
defined. Ensure this scenario is flagged as being invalid up front.

Fixes: #996
2022-11-04 17:21:42 +00:00
Darragh Bailey
2444889155
Replace use of secret for org name (#1662)
Rely on whether docker username/token is available to publish the image
to docker hub only and discard use of the secret for the org name.

Ensure org name is normalized for dockerhub.
2022-11-04 17:03:15 +00:00
Darragh Bailey
e34a791b5b
Attempt to passing multiple lines via env context (#1661) 2022-11-04 14:43:33 +00:00
Darragh Bailey
6109957d50
Attempt to treat image names as text block (#1659)
Passing the image names directly to an input variable appears to result
in encoding the newline intended to provide a second name to be built
and have tags appended.
2022-11-04 14:02:33 +00:00
Darragh Bailey
dee41760cf
Roll forward to ruby 3.1 and remove patches (#1660)
Use ruby 3.1 vagrant main and latest release, dropping the current
patching as these should now work with more recent rubies.

Retain the current ruby-libvirt patch.
2022-11-04 13:51:53 +00:00
Darragh Bailey
585cf6dd67
Remove calls to set-output as now deprecated (#1657) 2022-11-03 19:30:57 +01:00
Darragh Bailey
87131a171f
Ensure buildah job checks out pull request changes (#1656)
With the change to using pull_request_target, need to ensure the buildah
job also checks out the PR contents.
2022-11-03 18:20:44 +00:00
Darragh Bailey
1ff551e1a5
Fix docker image workflow syntax issue (#1655) 2022-11-03 17:32:10 +00:00
Darragh Bailey
7697d03323
Ensure reusable workflow reference correctly (#1654)
Reference the main branch for where to find the reusable workflow.
Additionally make sure that login to docker hub is only for push to
main and tags.
2022-11-03 16:58:09 +01:00
Darragh Bailey
b709758c00
Publish docker image to github packages for PRs (#1646)
Publish images built from PRs to the github container registry to
provide a
simple way to test changes made by being able to pull the built
container.
2022-11-03 14:49:55 +00:00
Darragh Bailey
aa826b2291
Switch to using github generated release notes (#1652)
To avoid constantly hitting too many API requests, switch to using
github release note generation for releases.
2022-11-02 19:35:43 +01:00
Darragh Bailey
554166cdc7
Fix list networks being read-only (#1651)
Change driver list of networks returned to only be read-only when using
qemu session, to allow for VMs using the system context to be able to
restart any networks needed.
2022-11-02 16:01:49 +00:00
Darragh Bailey
fddc9c32d6
Update installation docs (#1650)
Include CentOS 9 Stream and CentOS 8 Stream, in addition to updating the
openSUSE instructions to cover upstream vagrant package installation.

Closes: #1429
Closes: #1537
2022-11-02 14:43:10 +01:00
Darragh Bailey
ddb6dbd076
Avoid setting cpu element on unsupported architectures (#1633)
The CPU element to manage the mode, model, features (including nested),
is only available on some architectures. To allow this plugin to
generate XML valid for other architectures such as RISC-V, the CPU
element needs to be optional and only enabled when the architecture
specified supports it.

Include checks in the validation section to help prevent the setting of
an unsupported architecture with any of the CPU features that require
the CPU element to be available.

Fixes: #1538
2022-10-30 14:29:21 +00:00
dependabot[bot]
199b3a07e6
Bump nokogiri from 1.13.8 to 1.13.9 in /docs (#1647) 2022-10-30 11:29:29 +00:00
dependabot[bot]
f77a878345
Bump JamesIves/github-pages-deploy-action from 4.4.0 to 4.4.1 (#1645) 2022-10-17 09:46:20 +00:00
Darragh Bailey
a12054f2ad
Validate provided synced_folders types for access (#1644)
Reject any 9p synced folders that the user does not have read access to
the host path where using qemu sessions. This is because the VM will
launched with the user permissions instead of system permissions and
will fail to come up if trying to add a path that is not readable to be
mounted into the guest.

Additionally flag that virtiofs may not be supported with qemu sessions,
but do not reject in case support is added in the future.

Fixes: #1430
2022-10-14 14:25:18 +01:00
Darragh Bailey
1048e72dac
Tidy UI output on create (#1643)
Skip emitting items that are not set by default where possible.
2022-10-13 15:00:12 +00:00
Darragh Bailey
e87de89855
Use provided ssh port for machine (#1641)
To allow for a different ssh port to be used when connecting to a
machine for NFS setup, use the port provided in the ssh_info hash
with a fallback to the default ssh port.

This may allow NFS mounting into Windows guests once support is added to
vagrant itself to handle NFS installation.

Fixes: #1640
2022-10-13 13:28:25 +01:00
Darragh Bailey
305232ff11
Unit context improvements (#1639)
Move the unit context to a name matching the other contexts. Remove some
unnecessary entries from it that are unused, and remove references to
the old name relying on spec helper to load all contexts.
2022-10-11 17:19:52 +00:00
Darragh Bailey
a8ab0040ff
Disable graphics autoport attr when using spice (#1636)
If the graphics type is set to spice, then skip setting the autoport as
the attribute will be discarded by libvirt causing it to appear as
though not all of the XML sent to start the domain was accepted.
2022-10-11 18:12:32 +01:00
Darragh Bailey
59c7d9f18e
Use same list_all_networks and filter (#1638)
Ensure the same filtering for networks supported by vagrant-libvirt is
done for both driver and util by moving to call the same function with
filtering.

This avoids calls for the list of host devices from failing to parse
some networks that are not supported.

Fixes: #599
2022-10-11 17:54:41 +01:00
dependabot[bot]
736190ae41
Bump actions/github-script from 5 to 6 (#1637) 2022-10-10 12:52:26 +00:00
Oded Arbel
d38e130f47
Floppy support (#1334)
Add support for attaching 1 or 2 floppy drives to the VM using "vfd"
image files.
2022-10-08 10:59:06 +00:00
Who? Me?!
35e3730abf
Add vcpupin support (#1007)
Support tuning to pin which host CPUs the vCPUs will be pinned to.
2022-10-08 12:14:08 +02:00
Darragh Bailey
629ead3140
Adjust workflow to work for forked PRs (#1635)
Save the triggering PR as an artifact when building the gem as it will
be required by the triggered workflow to determine the PR that triggered
it since Github does not populate the event data if the PR is a forked
PR.
2022-10-07 10:24:11 +00:00
Darragh Bailey
67e36bd2a3
Workflow to notify gem artifact available for PR (#1632)
Adds workflow to publish a link to the gem artifact built for the
current PR. Allows for contributors or those impacted by issues to have
an easier test mechanism.
2022-10-05 18:39:25 +00:00
Darragh Bailey
414aef131d
Ignore networks that cannot be used (#1628)
If the network does not have a bridge name, ignore it and move onto the
next one. This allows for hostdev networks to exist without breaking.

Includes some rudimentary testing to exercise the lookup code along with
a small bit of refactoring based on the realisation that there is no
need to lookup the network information twice as it is available if the
list_all_networks API is used.

Fixes: #599
2022-10-05 13:58:37 +00:00
Darragh Bailey
8e45f3abb2
Ensure credentials file permissions set correctly (#1631) 2022-10-05 13:38:28 +00:00
Darragh Bailey
f5b70bc074
Query host interfaces directly as libvirt may not include them (#1627)
On some distros the libvirt does not appear to always return all of the
host interfaces. Switch to using 'ip -j link show' to read them directly
from the system in order to ensure all devices are read.

Refactor the driver tests to better isolate between test setup for the
different sets of functions and avoid accidental setting of
configuration details that may not be obvious.

Fixes: #1624
2022-10-05 13:29:44 +00:00
Darragh Bailey
2c67743f07
Note that vagrant may select nfs or rsync as default synced_folder (#1630)
Depending on the installed packages present on the host system, vagrant
may select either nfs or rsync as the default synced_folder
implementation.

Fixes: #419
2022-10-05 00:56:31 +01:00
Darragh Bailey
48c31f12b3
Make code available as gem for test installs (#1629)
Make it possible for others to help validate vagrant-libvirt plugin
changes by building a gem that can be installed from a github packages
repository.
2022-10-05 00:11:00 +01:00
dependabot[bot]
28c68d2f99
Bump actions/github-script from 6.3.0 to 6.3.1 (#1626) 2022-10-03 10:10:51 +00:00
Darragh Bailey
624df5d8ed
Select better defaults when graphics type is spice (#1625)
Reduce the number of other graphics settings that need to be adjusted
once the type has been set to spice by defaulting the remaining options
to ones better suited for spice, in addition to adding the required
channel automatically.

Fixes: #1482
2022-10-02 21:43:37 +01:00
Darragh Bailey
6d5ad2b87c
Update development steps (#1623)
Ensure the development steps can be successfully executed with system
ruby on Fedora 36 to try and help new contributors have an easier
on-ramp.

Support running acceptance tests locally, though note that it may
require rvm if vagrant doesn't support the ruby version used by the
distro.
2022-10-01 15:53:00 +01:00
Darragh Bailey
54853d1d3d
Report graphics port after resolving (#1622)
Allow libvirt to start the domain before reading back the XML to
retrieve the port assigned automatically for subsequent graphics access
when autoport is enabled.

Fixes: #992
2022-10-01 13:59:36 +00:00
Darragh Bailey
7813ad3740
Emit default for bootmenu to be off (#1621)
Ensure the bootmenu is disabled by default. When not specified it will
default to the hypervisor default behaviour, however this is not
necessarily defined consistently across different distros. Therefore for
a consistent behaviour, simply ensure it is always configured to be off,
unless explicitly required to be enabled when the boot order is
configured.

Fixes: #947
2022-09-30 22:36:21 +01:00
Darragh Bailey
2882ad01b1
Add example for use of kernel/initrd/cmdline options (#1620)
Provide a simple working example of how to set the kernel, initrd,
cmdline options and where to retrieve the required files when working
with disk images.

Fixes: #920
2022-09-30 16:39:56 +00:00