2014-06-25

disable memory balloning

http://dbakevin.blogspot.ro/2014/05/database-memory-exhausted-caused-by.html

Explanation for vmmemctl.sys:
Memory ballooning function is not related to shared/reserved setting in vmware properties.
Memory ballooning is handled through a driver (vmmemctl.sys) that is installed as part of the VMware Tools.
This driver is loaded in the guest OS to interact with the VMkernel and is leveraged to reclaim memory pages when ESX memory resources are in demand and available physical pages cannot meet. requirements.
When memory demands rise on the ESX host, the VMkernel will instruct the balloon driver to "inflate" and consume memory in the running guest OS,
forcing the guest operating system to leverage its own native memory management techniques to handle changing conditions.
Free pages are typically released first, but the guest OS may decide to page some memory out to its pagefile on the virtual disk.
The reclaimed memory is then used by ESX to satisfy memory demands of other running workloads, but will be relinquished back to the guest OS when memory demands decrease by "deflating" the balloon driver.
Balloon driver activity can be viewed either through VirtualCenter performance monitoring graphs or ESXTOP on the local host.



From the explanation, it is clear now that during issue period, memory exhausted on ESX global server, hence it grabs memory from guest OS namely our DB server. 



Below are the steps to check the ballooning from ESX host:
a. Run esxtop.
b. Type m for memory
c. Type f for fields
d. Select the letter J for Memory Ballooning Statistics (MCTL)
e. Look at the MCTLSZ value.
MCTLSZ (MB) displays the amount of guest physical memory reclaimed by the balloon driver.

Below are steps to disable memory balloon:
Disabling ballooning via the vSphere Client
To set the maximum balloon size to zero:
1. Using the vSphere Client, connect to the vCenter Server or the ESXi/ESX host where the virtual machine resides.
2. Log into the ESXi/ESX host as a user with administrative rights.
3. Shut down the virtual machine.
4. Right-click the virtual machine listed on the Inventory panel and click Edit Settings.
5. Click the Options tab, then under Advanced, click General.
6. Click Configuration Parameters.
7. Click Add row and add the parameter sched.mem.maxmemctl in the text box.
8. Click on the row next to it and add 0 in the text box.
9. Click OK to save changes.
To re-enable the balloon driver in a virtual machine:
1. Using the vSphere Client, connect to the vCenter Server or the ESXi/ESX host where the virtual machine resides.
2. Shut down the virtual machine if it is powered on.
3. SSH to the ESXi/ESX host. For more information, see Connecting to an ESX host using an SSH client (1019852).
4. Change directory to the datastore where the virtual machine's configuration file resides.
5. Back up the virtual machine's configuration file.
6. Edit the virtual machine's configuration file (virtual_machine_name.vmx) and remove this entry:
sched.mem.maxmemctl = "0"
7. Save and close the file.
8. Power on the virtual machine.
Note: You cannot remove the entry via the Configuration Parameters UI once it has been added. You must edit the configuration file (.vmx) for the virtual machine to remove the entry.
-------------------------------------------------------
Disabling ballooning via the Windows registry
To disable ballooning on the virtual machine:
Note: This procedure modifies the Windows registry. Before making any registry modifications, ensure that you have a current and valid backup of the registry and the virtual machine. For more information on backing up and restoring the registry, see the Microsoft Knowledge Base article 136393.
1. Log into the guest OS.
2. Click Start > Run, type regedit, and press Enter. The Registry Editor window opens.
3. Navigate to:
\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\VMMEMCTL
4. Change the Start key from 2 to 4.
5. Save the setting and restart the guest OS.
-------------------------------------------------------
Disabling ballooning via VMware Tools uninstallation/reinstallation
1. Uninstall VMware Tools from the guest OS.
2. Reinstall VMware Tools using the Custom Settings option, and deselect the Memory Control Drivers.

Niciun comentariu:

Trimiteți un comentariu