Skip to content

Addressed issue #133#207

Merged
bpetit merged 1 commit intohubblo-org:devfrom
ISE-Sustainable-AI:vm_fix
Apr 17, 2023
Merged

Addressed issue #133#207
bpetit merged 1 commit intohubblo-org:devfrom
ISE-Sustainable-AI:vm_fix

Conversation

@tawalaya
Copy link
Copy Markdown
Contributor

Hello, while trying to use scaphandre with the qemu I encountered the issue #133. Looking into it a bit more, the reason behind this stems from the way qemu (at least for my setup) handles multi-core/multi-thread CPUs. In essence, instead of allowing you to set core or thread count for the virtual CPU, you add sockets to the VM; see this stack overflow discussion.

So to fix this I just fall back to the first socket found by the sensor and add all encountered cores to it. Sorry if the code is ugly, I'm new to rust. Anyway, with this fix, u can use the VM mode even for VM's with more vCores.

dealing with mismatching socket/core topolgoies in VM settings
@bpetit
Copy link
Copy Markdown
Contributor

bpetit commented Aug 19, 2022

Thanks a lot for this PR, I think the code to be changed is more in the qemu exporter itself : https://github.com/hubblo-org/scaphandre/blob/main/src/exporters/qemu.rs#L75

This code is too simple to handle multiple vcpu in the VM. It has to be changed.

I'll try to make something up for the release 0.6. In the mean time if you want to give it a try do not hesitate !

@bpetit bpetit added this to the Release v0.6.0 milestone Feb 15, 2023
@bpetit bpetit changed the base branch from main to dev April 17, 2023 08:50
bpetit added a commit that referenced this pull request Apr 17, 2023
@bpetit bpetit linked an issue Apr 17, 2023 that may be closed by this pull request
@bpetit
Copy link
Copy Markdown
Contributor

bpetit commented Apr 17, 2023

got it working on a 2 cores vm, I'll merge your work in this PR : #291
(needed some change as it targeted main at first, plus I changed the qemu exporter so needed to check everything fits)

thanks !

@bpetit bpetit merged commit 9cc39a3 into hubblo-org:dev Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Previous releases

Development

Successfully merging this pull request may close these issues.

Scaphandre does not work on VMs with more than one logical host CPU

2 participants