-
Notifications
You must be signed in to change notification settings - Fork 72
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
Display error message for total VCPU values which can't be factored #1489
Display error message for total VCPU values which can't be factored #1489
Conversation
ca985d8
to
371a71c
Compare
1695c68
to
12815d1
Compare
719270f
to
c2287e1
Compare
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.
Functionally looks good. A few code style and a few prop type issues that need to be resolved.
c2287e1
to
590e197
Compare
df83c63
to
8941c98
Compare
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.
Please check the following 2 issues:
issue 1) Regarding the validation of cpus topology:
Can you please explain how do we get to this scenario in 1st place?
On webadmin for example, once selecting total vcpus to be 241, the topology is auto selected to V, C, T of: 1, 241, 1 and can't be changed since there are no options for changing it. Why letting the user with options that we already know that are non valid?
Another example is that for setting total cpus to be 340 for example, the user can select the following:
while on webadmin it is blocked since the options are more limited since cores num started from 17:
In addition, this PR doesn't cover all cases anyways since few are still verified and fail on backend:
Bottom line is that I don't think we need to cover all cases and it's ok to fail on backend. The important thing is to avoid creating a VM with one vcpu due to invalid architecture. I think we need to prefer backend failures as much as possible and just filter invalid options in advance where possible instead of current solution of displaying errors on ui for part of bad topology selection. The only important thing is to avoid creating a VM in that case. We just need to filter those options out within the selection box values.
The current solution causes strange behaviors.
issue 2: I remember we raised this in the past and it's not solved by this PR and I'm still not sure if solved by pr 1491 as well (if it is solved then please ignore this):
when manually entering a total vcpu value (not necessarily the upper limit value), the cpu arch is sometimes auto set to invalid values.
For example, set the "total vcpus" to 33 and then remove one digit to leave only 3 value and the following error appears:
As discussed, this is reproduced only for create VM and not for edit VM and seems related to the UI fields input manipulation. <-- fixed by PR 1491 so not relevant anymore.
@sgratch, because this requires dealing with all the possible combinations of the numbers of sockets, cores, threads, together with dealing with their maximum values, in advance. This PR is not about implementing this functionality. Not sure how this is implemented in webadmin but I consider it as non trivial. In this PR, a simple check is added and error message for invalid values of total VCPUs or VCPU topology is displayed.
Yeah, that makes sense. It is because the user has chosen a value from some drop down (number of cores in this case) which is not valid according to other chosen values. The user should pick another value from some drop down or to choose a different value as the number of total VCPUs. This is why the drop downs and the Total VCPUs field have the red border.
This is solved by disabling Next button in the wizard, for invalid values. Also this PR does some job.
I asked before starting working on this issue about possible solutions of some situations and more of us suggested to add some error message, to make clear to the user why they cannot choose some values. By simply filtering the values user will have no idea...
Hmm, I haven't found anything strange. Except that the error messages are not 100% clear, IMHO.
Yep, I was able to reproduce, but only sometimes. It appears after I press Enter a couple of times :D |
8941c98
to
e9d6949
Compare
@sgratch this is weird because I am pretty sure those values are not above the maximum values, in this example. I was able to reproduce, but it does not make sense. I suggest to create a separate issue for that. Not sure if it is the UI issue. You can see the maximum possible values of the number of sockets, cores, threads in the browser console in the picture below: |
e9d6949
to
7ad7971
Compare
I think the #1431 is about weird topology values according to the total VCPUs value, not about changing the user experience significantly. The user always could choose sockets, cores, threads randomly, not in any order, and the other values (other than actually changed value) were always changed according to the user's change and the number of total VCPUs.
I am not sure how I can achieve this here in the UI. First, the backend has to fail only when it should fail. Seems that for some cases this doesn't happen.
Yes, it seems this is the original design of the behavior. From my experience, it always worked like that. And when it turns to 1,1,1, it is because it is the only possible combination of values, according to their maximum. But unfortunately inconsistent with the total VCPUs value. And this was missing: some check if the product of those values = number of total VCPUs.
That's how the behavior is designed. After every change, the other values are changed, too, to respect maximum values and the number of total VCPUs. The number of sockets/threads change when changing the number of cores to 1. It seems it is not possible to set 1,1,whatever values, for 384 total VCPUs. We would have to have possibility to set 384 threads, but maximum is much less.
Yes, this IS the problem. Seems like it is not possible to reach some of the valid combinations. But this problem is different than we are dealing with in this PR and already present for a long time. It follows from the design. The same happens in the VM Details card. I prefer not to deal with too many different problems incl. UX stuff in one PR. I suggest to open a separate issue for that and to have a talk with the UX folks if we want to change how VCPU topology feature works. |
Based on your reply, please open a separate new issue for this inconsistency and gaps with setting the cpu architecture (with the example for setting S=1, C=3, T=3 for total vcpus=9 and maybe other examples raised here).
Based on your reply - do you mean that we can't fix this use case?:
So the error appears but the CPU topology marked in red is switched to a suggested other topology which is also wrong but different than the original user's entering values? |
@sgratch, I have only a few questions on this: How this would work? How and when the remaining values would be chosen after the user makes some choice? If ever. When the validation of those values would happen? It doesn't switch to a different values because of the error but because those values are the best possible values. Actually it works the way that as soon as the user chooses some value in the drop down, the other values are chosen according to the user's selected value, with respect to the maximum allowed values and to the total VCPU value. Then the validation of all the chosen values happens because sometimes it is not possible to choose the values that would meet all the required conditions. Such a validation was missing there. If we wanted the validation before the two remaining values are chosen (+ the chosen values would be fixed), the error would appear immediately and very often. Only after the user chooses the third value corresponding to the maximum values and the total VCPUs, the error would disappear. I consider this quite annoying. Or we can have validation of those values later, only after the user clicks on Save button. But I consider this as a step back as we can check the values immediately and to display the corresponding errors. This would be also inconsistent with some other already present checks there, for example checking the maximum allowed value of the total VCPUs. |
Let me summarize my concerns and suggestions: The main problem with our current topology calculations/validation logic s that it validates user input for vcpu=X and if not succeeded then:
So the backend is working correctly and the only problem that I can see is with this whole auto calculation for cpu topology. As a quick solution to make it less confusing till refactoring might be done, we can either:
This is easy to implement - if validateTopologyValues() returns false, display the error and just set the topology values to -1 for example |
@sjd78 Any thoughts about this? Thanks!
@sgratch I can't imagine avoiding those jumping/invalid re-calculations without canceling the whole auto calculation. But we can add another "jumping", by adding the condition you've already mentioned, after the validation. Those re-calculations happen before validation and it makes sense to me like that. |
e686f06
to
40076b8
Compare
If it's not easy to reset those fields after the validation failure since it will break the behavior when choosing invalid values in a row, then let's not invest more time on this now, merge this PR and open a follow up issue for the vCPU problems that were mentioned above. |
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, just suggest to rephrase the message.
A follow up issue was opened for open problems: #1503.
src/intl/messages.js
Outdated
@@ -120,6 +120,8 @@ export const messages: { [messageId: string]: MessageType } = { | |||
}, | |||
coresPerSockets: 'Cores per Virtual Socket', | |||
cpus: 'Total Virtual CPUs', | |||
cpusBadTopology: 'No valid CPU topology exists for this total Virtual CPUs count.', | |||
cpusBadTopologySelection: 'Selected vCPU topology is invalid.', |
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.
It was somehow hidden between all posts but as mentioned on #1489 (comment):
- Error handling for detected invalid CPU architecture:
If we decide to leave the current solution of displaying an error then please rephrase the error to:
"Selected CPU topology is invalid" (instead of vCPU)
Issue: oVirt#1431 Display an error message for VCPU values which cannot be factored properly for the VCPU topology (number of sockets, cores, threads).
Display an error message for incorrectly selected VCPU topology value (number of sockets, cores or threads), in the VM Details card.
Display an error message for VCPU values which cannot be factored properly for the VCPU topology. Also display an error message for incorrectly selected VCPU topology value from the drop down (number of sockets, cores or threads). Both in the CreateVMWizard.
…l VCPU Prevent from continuing in VM creation if the total VCPU value cannot be factored properly for the VCPU topology values. Same for the invalid VCPU topology values, regarding the value of the total VCPUs.
40076b8
to
83a58ed
Compare
83a58ed
to
d95b813
Compare
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
LGTM |
Fixes: #1431
This PR allows to dispaly error message
for:
TODO: (DONE)
Before:
VM Details card:
The next picture shows an example of one of the buggy scenarios in the VM Details where after setting value
241
as the number of total VCPUs, there can be only two options in the drop down for the number of cores. If the user chooses number1
in the drop down, the topology values become incorrect because of the limits of the sockets and cores don't allow to choose241
in the appropriate drop downs (same scenario reproducible also in the Create VM Wizard):Create VM Wizard:
After: