How to use local storage for CloudStack VMs

When CloudStack is deploying a VM (including guest VMs and system VMs), by default, the VM is set to use NFS-mounted primary storage as their root partition. The NFS-mounted primary storage is shared among all compute nodes located in the same CloudStack cluster. One of the reasons for using shared primary storage is VM migration. It is easy to migrate a VM from one compute node to another if the VM is backed by the same shared primary storage. If you don't need to migrate VMs, and compute nodes have plenty of local storage, you can configure CloudStack such that deployed VMs use compute node's local storage.

In order to use local storage for CloudStack VMs, log in to CloudStack's management interface as admin, and do the following.

Go to "Global Settings", and change the following attributes to "true":

  • system.vm.use.local.storage
  • use.local.storage

Note that these changes won't take effect until CloudStack's management server gets restarted. So make sure to restart CloudStack management server afterward:

$ sudo service cloud-management restart

Next, you must create a new Compute Offering which uses local storage for VM storage. To do so, go to "Service Offerings" in CloudStack's management interface, and choose "Compute Offerings". Then add a new Compute Offering with "Storage type" set to "Local".

Now when you deploy a new VM, you need to choose the Compute Offering that you just created, in order to use local storage.


Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of Xmodulo.com. He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

Leave a comment

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

Current ye@r *