# US 2023/0266987 A1 · Automatic shutdown of virtual machines

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0266987 A1
- Document ID: US20230266987A1
- Status: Published application
- Kind: A1
- Application number: 17/678,239
- Filed: 2022-02-23
- Published: 2023-08-24
- Earliest claimed: 2022-02-23
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Jason Nelson
- Web page: https://patentgrep.com/patent/US20230266987A1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/485: {Task life-cycle, e.g. stopping, restarting, resuming execution (G06F9/4881 takes precedence)}
- G06F 9/5022: {Mechanisms to release resources}
- G06F 2009/45562: {Creating, deleting, cloning virtual machine instances}
- G06F 2009/45575: {Starting, stopping, suspending or resuming virtual machine instances}
- G06F 2009/45591: {Monitoring or debugging support}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, systems, and computer programs are presented for automatically shutting down idle virtual machines (VMs). One method includes an operation for determining a number of active connections of a VM. The method further includes checking disconnect rules to determine automatic shutting down of the VM. The disconnect rules are based on the number of active connections of the VM, and the disconnect rules define criteria for determining when to shut down the VM automatically. The method further includes, based on determining to automatically shut down the VM, sending a message indicating the VM is inactive to a VM manager program executing at a cloud-service provider. The VM manager program is configured to shut down the VM in response to receiving the message indicating the VM is inactive.

## Claims

### Claim 1

A computer-implemented method comprising:
determining, by one or more processors, a number of active connections of a virtual machine (VM);
checking, by the one or more processors, disconnect rules to determine automatic shutting down of the VM, the disconnect rules based on the number of active connections of the VM, the disconnect rules defining criteria for determining when to shut down the VM automatically; and
based on determining to automatically shut down the VM, sending a message indicating the VM is inactive to a VM manager program executing at a cloud-service provider, wherein the VM manager program is configured to shut down the VM in response to receiving the message indicating the VM is inactive.

### Claim 2 (depends on 1)

The method as recited in claim 1, wherein each active connection is an ongoing interaction between the VM and another computing device to exchange data.

### Claim 3 (depends on 2)

The method as recited in claim 2, further comprising:
for each active connection, establishing a communication channel between the VM and the another computing device.

### Claim 4 (depends on 1)

The method as recited in claim 1, wherein checking disconnect rules comprises:
Checking a disconnect rule that defines to automatically shut down the VM when a number of terminal-services connections is equal to zero; and
determining to automatically shut down the VM when the number of terminal-services connections is equal to zero.

### Claim 5 (depends on 1)

The method as recited in claim 1, wherein checking disconnect rules comprises:
checking respective rules for one or more types of active connections.

### Claim 6 (depends on 1)

The method as recited in claim 1, wherein checking the disconnect rules comprises:
checking a threshold inactivity period; and
determining to automatically shut down the VM after the VM has zero active connections for at least the threshold inactivity period.

### Claim 7 (depends on 1)

The method as recited in claim 1, wherein checking the disconnect rules comprises:
checking a number of terminal connections; and
determining to automatically shut down the VM when the number of terminal connections is below a predetermined threshold number of terminal connections.

### Claim 8 (depends on 1)

The method as recited in claim 1, wherein checking the disconnect rules comprises:
Checking a threshold number of Simple Mail Transfer Protocol (SMTP) connections; and
determining to automatically shut down the VM when the number of SMTP connections is below the threshold number of SMTP connections.

### Claim 9 (depends on 1)

The method as recited in claim 1, wherein checking the disconnect rules comprises:
checking a number of web browser tabs open; and
determining to automatically shut down the VM when the number of web browser tabs open is below a predetermined threshold number of web browser tabs open.

### Claim 10 (depends on 1)

The method as recited in claim 1, wherein checking the disconnect rules comprises:
checking an amount of time the VM is inactive; and
determining to automatically shut down the VM after the VM is inactive for a minimum amount of time.

### Claim 11 (depends on 1)

The method as recited in claim 1, wherein checking the disconnect rules comprises:
detecting that another VM is configured to not shut down due to inactivity; and
avoid shutting down the other VM due to inactivity.

### Claim 12 (depends on 1)

The method as recited in claim 1, wherein the VM manager program comprises disconnect parameters for determining when to shut down the VM after receiving the message.

### Claim 13 (depends on 12)

The method as recited in claim 12, wherein the disconnect parameters include one or more of threshold number of terminal connections before shutting down VM, threshold number of SMTP connections before shutting down VM, threshold number of web browser tabs open before shutting down VM, minimum amount of time the VM is inactive before shutting down the VM, and VM to not be shut down due to inactivity.

### Claim 14

A system comprising:
a memory comprising instructions; and
one or more computer processors, wherein the instructions, when executed by the one or more computer processors, cause the system to perform operations comprising:
determining, by one or more processors, a number of active connections of a virtual machine (VM);
checking, by the one or more processors, disconnect rules to determine automatic shutting down of the VM, the disconnect rules based on the number of active connections of the VM and a threshold inactivity period, the disconnect rules defining criteria for determining when to shut down the VM automatically;
detecting, based on the checking, that the VM had no active connections for at least the threshold inactivity period; and
sending, in response to the detecting, a message indicating the VM is inactive to a VM manager program executing at a cloud-service provider, wherein the VM manager program is configured to shut down the VM in response to receiving the message indicating the VM is inactive.

### Claim 15

A tangible machine-readable storage medium including instructions that, when executed by a machine, cause the machine to perform operations comprising:
determining, by a cloud-service server, a number of terminal-services connections of a virtual machine (VM) executing on the cloud-service server;
checking, by the cloud-service server, disconnect rules to determine automatic shutting down of the VM, the disconnect rules based on the number of terminal-services connections of the VM, the disconnect rules defining criteria for determining when to shut down the VM automatically; and
shutting down the VM in response to automatically shut down the VM.

### Claim 16 (depends on 15)

The tangible machine-readable storage medium as recited in claim 15, wherein each active connection is an ongoing interaction between the VM and another computing device to exchange data.

### Claim 17 (depends on 15)

The tangible machine-readable storage medium as recited in claim 15, wherein checking disconnect rules comprises:
checking a disconnect rule that defines to automatically shut down the VM when a number of terminal-services connections is equal to zero; and
determining to automatically shut down the VM when the number of terminal-services connections is equal to zero.

### Claim 18 (depends on 15)

The tangible machine-readable storage medium as recited in claim 15, wherein checking disconnect rules comprises:
checking respective rules for one or more types of active connections.

### Claim 19 (depends on 15)

The tangible machine-readable storage medium as recited in claim 15, wherein checking the disconnect rules comprises:
checking a threshold inactivity period; and
determining to automatically shut down the VM after the VII has zero active connections for at least the threshold inactivity period.

### Claim 20 (depends on 15)

The tangible machine-readable storage medium as recited in claim 15, wherein checking the disconnect rules comprises:
Checking a number of terminal connections; and
determining to automatically shut down the VM when the number of terminal connections is below a predetermined threshold number of terminal connections.
