I’ve seen quite a lot insufficient CVM memory alerts, this could be caused since our production has grown, our applications demand more recourses and so on, increasing our CVM’s memory is very easy and simple and also Nutanix has a KB found here where you can safely change your CVM’s memory and fix this issue. ( I don’t like calling it an issue but most of the people do)

But since we are adventurous we are going to increase our CVM’s memory by running a script, this is a very simple script were We will be changing CVMs memory from 24GB to 32Gb

 

Before the script

 

Important: This script needs to be executed on all AHV hosts

Instruction:

  1. Log into the AHV via SSH.
  2. Create a new file called change-memory.sh
  3. Provide executable permissions. # chmod +x change-memory.sh
  4. Run the script. #./change-memory.sh

Was it hard? do not worry let me be more specific for you.

Detailed instructions:

  • Copy the change-memory.sh script found above.
  • Log in the AHV host where the CVM is running via SSH using e.g. putty
  • Create a file called change-memory.sh and paste the script into the file:

press i (to insert text)
paste the script (putty e.g  Right Click)

  • Change the Memory configuration by going to the RAM line 7 :

type the new amount of RAM e.g RAM=32
save the script by pressing the below characters followed by enter:
😡

  • Make the script executable by running the following command:

Run the script by typing:

 

Log into PRISM and verify your new CVM’s Memory

After running the script:

 

And We’ve been talking about the script, script, script, and where is it? don’t stress out, here is the magic script.

or you can download it on here, change the .txt extension to .sh, (do not forget the permissions)

Keep in mind that your CVM will reboot in order to apply the changes.

DO NOT do this on all of your hosts if you are not in a maintenance window.

Hope this was very helpful for you guys,

Regards,

 

Thanks to @magander3 for creating that incredible script, Thanks Magnus!