Commit Graph

1478 Commits

Author SHA1 Message Date
Bart Kus
78e46979e0 Add feature-complete /domain/clock support
Feature reference: https://libvirt.org/formatdomain.html#time-keeping
2023-01-26 00:47:15 -08:00
Darragh Bailey
6b907ab6e0 Use append to a truncated file to retain owner (#1677)
Change the default behaviour when logging output from the console to a
file to ensure the file is pre-created and unless append is explicitly
set to true in the source config, truncate the file. Combined with
having the domain template default to enabling append, this causes
libvirt/qemu to not attempt to create the file and thus retains the
owner/group and permissions of the original file.

Relates-to: #1385
2023-01-22 21:22:29 +00:00
dependabot[bot]
9aab9b7d03 Bump rack from 2.2.4 to 2.2.6.2 in /docs (#1707) 2023-01-22 21:11:49 +00:00
Arjen Verstoep
81ea287835 Make NIC model type for management interface configurable (#1711)
This change adds a configuration option for setting the NIC model type for
the management interface, which defaults to `virtio` (the current value)

The context for this change is that I was having severe speed issues
with `virtio` (which have now disappeared, probably after a QEMU update)
and the `e1000e` NIC was doing much better.
2023-01-22 15:23:47 +00:00
Darragh Bailey
0d2b2fcd02 [Fix] forward_ports.rb: no implicit conversion of String into Array (#1706)
Fixes a TypeError due to attempting to add a string to an array instead of
appending as a new element when gateway ports are set.
2023-01-22 14:00:54 +00:00
Babacar TALL
c9cb598d70 [Fix] forward_ports.rb@redirect_port: no implicit conversion of String into Array (TypeError) 2023-01-19 17:20:42 +00:00
Arjen Verstoep
98e674d270 Fix issue where "iommu" was configured for non-virtio network devices (#1702)
When setting the `model_type` of a network to something else than
`virtio`, the `iommu` parameter was still set for the device which isn't
allowed.

The if-statement for setting the parameter was looking at the default NIC
model type (in `@nic_model_type`) instead of final, configured value in `@model_type`.
2023-01-19 15:29:55 +00:00
Darragh Bailey
d4520bedb5 bundle exec rspec fix for ruby3.2 (#1709)
Replace File.exists? with File.exist? and
set empty host when nil on finalize_from_uri

Closes #1708
2023-01-19 15:21:27 +00:00
Mamoru TASAKA
578d3ae429 Set empty host when nil on finalize_from_uri
With ruby3.2, URI.parse now sets empty host instead of nil via:
dd5118f852

Adjust test case so, also with ruby <= 3.1, forcely set empty string for host
when nil to make finalize_from_uri behavior consistent between different
host ruby versions.
2023-01-19 17:07:39 +09:00
Mamoru TASAKA
517bf7792a Replace File.exists? with File.exist?
File.exists? is deprecated since ruby2.1 and is removed with ruby3.2.
Replace with File.exist? .
2023-01-19 16:39:17 +09:00
Yevgeniy Kuksenko
ee06cd0a22 Support setting mtu on public interfaces (#1700)
Setting mtu on management and private interfaces is supported. It should
also be supported on public interfaces.
2022-12-23 11:10:33 +00:00
dependabot[bot]
748e2ccb77 Bump nokogiri from 1.13.9 to 1.13.10 in /docs (#1697) 2022-12-15 15:49:54 +00:00
Darragh Bailey
7f7706fe82 Create codeql.yml (#1698) 2022-12-15 14:04:42 +00:00
Darragh Bailey
0755974be0 Avoid creating extra connection mocks unless needed (#1696)
Remove duplication of connection/machine mocks except for the tests
exercising multi machine related tests.
2022-12-14 14:16:54 +00:00
Darragh Bailey
d8c8d3d85f Support setting iface name for target dev on private networks (#1692)
Allow for iface_name to be set on public_network configurations to
control the name of the interface created by libvirt. This overrides the
default that would be created automatically, but cannot use a reserved
name as it will be ignored.

Closes: #799
2022-12-11 11:21:34 +00:00
Darragh Bailey
1741ee2f6d Use configured_networks helper in validate (#1695)
Switch to configured networks helper in validate to ensure that that the
validation checks the final list of networks that will be used, not just
those initial configured.

This will help ensure the management network is validated in addition to
the user specified networks.
2022-12-09 17:10:33 +00:00
Darragh Bailey
7a8306745b Handle autoport when port explicit set (#1693)
Better handle setting the autoport value when the port is explicitly set
to ensure that the XML sent to update the VM is correct and will be the
XML that is reflected in the defined machine.

By prioritizing checking if the port is provided, graphics_autoport =
"yes" is ignored.

Fixes: #1687
2022-12-09 07:48:08 +00:00
Darragh Bailey
1733e1cc19 Drop testing against ruby 2.2 for vagrant 2.0.4 (#1694)
Vagrant 2.0.4 no longer appears in any supported release of a distro,
therefore drop testing of it in CI along with the version of ruby
needed.
2022-12-08 23:17:54 +00:00
Darragh Bailey
e0b17b34f5 Ensure iommu XML is only set for virtio nics (#1690)
Skip setting iommu option on the drive unless it's for virtio model type
nics.

Fixes: #1688
0.11.2
2022-12-04 16:19:43 +00:00
Darragh Bailey
5f324e9cf3 Include resume domain spec missed (#1689)
Add the resume domain spec tests missed when updating to support
pmsuspended.
2022-12-04 15:54:34 +00:00
Darragh Bailey
431cf867ba Handle pmsuspended resume and add state translation message (#1686)
Ensure there is a translation message for state and call the correct
wakeup depending on which form of suspend/pause the machine is in.

Closes: #1200
2022-12-03 08:05:58 +00:00
Darragh Bailey
612eb67f5f Correct destroy method call logic (#1684)
Actual implementation of the flags behaviour was different than the code
expected. Update to use the correct behaviour.
0.11.1 0.11.0
2022-12-02 00:08:12 +00:00
Darragh Bailey
1f6309b0bf Add docs to install latest development version (#1683)
Provide directions in both the issue template for bug reports and in the
main README to help users install the very latest development version of
the plugin.

Include a warning about the token getting embedded in the vagrant
plugins.json file.
2022-12-01 23:33:50 +00:00
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