You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2023/01/11 12:43:49 UTC

[GitHub] [cloudstack] weizhouapache opened a new pull request, #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

weizhouapache opened a new pull request, #7077:
URL: https://github.com/apache/cloudstack/pull/7077

   
   ### Description
   
   This PR fixes #6780
   
   The issue can be reproduced by
   (1) create a unconstraint dynamic offering
   (2) deploy a vm and stop it
   (3) update vm settings
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [x] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   <!-- see how your change affects other areas of the code, etc. -->
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on code in PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#discussion_r1066981323


##########
engine/schema/src/main/java/com/cloud/service/ServiceOfferingVO.java:
##########
@@ -327,7 +327,7 @@ public void setDynamicFlag(boolean isdynamic) {
     }
 
     public boolean isCustomCpuSpeedSupported() {
-        return isCustomized() && getDetail("minCPU") != null;
+        return isCustomized() && getDetail("minCPU") == null;

Review Comment:
   good, thanks @shwstppr 
   committed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on code in PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#discussion_r1066973234


##########
engine/schema/src/main/java/com/cloud/service/ServiceOfferingVO.java:
##########
@@ -327,7 +327,7 @@ public void setDynamicFlag(boolean isdynamic) {
     }
 
     public boolean isCustomCpuSpeedSupported() {
-        return isCustomized() && getDetail("minCPU") != null;
+        return isCustomized() && getDetail("minCPU") == null;

Review Comment:
   it seems strange that the minimun cpu speed *must* be null and also that there are no conditions on the maximum cpu speed. Do you why this works @weizhouapache ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr commented on a diff in pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
shwstppr commented on code in PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#discussion_r1066980168


##########
engine/schema/src/main/java/com/cloud/service/ServiceOfferingVO.java:
##########
@@ -327,7 +327,7 @@ public void setDynamicFlag(boolean isdynamic) {
     }
 
     public boolean isCustomCpuSpeedSupported() {
-        return isCustomized() && getDetail("minCPU") != null;
+        return isCustomized() && getDetail("minCPU") == null;

Review Comment:
   Not sure why I added it this way :facepalm: 
   @weizhouapache Could it be simply,
   ```suggestion
           return isCustomized() && speed == nulll;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#issuecomment-1379011435

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#issuecomment-1378812492

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 5236


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#issuecomment-1378741575

   @weizhouapache a 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#issuecomment-1378740392

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#issuecomment-1379012792

   @weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland merged pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
DaanHoogland merged PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on code in PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#discussion_r1066986020


##########
engine/schema/src/main/java/com/cloud/service/ServiceOfferingVO.java:
##########
@@ -327,7 +327,7 @@ public void setDynamicFlag(boolean isdynamic) {
     }
 
     public boolean isCustomCpuSpeedSupported() {
-        return isCustomized() && getDetail("minCPU") != null;
+        return isCustomized() && getDetail("minCPU") == null;

Review Comment:
   @DaanHoogland 
   there are two types of dynamic service offering
   (1) constraint: speed is fixed. there are max/min cpu and memory.
   (2) uncontraint: cpu/speed/memory are all dynamic.
   
   the `isCustomCpuSpeedSupported` should be true, if the offering is unconstraint (speed is not set).
   `getDetail("minCPU") != null` is a way to determine if the offering is uncontraint. `speed == null` is a better and simple way.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#issuecomment-1379763688

   <b>Trillian test result (tid-5800)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 40055 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7077-t5800-kvm-centos7.zip
   Smoke tests completed. 100 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 557.98 | test_kubernetes_clusters.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#issuecomment-1378764782

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=7077)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7077&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7077&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7077&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7077&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7077&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7077&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7077&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7077&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7077&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7077&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7077&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7077&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7077&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7077&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7077&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7077&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7077: server: fix cannot update vm if it uses unconstraint dynamic offering

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on code in PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#discussion_r1066981941


##########
engine/schema/src/main/java/com/cloud/service/ServiceOfferingVO.java:
##########
@@ -327,7 +327,7 @@ public void setDynamicFlag(boolean isdynamic) {
     }
 
     public boolean isCustomCpuSpeedSupported() {
-        return isCustomized() && getDetail("minCPU") != null;
+        return isCustomized() && getDetail("minCPU") == null;

Review Comment:
   @DaanHoogland 
   as suggested by @shwstppr , use `speed == null` instead, now it looks more clear



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] server: fix cannot update vm if it uses unconstraint dynamic offering [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#issuecomment-1882510381

   > Hello
   >  I got the same error message when try to change the instance setting, Is this issue resolved on v4.18?
   
   Yes, try with 4.18.0.0
   
   
   > our version is 4.17.2
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] server: fix cannot update vm if it uses unconstraint dynamic offering [cloudstack]

Posted by "meisammaleki (via GitHub)" <gi...@apache.org>.
meisammaleki commented on PR #7077:
URL: https://github.com/apache/cloudstack/pull/7077#issuecomment-1882437247

   Hello
    I got the same error message when try to change the instance setting, Is this issue resolved on v4.18?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org