api,server: allow updating hypervisor capabilities with hypervisor and version#8475
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #8475 +/- ##
============================================
+ Coverage 4.30% 14.95% +10.65%
- Complexity 0 11016 +11016
============================================
Files 363 5382 +5019
Lines 29312 470175 +440863
Branches 5118 60220 +55102
============================================
+ Hits 1261 70321 +69060
- Misses 27908 392065 +364157
- Partials 143 7789 +7646
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
server/src/main/java/com/cloud/server/ManagementServerImpl.java
Outdated
Show resolved
Hide resolved
|
Hi @shwstppr Is this PR targeted for 4.19.1? If so, please rebase and update target branch. |
version hypervisor and hypervisorversion parameter added to the updateHypervisorCapabilities API. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
9503ce3 to
308819c
Compare
|
@sureshanaparti done @blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9311 |
|
@blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 9882 |
|
@blueorangutan package |
|
@kiranchavala a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9900 |
JoaoJandre
left a comment
There was a problem hiding this comment.
CLGTM, did not test it
DaanHoogland
left a comment
There was a problem hiding this comment.
just one remark about the parameter description, looks good otherwise
...ain/java/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
Outdated
Show resolved
Hide resolved
Co-authored-by: dahn <daan.hoogland@gmail.com>
...ain/java/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
Outdated
Show resolved
Hide resolved
|
@kiranchavala added some tests I did with the API in the PR description |
server/src/main/java/com/cloud/server/ManagementServerImpl.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Henrique Sato <henriquesato2003@gmail.com>
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9980 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-10471) |
|
@blueorangutan test |
|
@vishesh92 a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-10544)
|
| } | ||
|
|
||
| hpvCapabilities = _hypervisorCapabilitiesDao.createForUpdate(id); | ||
| hpvCapabilities = _hypervisorCapabilitiesDao.createForUpdate(hpvCapabilities.getId()); |
There was a problem hiding this comment.
Need to set id = hpvCapabilities.getId().
id is being used in L5156 to update the hypervisor capabilities. If id is not passed in the request, update is not getting triggered if the value already exists because id is null. This is also resulting in not getting any output.
(localcloud) __ > update hypervisorcapabilities hypervisor=VMware hypervisorversion="8.0.0.15" maxdatavolumeslimit=640
__ Error: (HTTP 530, error code 9999) Failed to update hypervisor capabilities
Executing this for the first time creates an entry which is a duplicate of the parent hypervisor. And subsequent command just fails.
server/src/main/java/com/cloud/server/ManagementServerImpl.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Vishesh <vishesh92@gmail.com>
|
@blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
server/src/main/java/com/cloud/server/ManagementServerImpl.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
|
@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
vishesh92
left a comment
There was a problem hiding this comment.
code looks good to me.
Tested locally with Simulator. API is working as expected.
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10084 |
…d version (apache#8475) * api,server: allow updating hypervisor capabilities with hypervisor and version hypervisor and hypervisorversion parameter added to the updateHypervisorCapabilities API. * param description * Update server/src/main/java/com/cloud/server/ManagementServerImpl.java Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> Co-authored-by: dahn <daan.hoogland@gmail.com> Co-authored-by: Henrique Sato <henriquesato2003@gmail.com> Co-authored-by: Vishesh <vishesh92@gmail.com>
Description
hypervisorandhypervisorversionparameters are added to theupdateHypervisorCapabilitiesAPI.This would allow updating capabilities by specifying the hypervisor type and its version. This would also allow creating new hypervisor capabilities entries in the database when they doesn't exist for a given hypervisor version.
Related to #8412
New parameters as their description suggests are not meant to change the value of hypervisor and hypervisorversion of an existing capability. Rather they will be used to find the capabilities entry in the database and update other params such as maxdatavolumeslimit, maxguestslimit, maxhostspercluster, securitygroupenabled, storagemotionenabled, vmsnapshotenabled.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?