Nutanix CE : How to reduce the CVM memory
Background
Most of the time when deploying Nutanix CE, the hardware is limited because you need to save costs. Then, maximum RAM is limited - like in the Intel NUC who can only support up to 32 GB. By default, the CVM are configured with 16 GB RAM, therefore this is giving less RAM for creating VMs. If you are not using advanced features like dedup on the flight or erasure coding, you can decrease the CVM memory to 8 GB without any impact on the cluster. This is what this guide is all about.
First, logon to the host on which you want to reduce the CVM memory and issue the following command :
# virsh list --all
Id Name State
----------------------------------------------------
1 NTNX-010422a0-A-CVM running
Id Name State
----------------------------------------------------
1 NTNX-010422a0-A-CVM running
This is showing the CVM name. Next we can change the memory details. First, switch off the CVM to change the details and then apply the change with the below commands :
# virsh shutdown NTNX-010422a0-A-CVM
Domain NTNX-010422a0-A-CVM is being shutdown
# virsh list --all
Id Name State
----------------------------------------------------
- NTNX-010422a0-A-CVM shut off
# virsh setmem NTNX-010422a0-A-CVM 8G --config
# virsh setmaxmem NTNX-010422a0-A-CVM 8G --config
Domain NTNX-010422a0-A-CVM is being shutdown
# virsh list --all
Id Name State
----------------------------------------------------
- NTNX-010422a0-A-CVM shut off
# virsh setmaxmem NTNX-010422a0-A-CVM 8G --config
Next, you can restart the CVM and display the parameters to confirm it has been applied :
# virsh start NTNX-010422a0-A-CVM
Domain NTNX-010422a0-A-CVM started
# virsh dominfo NTNX-010422a0-A-CVM
Id: 2
Name: NTNX-010422a0-A-CVM
UUID: 0d06d7d5-b0ac-4a69-aa6c-8f7b210a19cd
OS Type: hvm
State: running
CPU(s): 8
CPU time: 17.2s
Max memory: 8388608 KiB
Used memory: 8388608 KiB
Persistent: yes
Autostart: enable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c65,c703 (permissive)
Domain NTNX-010422a0-A-CVM started
# virsh dominfo NTNX-010422a0-A-CVM
Id: 2
Name: NTNX-010422a0-A-CVM
UUID: 0d06d7d5-b0ac-4a69-aa6c-8f7b210a19cd
OS Type: hvm
State: running
CPU(s): 8
CPU time: 17.2s
Max memory: 8388608 KiB
Used memory: 8388608 KiB
Persistent: yes
Autostart: enable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c65,c703 (permissive)
Now, the CVM is consuming 8GB on your host. You can do the same on every host in the cluster.
Super, I was able to downgrade my nodes ram capacity following the steps above. Thank you so much.
ReplyDelete