Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle many vCPUs #293

Merged
merged 2 commits into from
Apr 26, 2022
Merged

Handle many vCPUs #293

merged 2 commits into from
Apr 26, 2022

Conversation

mz-pdm
Copy link
Member

@mz-pdm mz-pdm commented Apr 20, 2022

  • Always limit the maximum numbers of vCPUs to reasonable values.
  • Increase TSEG size for large VMs.

See the commit messages for more details.

Bug-Url: https://bugzilla.redhat.com/2075486

@mz-pdm mz-pdm added the virt label Apr 20, 2022
@mz-pdm mz-pdm requested a review from liranr23 April 20, 2022 12:12
@michalskrivanek
Copy link
Member

great, LGTM

@mz-pdm
Copy link
Member Author

mz-pdm commented Apr 22, 2022

  • Tests fixed.
  • A swapped condition fixed.

Seems to be working (as for value in the domain.xml). NVDIMM calculation wasn't tested.

@mz-pdm mz-pdm marked this pull request as ready for review April 22, 2022 20:55
Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's good that we avoid the changes in most of the common configurations for which it is not needed and that we try to minimize the amount of resources when it is applied, yet - it sounds like kind of experience so better to make it a bit more configurable

@mz-pdm
Copy link
Member Author

mz-pdm commented Apr 25, 2022

Additionally the hard max vCPU limit is not strictly enforced again, it can be lifted up to LEGACY_MAX_SOCKETS based value again unless the newly introduced limit ManyVmCpus is exceeded.

Not yet tested and tests fail (due to missing mockings). I don't know how to put the PR back to draft status.

@mz-pdm
Copy link
Member Author

mz-pdm commented Apr 25, 2022

Tests fixed.

With the lifted limit on the maximum number of CPU sockets implemented
in commit a4c0858, the maximum
possible number of vCPUs increased significantly.  But it is not
without its price.  The increased maximum number of vCPUs reduces
memory available to the guest OS and may cause some problems,
especially with UEFI firmware.

There is already MaxNumOfCpusCoefficient config value limiting the
maximum number of vCPUs.  But it is not enforced strictly, the maximum
number of vCPUs can still be significantly higher, to be consistent
with the previous behavior.  Let’s be more cautious and clearer and
apply MaxNumOfCpusCoefficient strictly, unless the maximum number of
vCPUs is not very large, in the sense of the newly introduced
ManyVmCpus config value.

Bug-Url: https://bugzilla.redhat.com/2075486
Large VMs using UEFI may not start if the TSEG size is not big
enough.  There is no clear rule when the TSEG size must be increased.
We increase it in the following cases:

- If the maximum number of VM vCPUs is at least 128.

- If the maximum memory is at least 16 GB, i.e. the memory taken from
  the guest by changing the TSEG size is negligible.

We increase the TSEG size by wild-guess values based on various
comments from Bugzilla, see the comment in the code for more details.
As the TSEG size is taken from the memory available to the guest, we
do not want to make it unnecessarily large by default.  On the other
hand, it’s better to be on the safe side and allocate a bit more than
perhaps needed rather than causing the VM not to start.

We introduce config values for both the limits mentioned above, in
case the selected values don’t work well enough.

Bug-Url: https://bugzilla.redhat.com/2075486
@mz-pdm
Copy link
Member Author

mz-pdm commented Apr 26, 2022

Verified: Quite many combinations to check but I believe it produces expected domain XMLs.

@ahadas
Copy link
Member

ahadas commented Apr 26, 2022

/ost

@michalskrivanek
Copy link
Member

LGTM

@michalskrivanek michalskrivanek merged commit f946e11 into oVirt:master Apr 26, 2022
@mz-pdm mz-pdm deleted the uefi-many-vcpus branch May 3, 2022 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants