Commit Graph

1506 Commits

Author SHA1 Message Date
dependabot[bot]
f5e22f8547
Bump commonmarker from 0.23.9 to 0.23.10 in /docs (#1758) 2023-08-29 15:19:57 +00:00
Darragh Bailey
2cb600388b
Ensure extra docs config is appended (#1767)
Use of tee requires the argument '-a' to append, as current behaviour
will result in replacing the contents which is not intended. The config
settings should be in addition to the configured values.
2023-08-29 16:03:48 +01:00
Darragh Bailey
06fa756b98
Update publish docs workflows (#1762)
Switch to standard workflow for building the documentation from pull
requests and use a workflow call to trigger the deployment for write
access. This should limit the ability to compromise documentation site
from forked PRs while allow validation of dependency changes as well as
more of the actions that impact the deploy.
2023-08-28 20:41:36 +01:00
Darragh Bailey
1783e762d5
Revert "Bump JamesIves/github-pages-deploy-action from 4.4.2 to 4.4.3" (#1760)
Reverts vagrant-libvirt/vagrant-libvirt#1751
2023-08-15 23:18:50 +00:00
dependabot[bot]
13acc0500b
Bump JamesIves/github-pages-deploy-action from 4.4.2 to 4.4.3 (#1751) 2023-08-15 12:09:19 +00:00
Darragh Bailey
1ebfacf979
Adjust groups to reduce test dependencies (#1748)
Switch around the groups defined in the Gemfile to allow execution
without installing additional tools that are useful for development but
not needed for testing or packaging.
2023-08-15 11:19:09 +00:00
Anabelle
284b52f57c
Fix broken links (#1756)
Four links on the doc-site's homepage are 404'ing because their
href/URI's fragment identifier is preceded with a /.

Removal of the extra slash fixes.

Closes: #1759
2023-08-15 11:09:11 +00:00
Darragh Bailey
844e2bb989
Update docs source path (#1754)
Update docs to fix edit link to refer to the correct path.

Fixes: #1752
2023-07-18 23:11:57 +01:00
dependabot[bot]
448ed69f0c
Bump JamesIves/github-pages-deploy-action from 4.4.1 to 4.4.2 (#1745) 2023-06-20 22:13:28 +00:00
Darragh Bailey
889b13d636
Handle nic model type updating during start (#1747)
Start domain added some support to update the nic model type if it
changed to avoid needing to completely destroy and recreate the domain.
Additionally support for setting the management network nic model type
was added, however the default value did not correctly reflect expected.

This updates `management_network_model_type` to default to
`nic_model_type`, which in turn defaults to `virtio`. This has now been
moved from the create network interfaces action into the config object
to allow chained resolving. This should ensure that setting
`nic_model_type` will correctly cause all networks to use the model
unless explicitly specified to use a different model.

Additionally the start domain action for updating the interfaces has
been modified to loop over all interfaces and all configured adapters in
the order they should have been added. This allows for checking whether
the model type needs to be updated based on the
`management_network_model_type` config option for the first network,
assuming the management network has been attached, and otherwise to fall
back to the default from `nic_model_type` for all other interfaces.

Finally ensure the iommu attribute is removed from the nic driver if
the model type is switched to anything other virtio to avoid issues with
attempting to enable invalid settings.

Fixes: #1743
2023-06-20 15:46:05 +01:00
mattkeeler
df1dd25e1e
Update libvirt anchor links in documentation (#1741)
Many of the libvirt anchor links in the docs are out of date. This PR
updates those.
2023-05-07 09:50:45 +01:00
Darragh Bailey
99ac328621
Support iface_name setting for management network (#1739)
Allow setting the interface name that appears on the host for the
management network interface in the guest. This allows for more complex
networking layouts by allowiing matching against devices for vlan
configurations.

Fixes: #1701
2023-05-01 13:12:14 +00:00
dependabot[bot]
768e18f086
Bump nokogiri from 1.14.1 to 1.14.3 in /docs (#1733) 2023-04-22 18:05:55 +00:00
dependabot[bot]
0be30d3ae2
Bump commonmarker from 0.23.8 to 0.23.9 in /docs (#1732) 2023-04-22 16:46:12 +00:00
dependabot[bot]
2b9a0cc83d
Bump rack from 2.2.6.2 to 2.2.6.4 in /docs (#1728) 2023-04-22 13:50:45 +00:00
dependabot[bot]
e612fa953c
Bump actions/upload-artifact from 2 to 3 (#1726) 2023-04-22 13:30:05 +00:00
Darragh Bailey
b153539c90
Ensure tests block if a single matrix job fails (#1730)
Github will drop a required check if the job is skipped. This can happen
if a job is placed after a matrix execution with the intent to act as
the
required status check as well as complete a coverage report for this
repo.
2023-04-22 13:13:17 +00:00
Holger Finger
cb051a8277
specify qcow2 compatibility version to not use very old 0.10 fallback (#1731)
Libvirt creates qcow2 volumes with very old `compat` version `0.10` if
no `compat` version is specified in the xml (see
[here](https://libvirt.org/formatstorage.html#id11)). It seems libvirt
has backwards compatibility reasons to still use `0.10` if nothing is
specified in the xml.

Unfortunately this has the effect that VMs created by vagrant-libvirt
are using the 10 year old `0.10` qcow2 version, instead of the `1.1`
version that has **better performance and stability fixes**.
This is even happening when the backing file of the vagrant box is in
compat `1.1` format.

This is the `qemu-img info` of the backing file provided by the vagrant
box:
```
# qemu-img info /var/lib/libvirt/images/vagrant_box_image_0_box.img
[...]
Format specific information:
    compat: 1.1
    [...]
```
Although the backing file provided by the box is using compat `1.1`, the
created volume by vagrant-libvirt has only compat `0.1` as shown here:
```
# qemu-img info /var/lib/libvirt/images/vagrant-01-test_default.img
[...]
backing file: /var/lib/libvirt/images/vagrant_box_image_0_box.img
Format specific information:
    compat: 0.10
    [...]
```

With this MR, the volume of the VM will use the same `compat` version as
provided by the backing image of the vagrant box.
If `qemu-img info` does not return a `compat` flag, it falls back to the
very old `0.10` version.
2023-04-22 14:03:21 +01:00
kdunn926
f6126464f1
Feature: Allow specifying type for primary disk (#1729)
This PR has changes to allow specifying the `type` for
`disk_driver`, rather than hardcoding it to `qcow2`.
2023-04-22 13:43:38 +01:00
Conner Crosby
9e7d0f3ec8
Fix duplicate provisioning of running VMs (#1722)
Remove duplicate inclusion of Provision middleware when up is called
on an running machine resulting in a double provision.

Includes a unit test update to ensure expected actions are only called
once as well as a regression for calling up on a running machine.

Fixes #1710.
2023-02-16 18:13:31 +00:00
Darragh Bailey
33962dd40b
Allow a mock object to receive synced_folders in config validation spec. (#1721)
This was found while updating the vagrant-libvirt package to 0.11.2 in
Fedora, where we use qemu:///session by default and run the tests with
that instead of qemu:///system from config files.
2023-02-13 17:02:16 +00:00
Jarek Prokop
75da39aba4 Allow a mock object to receive synced_folders in config validation spec.
When using qemu session, the config is checked
if there are 9p synced folders.
We do not care about synced folders when we want to check
if the MAC address is defined correctly.

The result is a failure from the mock object:
`#<Double "vm"> received unexpected message :synced_folders with (no args)`
2023-02-13 17:36:00 +01:00
dependabot[bot]
8fa764fd8a
Bump github-pages from 227 to 228 in /docs (#1718) 2023-02-07 22:37:48 +00:00
dependabot[bot]
b6b2ad6dda
Bump docker/build-push-action from 3 to 4 (#1719) 2023-02-07 17:18:52 +00:00
Darragh Bailey
b8afc8cae8
Try using ruby 2.7 for jekyll docs generation (#1720) 2023-02-07 16:38:59 +00:00
Darragh Bailey
1a59f0ddd8
Update doc generation to use ruby 3.1 (#1717) 2023-02-05 14:56:22 +00:00
Darragh Bailey
03f7bb7e31
Add feature-complete /domain/clock support (#1715)
Feature reference: https://libvirt.org/formatdomain.html#time-keeping
2023-02-05 13:03:46 +00:00
Bart Kus
2213314a5c Add a validator to prevent conflicting clock configs
This is a second layer of protection, to make the behavior minimally
surprising for the user.  The implementation of clock_* handlers follows
a precedence decision order in case of conflict, but that shouldn't be
relied on as the only layer of defense against bad configs.
2023-02-01 10:40:15 -08:00
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
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.
2022-12-02 00:08:12 +00:00