Storing VMs cheaply when you're not using them

What should I be worrying about?

It’s common when using cloud VMs for your research to leave them shut down for several months at a time while you’re in phases of your work that don’t involve heavy computation. In theory, a VM that is shut down isn’t incurring any cost…right?

Well, almost.

Even when shut down, you’re being charged for the VM’s hard drive (or “block storage”) . In general, block storage can run around $0.05 to $0.15 per GB per month (Azure/AWS/GCP). For a VM with a 256 GB hard disk, this means you’ll be spending on average $25/month to keep it around, even if you’re not using it.

What can I do about this?

  • If you’re not going to ever use a VM again, just delete it (rather than leaving it shut down).

  • If you want to retain the VM because it has valuable research data on it, consider moving the data off of the VM and into object storage (Azure/AWS/GCP), which can be an order of magnitude cheaper. After offloading your data, delete the VM.

  • If you want to retain the VM because of its installed software and configuration, you have a few options that vary based on cloud platform. In essence, they all involve making a full disk backup of the VM, storing that backup either in cloud object storage (as described above) or on your own non-cloud backup media, and then deleting the VM. When you want to use the VM again, you create a new one using the backed up snapshot of the previous VM’s hard drive as a “template”.

    • On AWS, VM snapshots that can be used as templates for future VMs are called AMIs. Here is a guide for doing so: [link].

    • On Azure, VM snapshots are referred to as VHD files. There are guides for exporting VMs to VHDs either on Azure cloud storage [link] or for downloading off of the cloud [link]. Instructions for the reverse process, importing a VHD to a VM, can be found here [link]

    • On GCP, VM snapshots are referred to as images. Their documentation includes guides for exporting [link] and importing [link].

Hmm, ok. What if I make a mistake or am unsure about this stuff?

As always, you can contact CloudBank support for advice and consultation on this process. We heartily encourage you to look into storing VMs in object storage or on-premise if you’re not using them, and are always happy to help!