vladimirpetrov commented on PR #6809:
URL: https://github.com/apache/cloudstack/pull/6809#issuecomment-1815472396

   The situation is exactly the same as I commented on Jan 23, changing the 
global setting works properly (updating the database and agent.properties 
files) but the reset functionality (reset configuration) resets only the global 
setting, not the database and agent.properties files.
   
   The intial value is 1024:
   ```
   (localcloud) 🐱 > list configurations name=host.reserved.mem.mb
   {
     "configuration": [
       {
         "category": "Advanced",
         "component": "ConfigurationManagerImpl",
         "defaultvalue": "1024",
         "description": "Set an upper limit for memory in megabytes which will 
be reserved for host and not used for VM allocation.",
         "displaytext": "Host reserved mem mb",
         "group": "Hypervisor",
         "isdynamic": true,
         "name": "host.reserved.mem.mb",
         "subgroup": "Hypervisor",
         "type": "Number",
         "value": "1024"
       }
     ],
     "count": 1
   }
   ```
   We change it to 2048:
   ```
   (localcloud) 🐱 > update configuration name=host.reserved.mem.mb value=2048
   {
     "configuration": {
       "category": "Advanced",
       "component": "ConfigurationManagerImpl",
       "defaultvalue": "1024",
       "description": "Set an upper limit for memory in megabytes which will be 
reserved for host and not used for VM allocation.",
       "displaytext": "Host reserved mem mb",
       "group": "Hypervisor",
       "isdynamic": true,
       "name": "host.reserved.mem.mb",
       "subgroup": "Hypervisor",
       "type": "Number",
       "value": "2048"
     }
   ```
   
   The database is properly set:
   ```
   mysql> select dom0_memory,ram from host where type="Routing" and removed is 
null\G
   *************************** 1. row ***************************
   dom0_memory: 2147483648
           ram: 6154563584
   *************************** 2. row ***************************
   dom0_memory: 2147483648
           ram: 6154563584
   2 rows in set (0.00 sec)
   ```
   
   and the agent.properties files:
   ```
   # cat /etc/cloudstack/agent/agent.properties | grep reserved
   host.reserved.mem.mb=2048
   ```
   
   Now we reset the global configuration parameter:
   ```
   (localcloud) 🐱 > reset configuration name=host.reserved.mem.mb
   {
     "configuration": {
       "category": "Advanced",
       "component": "ConfigurationManagerImpl",
       "defaultvalue": "1024",
       "description": "Set an upper limit for memory in megabytes which will be 
reserved for host and not used for VM allocation.",
       "displaytext": "Host reserved mem mb",
       "group": "Hypervisor",
       "isdynamic": true,
       "name": "host.reserved.mem.mb",
       "subgroup": "Hypervisor",
       "type": "Number",
       "value": "1024"
     }
   }
   ```
   
   It properly shows the original value (1024). The database is not updated 
though:
   ```
   mysql> select dom0_memory,ram from host where type="Routing" and removed is 
null\G
   *************************** 1. row ***************************
   dom0_memory: 2147483648
           ram: 6154563584
   *************************** 2. row ***************************
   dom0_memory: 2147483648
           ram: 6154563584
   2 rows in set (0.00 sec)
   ```
   
   and the agent.properties files are not updated too:
   ```
   # cat /etc/cloudstack/agent/agent.properties | grep reserved
   host.reserved.mem.mb=2048
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to