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

Add support to differentiate specific hypervisors on s390x #2037

Open
routerhan opened this issue Jan 29, 2025 · 4 comments · May be fixed by #2055
Open

Add support to differentiate specific hypervisors on s390x #2037

routerhan opened this issue Jan 29, 2025 · 4 comments · May be fixed by #2055
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@routerhan
Copy link

What would you like to be added:

Add support to differentiate hypervisors on s390x nodes. While the existing HYPERVISOR label works for KVM, it does not identify z/VM as virtual machine. Using tools like lscpu, this feature would add finer-grained labels for hypervisors such as z/VM and PR/SM (LPAR).

lscpu ouput for z/VM:

# lscpu
[...]
Virtualization features:
  Hypervisor:             z/VM 7.2.0
  Hypervisor vendor:      IBM
  Virtualization type:    full
[...]

# lscpu --json | \
  jq -r '.lscpu[] | select(.field == "Hypervisor:") | .data'
z/VM 7.2.0

Why is this needed:

The current HYPERVISOR label is insufficient for s390x nodes, as it only identifies KVM. Differentiating z/VM and LPAR is essential for accurate workload scheduling and operational requirements in s390x environments.

@routerhan routerhan added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 29, 2025
@marquiz
Copy link
Contributor

marquiz commented Jan 30, 2025

@routerhan thank you for the suggestion. We can't use lscpu in nfd.

On X86 that we'd get the information from the cpuid library (just missing the label in nfd):
https://github.com/klauspost/cpuid/blob/78c3c03144afe88fbedab38757e27cb1537a3418/cpuid.go#L314

Would you be willing to contribute this feature? IIRC the cpuid library does not have s390 features (yet), so (if you're not willing to contribute to cpuid) we could add the s390 support directly to nfd. Ref:
https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/source/cpu/cpuid_linux_s390x.go

@routerhan
Copy link
Author

@routerhan thank you for the suggestion. We can't use lscpu in nfd.

On X86 that we'd get the information from the cpuid library (just missing the label in nfd): https://github.com/klauspost/cpuid/blob/78c3c03144afe88fbedab38757e27cb1537a3418/cpuid.go#L314

Would you be willing to contribute this feature? IIRC the cpuid library does not have s390 features (yet), so (if you're not willing to contribute to cpuid) we could add the s390 support directly to nfd. Ref: https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/source/cpu/cpuid_linux_s390x.go

@marquiz Thank you for the reply!

We would like to confirm whether cpuid-code inside NFD is the right place for this extension. The reason for our hesitation is that cpuid primarily parses CPU flags, whereas our feature requires extracting hypervisor details from another source (e.g. from file /proc/sysinfo).

Would adding this support directly into NFD ( cpuid_linux_s390x.go) be an acceptable extension, or should we consider another approach when we decide to do it with NFD?

@marquiz
Copy link
Contributor

marquiz commented Feb 6, 2025

We would like to confirm whether cpuid-code inside NFD is the right place for this extension. The reason for our hesitation is that cpuid primarily parses CPU flags, whereas our feature requires extracting hypervisor details from another source (e.g. from file /proc/sysinfo).

I'd add it under source/cpu package, possible under cpuid or the model features. I think we can iterate this also in the PR, moving it around shouldn't be a big effort.

Would adding this support directly into NFD ( cpuid_linux_s390x.go) be an acceptable extension, or should we consider another approach when we decide to do it with NFD?

I think we can definitely add this information to NFD. We just need to think a bit how to make it well-matched between architectures, so that e.g. kvm would look the same accross archs.

@routerhan
Copy link
Author

@marquiz I created a PR for fetching s390x hypervisor information, I put it under cpuid.
Here is the PR #2055 , would you please review it and give me some feedbacks? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants