1. A computer-readable storage medium encoded with instructions, wherein the instructions when executed comprise: if an estimated time to perform a task by a first virtual machine is less than or equal to an expiration time of the first virtual machine minus a current time, performing the task by the first virtual machine; and if the estimated time to perform the task by the first virtual machine is greater than the expiration time of the first virtual machine minus the current time and an extension of the expiration time of the first virtual machine is allowed, changing the expiration time of the first virtual machine.