ravening opened a new pull request #4259:
URL: https://github.com/apache/cloudstack/pull/4259
## Description
<!--- Describe your changes in detail -->
By default cloudstack reserves 1Gb of RAM in hosts
using _dom0_memory field. Add a global setting
"host.reserved.mem.mb" which can used to either
increase or decrese the amount of memory which can be reserved
## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the
boxes that apply: -->
- [X] Enhancement (improves an existing feature and functionality)
## 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. -->
Total capacity and RAM of each host before setting the global setting
```
mysql> select total_capacity,used_capacity from op_host_capacity where
capacity_type=0\G
*************************** 1. row ***************************
total_capacity: 7297130496
used_capacity: 6174015488
*************************** 2. row ***************************
total_capacity: 7297130496
used_capacity: 0
*************************** 3. row ***************************
total_capacity: 7297130496
used_capacity: 0
3 rows in set (0.00 sec)
mysql> select dom0_memory,ram from host where type="Routing" and removed is
null\G
*************************** 1. row ***************************
dom0_memory: 1073741824
ram: 7297130496
*************************** 2. row ***************************
dom0_memory: 1073741824
ram: 7297130496
*************************** 3. row ***************************
dom0_memory: 1073741824
ram: 7297130496
3 rows in set (0.01 sec)
```
setting global setting `host.reserved.mem.mb` to 4096
```
mysql> select total_capacity,used_capacity from op_host_capacity where
capacity_type=0\G
*************************** 1. row ***************************
total_capacity: 4075905024
used_capacity: 6174015488
*************************** 2. row ***************************
total_capacity: 4075905024
used_capacity: 0
*************************** 3. row ***************************
total_capacity: 4075905024
used_capacity: 0
3 rows in set (0.00 sec)
mysql> select dom0_memory,ram from host where type="Routing" and removed is
null\G
*************************** 1. row ***************************
dom0_memory: 4294967296
ram: 4075905024
*************************** 2. row ***************************
dom0_memory: 4294967296
ram: 4075905024
*************************** 3. row ***************************
dom0_memory: 4294967296
ram: 4075905024
3 rows in set (0.00 sec)
```
Corresponding entry in `agent.properties`
`host.reserved.mem.mb=4096`
<!-- 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:
[email protected]