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 2020/11/18 10:27:21 UTC

[GitHub] [cloudstack] davidjumani opened a new pull request #4478: hostformigrationresponse: Setting memory allocated to long

davidjumani opened a new pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478


   ### Description
   
   Fixes https://github.com/apache/cloudstack/issues/4460
   
   ### 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
   - [ ] 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/master/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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4478: Adding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponse

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


   @DaanHoogland a Jenkins job has been kicked to build packages. 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.

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



[GitHub] [cloudstack] davidjumani commented on pull request #4478: Adding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponse

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-730870884


   @DaanHoogland @weizhouapache Added `memoryallocatedpercentage` & `memoryallocatedbytes` and deprecated `memoryallocated`


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] davidjumani commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-730344354


   > > > €0,02: we can add responce parameters that are alligned for both -precentages and -values and leave these alone alltogether. @weizhouapache @rhtyd @davidjumani ?
   > > 
   > > 
   > > @DaanHoogland good to me. and mark the cpuallocated and memoryallocated as deprecated ?
   > 
   > yes
   
   Sounds good! I'll make the changes


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] davidjumani commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-729630433


   @weizhouapache Is it fine that the memory is numeric but CPU is in percentage ? Or would it be better to have new `memoryallocaedpercentage` & `cpuallocaedpercentage`  fields ?


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] davidjumani commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-729597137


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

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


   @DaanHoogland 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.

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #4478: Adding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponse

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-731017784


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

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-729661072


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

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



[GitHub] [cloudstack] davidjumani commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-729626413


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

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



[GitHub] [cloudstack] weizhouapache commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

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


   > €0,02: we can add responce parameters that are alligned for both -precentages and -values and leave these alone alltogether. @weizhouapache @rhtyd @davidjumani ?
   
   @DaanHoogland good to me. and mark the cpuallocated and memoryallocated as deprecated ?
   


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] rhtyd commented on a change in pull request #4478: hostformigrationresponse: Setting memory allocated to long

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#discussion_r526484579



##########
File path: server/src/main/java/com/cloud/api/query/dao/HostJoinDaoImpl.java
##########
@@ -321,7 +321,7 @@ public HostForMigrationResponse newHostForMigrationResponse(HostJoinVO host, Enu
                 hostResponse.setMemoryTotal(host.getTotalMemory());
                 Float memWithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
                 hostResponse.setMemWithOverprovisioning(decimalFormat.format(memWithOverprovisioning));
-                hostResponse.setMemoryAllocated(decimalFormat.format((float) mem / memWithOverprovisioning * 100.0f) +"%");
+                hostResponse.setMemoryAllocated(mem);
 

Review comment:
       Will this cause regression? 




----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-730220681


   €0,02: we can add responce parameters that are alligned for both -precentages and -values and leave these alone alltogether. @weizhouapache @rhtyd @davidjumani ?


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

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


   Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2400


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4478: Adding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponse

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


   Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2413


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

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


   @davidjumani a Jenkins job has been kicked to build packages. 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.

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



[GitHub] [cloudstack] weizhouapache commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

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


   > @weizhouapache Is it fine that the memory is numeric but CPU is in percentage ? Or would it be better to have new `memoryallocaedpercentage` & `cpuallocaedpercentage` fields ?
   
   @davidjumani it would be better. but it might break backwards compatibility (hope few users will be impacted). 
   


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

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


   <b>Trillian test result (tid-3198)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 30749 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4478-t3198-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
   Smoke tests completed. 83 look OK, 0 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #4478: Adding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponse

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-731017648


   yes :+1: don't bother for now but I'm creating a ticket do implement the same for cpu #4488 


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] davidjumani commented on a change in pull request #4478: hostformigrationresponse: Setting memory allocated to long

Posted by GitBox <gi...@apache.org>.
davidjumani commented on a change in pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#discussion_r526615617



##########
File path: server/src/main/java/com/cloud/api/query/dao/HostJoinDaoImpl.java
##########
@@ -321,7 +321,7 @@ public HostForMigrationResponse newHostForMigrationResponse(HostJoinVO host, Enu
                 hostResponse.setMemoryTotal(host.getTotalMemory());
                 Float memWithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
                 hostResponse.setMemWithOverprovisioning(decimalFormat.format(memWithOverprovisioning));
-                hostResponse.setMemoryAllocated(decimalFormat.format((float) mem / memWithOverprovisioning * 100.0f) +"%");
+                hostResponse.setMemoryAllocated(mem);
 

Review comment:
       It will but we can introduce two new fields `memoryallocaedpercentage` & `cpuallocaedpercentage` to compensate.
   This will ensure that the response for both HostResponse and HostForMigrationResponse will be the same. Sounds good @rhtyd ?




----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #4478: Adding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponse

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-731084296


   I don't think we need smoke tests for this. restarted two of the travis runs


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] DaanHoogland merged pull request #4478: Adding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponse

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


   


----------------------------------------------------------------
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.

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



[GitHub] [cloudstack] DaanHoogland commented on pull request #4478: hostformigrationresponse: Setting memory allocated to long

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4478:
URL: https://github.com/apache/cloudstack/pull/4478#issuecomment-730225873


   > > €0,02: we can add responce parameters that are alligned for both -precentages and -values and leave these alone alltogether. @weizhouapache @rhtyd @davidjumani ?
   > 
   > @DaanHoogland good to me. and mark the cpuallocated and memoryallocated as deprecated ?
   
   yes


----------------------------------------------------------------
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.

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