Skip to content

More VM tuning in virt module and states - #59007

Merged
dwoz merged 12 commits into
saltstack:masterfrom
cbosdo:virt-more-tuning
Dec 1, 2020
Merged

dwoz merged 12 commits into
saltstack:masterfrom
cbosdo:virt-more-tuning

Conversation

@cbosdo

@cbosdo cbosdo commented Nov 23, 2020

Copy link
Copy Markdown
Contributor

What does this PR do?

In order to be able to create big performance-optimized VM, we need to expose more parameters like the kvm hint-dedicated feature flag or the clock configuration.

This pull request also includes a few follow up fixes from PR #58196.

Merge requirements satisfied?

Commits signed with GPG?

Yes

@cbosdo
cbosdo requested a review from a team as a code owner November 23, 2020 17:29
@cbosdo
cbosdo requested review from krionbsd and removed request for a team November 23, 2020 17:29
@cbosdo cbosdo changed the title More VM tuning in virt module and states WIP: More VM tuning in virt module and states Nov 23, 2020
@cbosdo

cbosdo commented Nov 23, 2020

Copy link
Copy Markdown
Contributor Author

@krionbsd no need to hurry up reviewing this one before PR #58196 is merged ;)

cbosdo added 12 commits December 1, 2020 09:28
When deleting an attribute that doesn't exist in the node we should not
report a change was made.
When updating we shouldn't set the value as text in those elements.
Libvirt seems happy with it, but it forces modifying the VM definition
even if there was no change.
When updating an XML file, we may need to have a more intelligent
comparison of the current and new values. This typically fits for the
case of numeric values that may have a negligible delta.
Libvirt may round the memory values when defining or updating a VM. That
is perfectly fine, but then the value are slightly different from the
ones passed to the virt.update() function or the virt.running state.
In those cases the state would be reapplied even though there is no real
difference with the VM.

In order to handle that case the memory parameters in the virt.update
mapping now have a comparison function that considers the tiny differences
as equal.

This commit also factorizes the creation of the memory entries in the
virt.update() mapping.
In the mapping passed to xmlutil.change_xml() in virt.update() there are
a lot of common patterns. Extract these into helper functions. Some of
them are common enough to even be defined in the xmlutil module.
For libvirt to be able to communicate with the QEMU Guest Agent if
installed in the guest, a channel named org.qemu.guest_agent.0 is
needed.

Add this channel by default on all newly created KVM virtual machines.
Multiple libvirt cpuset notations can designate the same thing. We need
to expand those notations into an actual cpu list in order to be able to
properly compare.

For instance if the libvirt definition has '0-5,^4', and we have
'0,1,2,3,5' passed to virt.update(), those should not trigger an update
of the définition since they are defining the same thing.
@cbosdo cbosdo changed the title WIP: More VM tuning in virt module and states More VM tuning in virt module and states Dec 1, 2020
@cbosdo

cbosdo commented Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

@krionbsd now the PR has been rebased, and you can review it, unless @Akm0d wants to look into it since he reviewed already a number of virt-related PRs of mine

@cbosdo

cbosdo commented Dec 1, 2020 •

Copy link
Copy Markdown
Contributor Author

re-run pr-centos7-py3-tcp-pytest

@cbosdo

cbosdo commented Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

re-run pr-centos8-py3-pytest

@cbosdo

cbosdo commented Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

re-run pr-freebsd122-py3-pytest

@cbosdo

cbosdo commented Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

@dwoz could you merge this follow up PR for the virt module?

@sagetherage sagetherage added the Aluminium Release Post Mg and Pre Si label Dec 1, 2020
@dwoz
dwoz merged commit 5f91ccc into saltstack:master Dec 1, 2020
@cbosdo
cbosdo deleted the virt-more-tuning branch December 2, 2020 09:01
@cbosdo cbosdo mentioned this pull request Dec 15, 2020
2 of 3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Aluminium Release Post Mg and Pre Si

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants