How to shelve/unshelve your virtual machine?
If you are not using your VM for a while, or want to turn it off say for a night, you can use Shelve option instead of Pause, Suspend or Shutoff.
Lets look at all this options:
The pause command stores the state of the VM in RAM. A paused instance becomes frozen.
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.
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 machine reserves same computing resources on compute nodes.
Shelving an instance means to put aside your instance along with its resources (can be volume) and later if you unshelve it you get the same instance you have shelved earlier.
Unshelve is the reverse operation of Shelve. It builds and boots the server again, on a new scheduled host if it was offloaded, using the shelved image in the glance repository if booted from image.
Each shelving process creates a new snapshot that is stored and billed in your domain. When VM is created with option "Create New Volume", a snapshot will not be created, only the ram and cpu will be freed, nevertheless the volume will be normally charged.
Every shelving operation creates an additional image that is stored and billed, Unshelving will not automatically remove this image, so you will have to do it manually
It is important to remember, that from the billing point of view "Paused", "Suspended" and "Shut Off" states are billed the same way (RAM and storage), yet the option that frees RAM and CPU resouces and is only billed for the storage (SSD) is the Shelve option.
How to Shelve the VM:
Go to Instances in Horizon, then choose "Shelve Instance" option from the drop down menu:
The Shelving may take several minutes you will most likely see something like this:
Finaly it will go to „Shelved Oflloaded” state:You can leave it in this state and it will save your billing costs.
To boot your VM again simply go to Instances menu and choose „Unshelve” option:
And when its completed it will go back to „Running” state:
If you want to check the status, power or billing of an instance, it is worth having a look: https://creodias.eu/-/status-power-state-and-dependences-in-billing-of-an-instances-vms-