Automatically and dynamically reclaiming resources during virtual machine decommission
Embodiments of the present invention provide a method, computer program product, and computer system for reclaiming resources during virtual machine decommission. The method includes determining a virtual machine (VM) resource utilization and a cluster utilization. If the VM resource utilization is less than a first predetermined threshold and the cluster utilization is greater than a second predetermined threshold, the method then determines whether an active timer exists. If the active timer exists and has expired, then dynamic decommission of the VM is triggered.
1. A method for reclaiming resources during virtual machine decommission, the method comprising:
receiving, by one or more computer processors, information regarding resource utilization of a virtual machine (VM);
determining, by one or more computer processors, whether the resource utilization of the VM is less than a first predetermined threshold;
determining, by one or more computer processors, whether a cluster utilization of the VM is greater than a second predetermined threshold;
determining, by one or more computer processors, whether a timer is active;
in response to determining that the timer is active, determining, by one or more computer processors, whether the timer has expired;
in response to determining that the timer has expired, determining, by one or more computer processors, at what time a dynamic decommission of the VM may occur, based, at least in part, on a VM resource utilization information finding; and
in response to the determined time the dynamic decommission of the VM can occur, triggering, by one or more computer processors, a dynamic decommission of the VM.
2. The method of claim 1 , further comprising:
determining, by one or more computer processors, that the resource utilization of the VM is not less than the first predetermined threshold; and
in response to determining that the timer is active, removing, by one or more computer processors, the timer.
3. The method of claim 1 , further comprising:
determining, by one or more computer processors, that the cluster utilization of the VM is not greater than the second predetermined threshold; and
in response to determining that the timer is active, removing, by one or more computer processors, the timer.
4. The method of claim 1 , further comprising:
in response to determining that the timer is not active, creating, by one or more computer processors, a new timer.
5. The method of claim 1 , wherein receiving information regarding resource utilization of a virtual machine (VM) comprises:
detecting, by one or more system resource monitors, a level of resource utilization of the VM; and
reporting, by one or more computer processors, the level of resource utilization of the VM to a resource manager.
6. The method of claim 5 , wherein the resource manager is configured to: release resources and determine whether the VM is a zombie.
7. The method of claim 1 , wherein triggering the dynamic decommission of the VM is initiated, in part, by the later in time of:
a system administrator, wherein the system administrator determines that no more applications (apps) will be distributed to the VM; and
an application (app) administrator, wherein the app administrator determines that a last app has finished running on the VM.
8. A computer program product comprising:
a computer readable storage medium and program instructions stored on the computer readable storage medium, the program instructions comprising:
program instructions to receive information regarding resource utilization of a virtual machine (VM);
program instructions to determine whether the resource utilization of the VM is less than a first predetermined threshold;
program instructions to determine whether a cluster utilization of the VM is greater than a second predetermined threshold;
program instructions to determine whether a timer is active;
program instructions to, in response to determining that the timer is active, determine whether the timer has expired;
in response to determining that the timer has expired, program instructions to determine at what time a dynamic decommission of the VM may occur, based, at least in part, on a VM resource utilization information finding; and
in response to the determined time the dynamic decommission of the VM can occur, program instructions to, in response to determining that the timer has expired, trigger a dynamic decommission of the VM.
9. The computer program product of claim 8 , further comprising:
program instructions to determine that the resource utilization of the VM is not less than the first predetermined threshold; and
program instructions to, in response to determining that the timer is active, remove the timer.
10. The computer program product of claim 8 , further comprising:
program instructions to determine that the cluster utilization of the VM is not greater than the second predetermined threshold; and
program instructions to, in response to determining that the timer is active, remove the timer.
11. The computer program product of claim 8 , further comprising:
program instructions to, in response to determining that the timer is not active, create a new timer.
12. The computer program product of claim 8 , wherein the program instructions to receive information regarding resource utilization of a virtual machine (VM) comprise:
program instructions to detect a level of resource utilization of the VM; and
program instructions to report the level of resource utilization of the VM to a resource manager.
13. The computer program product of claim 12 , wherein the resource manager is configured to: release resources and determine whether the VM is a zombie.
14. The computer program product of claim 8 , wherein the program instructions to trigger the dynamic decommission of the VM is initiated, in part, by the later in time of:
a system administrator, wherein the system administrator determines that no more applications (apps) will be distributed to the VM; and
an application (app) administrator, wherein the app administrator determines that a last app has finished running on the VM.
15. A computer system comprising:
one or more computer processors;
one or more computer readable storage media;
program instructions stored on the computer readable storage media for execution by at least one of the one or more computer processors, the program instructions comprising:
program instructions to receive information regarding resource utilization of a virtual machine (VM);
program instructions to determine whether the resource utilization of the VM is less than a first predetermined threshold;
program instructions to determine whether a cluster utilization of the VM is greater than a second predetermined threshold;
program instructions to determine whether a timer is active;
program instructions to, in response to determining that the timer is active, determine whether the timer has expired;
in response to determining that the timer has expired, program instructions to determine at what time a dynamic decommission of the VM may occur, based, at least in part, on a VM resource utilization information finding; and
in response to the determined time the dynamic decommission of the VM can occur, program instructions to, in response to determining that the timer has expired, trigger a dynamic decommission of the VM.
16. The computer system of claim 15 , further comprising:
program instructions to determine that the resource utilization of the VM is not less than the first predetermined threshold; and
program instructions to, in response to determining that the timer is active, remove the timer.
17. The computer system of claim 15 , further comprising:
program instructions to determine that the cluster utilization of the VM is not greater than the second predetermined threshold; and
program instructions to, in response to determining that the timer is active, remove the timer.
18. The computer system of claim 15 , further comprising:
program instructions to, in response to determining that the timer is not active, create a new timer.
19. The computer system of claim 15 , wherein the program instructions to receive information regarding resource utilization of a virtual machine (VM) comprise:
program instructions to detect a level of resource utilization of the VM; and
program instructions to report the level of resource utilization of the VM to a resource manager.
20. The computer system of claim 15 , wherein the program instructions to trigger the dynamic decommission of the VM is initiated, in part, by the later in time of:
a system administrator, wherein the system administrator determines that no more applications (apps) will be distributed to the VM; and
an application (app) administrator, wherein the app administrator determines that a last app has finished running on the VM.