Skip to content

Use cpu_info instead of vcpus to get the number of vcpus#466

Merged
Sharpz7 merged 2 commits intoopenstack-exporter:mainfrom
drencrom:vcpus-patch
Sep 6, 2025
Merged

Use cpu_info instead of vcpus to get the number of vcpus#466
Sharpz7 merged 2 commits intoopenstack-exporter:mainfrom
drencrom:vcpus-patch

Conversation

@drencrom
Copy link
Copy Markdown
Contributor

The total number of VCPUs should be obtained from cpu_info instead of the vcpus field. This vcpus value changes if there are pinned, dedicated or shared CPUs configured in nova and, crucially, can be less than vcpus_used.

The cpu_info data may be empty in some openstack versions, so fallback to old method in that case.

@drencrom
Copy link
Copy Markdown
Contributor Author

Hi folks, can any of you take a look at this patch?

niedbalski
niedbalski previously approved these changes Jul 15, 2025
@drencrom
Copy link
Copy Markdown
Contributor Author

Hi, I changed the patch for a signed one as that is required for this project.

@drencrom
Copy link
Copy Markdown
Contributor Author

Hi @niedbalski Could you please review this commit again as I re-commited it with a signature?
Thanks!

Copy link
Copy Markdown

@nicolasbock nicolasbock left a comment

Choose a reason for hiding this comment

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

LGTM

@Sharpz7 Sharpz7 added the priority Priority PR or Issue to help with tracking. label Sep 2, 2025
Sharpz7
Sharpz7 previously approved these changes Sep 2, 2025
@Sharpz7
Copy link
Copy Markdown
Collaborator

Sharpz7 commented Sep 3, 2025

@drencrom hmm. There still seems to be an unverified commit. Let me know if you need a hand :)

The total number of VCPUs should be obtained from CPUInfo instead
of the VCPUs column of hypervisor list. This value changes if there
are pinned, dedicated or shared CPUs configured in nova.

The CPUInfo data may be empty in some openstack versions, so
fallback to old method in that case.

Signed-off-by: Jorge Merlino <jorge.merlino@canonical.com>
@drencrom drencrom force-pushed the vcpus-patch branch 3 times, most recently from 309e44b to 3800483 Compare September 3, 2025 15:03
@drencrom
Copy link
Copy Markdown
Contributor Author

drencrom commented Sep 3, 2025

Hi @Sharpz7 Please check if it ok now.

@niedbalski
Copy link
Copy Markdown
Member

I am +1 to merge this one.

Copy link
Copy Markdown

@nicolasbock nicolasbock left a comment

Choose a reason for hiding this comment

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

LGTM

@Sharpz7 Sharpz7 merged commit fd5ffd2 into openstack-exporter:main Sep 6, 2025
6 checks passed
@Sharpz7 Sharpz7 mentioned this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority Priority PR or Issue to help with tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants