The present disclosure relates to cloud computing, and more specifically, to self-terminating and/or self-shelving virtual machines and workloads in a cloud computing environment.
A virtual machine (VM) may be hosted by a hypervisor which, in a cloud computing environment, is managed by a cloud server. Conventionally, in order for a cloud user to delete or shelve the VM, the user must log into the cloud server and issue a delete or shelve request that targets the specific VM. The shelving of a virtual machine includes capturing the virtual machine's disk state (and optionally its memory state) and removing the virtual machine definition to free the compute, memory, network, and similar resources being consumed. Shelving is used in some cases in places of deleting, such as when the virtual machine or its workload may not be needed for some amount of time, and unshelving is faster than rebuilding the VM, reinstalling its software, reconfiguring its networking, etc.
However, the conventionally available solutions require the user to navigate to the cloud server user interface, locate the correct VM, and then issue the delete or shelve request. This becomes tedious and error prone in a large environment with multiple cloud servers, often causing the VM or workload to not be promptly deleted or shelved, failing to free valuable system resources.
Another conventional solution provides workloads and VMs that may auto-delete or auto-shelve after a given period of time (i.e., time-out). The drawback of this conventional solution is that it encourages a user to not manually remove VMs once they no longer need them, wasting resources until the VM or workload eventually times out.