-
Notifications
You must be signed in to change notification settings - Fork 13
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 device capability HVTypeKubevirt to message OptionalCapabilities #34
Add device capability HVTypeKubevirt to message OptionalCapabilities #34
Conversation
zedi-pramodh
commented
Nov 22, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message your are extending says "// Information about hardware capabilities of node" and these are software/API capabilities.
There is an api_capability field which is what you want to extend here.
Since that is a cumulative number (see associated comments) there is no utility in filling in things we've already implemented and deployed. So just adding one about kubevirt should be sufficient.
We cannot use api_capability IMO. That's a hardcoded value and will be used for kvm based eve too ! |
@zedi-pramodh I agree with Erik on this. What you describe here is Software capability of specific hypervisor. So it would be confusing to developers if we have software capability in hardware capabilities. Moreover, this field will depend on EVE version which makes backward compatibility trickier. |
We can make it report different api_capabilities based on eve-hytype. However, when we introduce the next api capability we will end up with holes on the sequence with some implement "next" + kubevirt + current set, and others implementing "next" + current set. But if we want to have EVE agents which implement a small subset of the API down the road then an opt in might be more clear? In any case, we don't need to solve that until we need to add the next api capability after this. |
@naiming-zededa @milan-zededa please provide your inputs too. |
I think Erik's suggestion on temporary solution for kubevirt is fine with me. Basically we add 'kubevirt' to the end of the this api-capability enum. Only kubevirt eve software set this, kvm will just use 'kubevirt' - 1 number. If later we want to add one more capability in the future, we need to redesign this to a map structure for api-capability, but that is for later to handle properly in a separate effort. current APICapability 'Snapshot' uses 5, maybe Kubevirt can be added as '10', so later on new capability if is only related to EVE version support, can still use number 6-9 (kubevirt also needs to add 11-14 definitions), thus further kicking the can down the road :-) |
IMHO this is neither HW nor SW capability, rather a field informing about which EVE OS variant is running on a given device. Therefore, it might make sense to add (more generic) Hypervisor enum into ZInfoDevice, perhaps under a new OSInfo structure (or into existing ZInfoDevSW)? |
FWIW that wouldn't work since we'd be making the statement that the kubevirt image we ship today would support all the (undefined) capabilities with APICapability < 10. |
Good point. If it is not about particular capabilities but effectively sending /run/eve-hv-type to the controller, then it would make sense to define that in the info message (maybe in the hwinfo since it doesn't change unless the device is rebooted). |
Current plan is to use this field to support native container deployments and as well as any storage/compute clustering related features. |
Should we leave this API-capability along since it's basically a software-version, and just adding another 'capability', say message OptionalCapability { bool HvTypeKubevirt = 1 } to start with, it seems cleaner. |
We can do that @naiming-zededa . Just that controller/UI need new code to process that new message. I am fine with whatever the decision is. |
it should be similar for controller/UI to check either something called 'apicapacity' or the 'optionalcapability' items, not much difference in this regard. |
Might want to name that in plural (OptionalCapabilities) since I assume the intent is to potentially add additional items here over time (even though we don't yet know what they might be.) |
'OptionalCapabilities' sounds good to me. yes, for sure it is meant to be later on adding more optional software capabilities to use |
I know. But apicapability code already exists in controller/UI hence adding additional capability does not require code changes at controller side. With this new message optional capabilities some change is required in controller. But that is fine, I will amend this commit. |
9036f86
to
7318195
Compare
Amended the commit |
proto/info/info.proto
Outdated
// all eve flavors. | ||
message OptionalCapabilities { | ||
// Virtualization type Kubevirt | ||
bool HVTypeKubevirt = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do this in lower_snake_case as yetus suggests?
protoc will make hv_type_kubevirt into HvTypeKubevirt in the golang definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, amended the commit
Add HVTypeKubevirt as an optional device capability Signed-off-by: Pramodh Pallapothu <[email protected]>
Signed-off-by: Pramodh Pallapothu <[email protected]>
7318195
to
10baf87
Compare
This is OK, although I still think that it might be useful to publish Hypervisor enum as part of device info. Plus
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We are not picking by eve image name. Its actually eve hypervisor type which we generate during build and save in /etc/eve-hv-type file. Kubevirt type of virtualization is also a capability of this device. But I do see your point that we are overriding a lot on just one virtualization type. Ideally we should have hierarchy under Kubevirt type, may instead of bool it should be a map. We should think about it. |