How to Shelve or Unshelve a VM?

../_images/button_orange_cf23.png

If you are not using your VM for a while you can use one of the following options:

Pause Instance:

The pause command stores the state of the VM in RAM. A paused instance becomes frozen.

Suspend Instance:

When you suspend an instance

  • its VM state is stored on disk,

  • all memory is written to disk, and

  • the virtual machine is stopped.

Suspending an instance is similar to placing a device in hibernation; memory and vCPUs become available to create other instances. But it is still counted in RAM quota, even though the RAM is released so that it can be used by other projects, for example. Resume will put the suspended server back to an active state.

Shut Off Instance:

The virtual machine is not running and is in a powered-off state. However, a shut off virtual machine still consumes billing units in the same way as an active virtual machine. This is because active/powered off virtual machines reserve the same computing resources on compute nodes.

Shelve Instance:

Shelving an instance means to put aside your instance along with its resources (e.g. Volumes) and later if you unshelve it you get the same instance you have shelved earlier. Each shelving process creates a new snapshot that is stored and billed in your domain. Unshelve is the reverse operation of Shelve. It builds and boots the server again. Unshelving will not automatically remove this image, so you will have to do it manually!

From the billing point of view “Paused”, “Suspended” and “Shut Off” states are billed the same way as a running VM (CPU, RAM and storage). The only option that frees RAM and CPU resources and is only billed for the storage (SSD) is the Shelve option.

How to Shelve the VM

Go to “Instances” in OpenStack Horizon, then choose “Shelve Instance” from the drop-down menu:

../_images/shelveunshelve1.png

The shelving may take several minutes. You will most likely see something like this:

../_images/shelveunshelve2.png

Finally, the state will change to “Shelved Offloaded”: You can leave it in this state and it will save your billing costs.

../_images/shelveunshelve3.png

To boot your VM again simply go to “Instances” and choose “Unshelve”:

../_images/shelveunshelve4.png

Again, it may take several minutes, while you will see the progress of booting:

../_images/shelveunshelve5.png

When it is completed it will change back to “Running”:

../_images/shelveunshelve6.png