Feb 28 2017

Change AHV Based Nutanix Controller Virtual Machine (CVM) RAM

A few days ago i changed Nutanix Controller Virtual Machine (CVM) Memory configuration for a customer. There is a Nutanix KB about this which can be found here here but since it includes manual steps i figure i create a script which you can run from the AHV host. This blog post is divided into the following sections:

  • Information – What I’m trying to achieve and important information that must not be ignored.
  • Procedure Overview – Includes the procedure and can be used for everyone with Linux skills.
  • Change CVM RAM Script – The actual script you can use to change CVM RAM.
  • Detailed Procedure – Includes the commands needed to create the script, make it executable and finally run the script.


Yes, you need to run the script on all AHV hosts.
The only thing you need to change in the below script to meet your needs is the amount of memory, called RAM and marked in red, you want to assign to our CVMs.
The customer wanted to go from 24 GB Memory per CVM to 32 GB Memory per CVM.



Important: In my case i was allowed to shut down the Nutanix Cluster before i made the changes and that mean i could run the script on all AHV hosts same time. If you can’t shut down the Nutanix Cluster you need to change Memory for one CVM at the time.
Before you start the change Memory process on any CVM, make sure PRISM shows OK in the “Data Resiliency Status” section in PRISM 


Procedure Overview

Follow the below procedure to change the CVM Memory.

  • Log in to the AHV host where the CVM is running via SSH
  • Create the change-memory.sh file with your required RAM configuration value and make the script executable.
  • Run the script

This is the output when running the script on one of my AHV hosts:


Log in to PRISM and verify the amount of Memory per CVM.


Change CVM RAM Script

This is the script you can use to change CVM RAM configuration.


This script has been tested on AOS 5.0 and AHV 20160925.30

Detailed Procedure Overview

  • Copy the change-memory.sh script above.
  • Log in the 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:
    • vi change-memory.sh (to start editor vi and create a new file)
    • press i (to insert text)
    • paste the script
    • change the Memory configuration by going to the RAM line and step out to the number 2 and then:
      • press cw
      • type the new amount of RAM
    • save the script by pressing the below characters followed by enter:
      • :wq!
  • Make the script executable by running the following command:
    • chmod 700 change-memory.sh
  • Run the script by typing:
    • ./change-memory


  1. Ryan

    Different path to same end. chmod +x change-memory.sh will add the executable bit.

    Thanks so much for this script.

  2. Brad

    nice script thanks!

  3. magander3

    glad you liked it.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">