UI: allow new keys for VM details#7793
Conversation
|
@DaanHoogland does this mean, we now allow empty values for the settings? |
Codecov Report
@@ Coverage Diff @@
## 4.18 #7793 +/- ##
=========================================
Coverage 13.02% 13.02%
Complexity 9030 9030
=========================================
Files 2720 2720
Lines 257001 257001
Branches 40083 40083
=========================================
Hits 33463 33463
Misses 219337 219337
Partials 4201 4201 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
@DaanHoogland actually when I add a vm setting "extraconfig", it failed in the EditVM dialog, we need to add a new field "extraconfig" |
good question. If the API accepts it we do, i guess. |
There was a problem hiding this comment.
what I observed with this fix is
-
We are not allowing empty values even after the fix. The observed fix is, we are now handling this properly in UI without any errors in the debugger console. In my opinion, this is good.

-
We could now add extra custom details which are not predefined. Not sure if this is the intention of this fix, but this is also good, there is another issue raised to allow custom keys #7700

-
Specific to the key value "extraconfig" mentioned in the original issue, intentionally we are not allowing it in the backend, not sure about the reason.
cloudstack/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
Lines 2772 to 2774 in 981d748
@DaanHoogland am I correct with these points ? specifically point 1, it is contradicting the subject
yes
yes, it is
functionally i am not sure, but the intention was to allow any key. I did not test with this particular string 🤕 .
I will change the subject. @weizhouapache @rohityadavcloud @vishesh92 @nvazquez @MejdiB @Arceoavs, what do and do we not want to allow? |
|
Hi @DaanHoogland @harikrishna-patnala, I think the reason the 'extraconfig' key is not allowed is because it is a parameter on the deployVirtualMachine API. In case the user passes extra config, those are persisted as VM details with the key 'extraconfig' which can cause issues |
|
I saw there is an extra parameter for this updateVirtualMachine API which is "extraconfig". From UI, we are using "details" parameters through which extraconfig key is blocked. This is causing the actual issue. If we use the separate parameter "extraconfig" in the API then the value will be saved based on the global settings "enable.additional.vm.configuration". So I think what we can do here is (if at all we decide to allow extraconfig from UI) to check if the detail key is "extraconfig" and then send the value in API parameter "extraconfig" (not the "details"). |
this looks like a good solution. @harikrishna-patnala @DaanHoogland |
|
The 'extraconfig' parameter was introduced by this feature: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Enable+additional+configuration+metadata+to+virtual+machines. It lacks UI support, so was only possible to set it in the API. I think that it can be a good partial solution as the way the extra config is stored on the vm_details table is using either named keys such as: extraconfig-NAME1, extraconfig-NAME2 or numerical: extraconfig-1, extraconfig-2. So the updateVirtualMachine API may allow editing the first time but not the second time as the details will be split into multiple details with the extraconfig prefix (all this needs to be tested, I had tested it long ago :) ) |
thanks @nvazquez for the info it looks we need to investigate more on #6937 . sorry @DaanHoogland , I thought it is a simple bug fix |
@weizhouapache this PR can still be merged as this is fixing the other issue #7700 to allow custom keys, also this PR handles the errors that are coming in the debugger console. We can handle #6937 separately. |
|
ok @harikrishna-patnala ,thanks for pointing it out |
harikrishna-patnala
left a comment
There was a problem hiding this comment.
LGTM. I've verified the fix for the issue #7700
thanks @harikrishna-patnala . merging |
Description
This PR...
Fixes: #6937Fixes: #7700
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?