Automatic shutdown of virtual machines
By monitoring and managing the active connections of virtual machines and automatically shutting down inactive virtual machines, the problem of resource waste and cost increase is solved, and efficient management of VMs and security improvement are achieved.
Patent Information
- Application Number
- CN202280092061.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-02-23
- Filing Date
- 2022-11-24
- Publication Date
- 2024-10-29
AI Technical Summary
Existing virtual machine (VM) management technology is difficult to effectively shut down inactive VMs, resulting in resource waste and increased costs, and automatic shutdown may affect users' normal work.
By monitoring the number of active connections of a VM, automatically shut down VMs based on preset thresholds and rules, providing flexible configuration options to avoid unnecessary shutdowns, including using connection monitors to interact with the VM manager, sending idle VM messages, and disconnecting based on The parameter determines whether to shut down the VM.
It realizes automated management of VMs, reduces resource waste and costs, improves security, and avoids automatic shutdown interfering with user work.
Smart Images

Figure CN118871889A_ABST
Abstract
Description
Technical Field
[0001] The subject matter disclosed herein relates generally to methods, systems, and machine-readable storage media for managing virtual machines. Background Art
[0002] Virtual machines (VMs) are an excellent tool for providing cheap computing power. Typically, users pay for VMs based on usage, for example, paying for each hour that a VM is powered on and running, because active VMs consume electricity and computing resources.
[0003] To save money, some VM service providers include the option to shut down VMs based on CPU usage. However, this solution sometimes fails because the VM may be performing some background activity (e.g., preloading a web page, checking email) but no user is actually using the VM. This causes the VM to continue executing and increases the cost of having the VM perform non-critical activities.
[0004] Furthermore, VM service providers may experience periods of high demand, which may require expensive technical solutions, such as having to increase computing resources and adding new data centers.
[0005] Therefore, managing inactive VMs is beneficial to both users and VM service providers. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] The drawings merely illustrate exemplary embodiments of the present disclosure and are not to be considered limiting of its scope.
[0007] Figure 1 is a simplified diagram of a computer environment for deploying virtual machines (VMs) according to some exemplary embodiments.
[0008] Figure 2 is a schematic diagram of a computer environment with programmable logic for managing automatic shutdown of idle VMs, according to some exemplary embodiments.
[0009] Figure 3 is a sample architecture for implementing a connection monitor in accordance with some exemplary embodiments.
[0010] Figure 4 is a flow chart of a method for monitoring whether a VM has an active connection according to some exemplary embodiments.
[0011] Figure 5 is a flow chart of a method for automatically shutting down a VM with no active connections, according to some example embodiments.
[0012] Figure 6 is a flow chart of a method for automatically shutting down an idle VM according to some exemplary embodiments.
[0013] Figure 7 is a flow chart of a method for automatically shutting down an idle VM according to some exemplary embodiments.
[0014] Figure 8 is a block diagram illustrating an example of a machine on which one or more of the example processes described herein may be implemented or controlled. DETAILED DESCRIPTION
[0015] Exemplary methods, systems, and computer programs relate to automatically shutting down idle virtual machines (VMs). Examples represent possible variations only. Unless otherwise expressly stated, components and functions are optional and may be combined or subdivided, and operations may be ordered differently or combined or subdivided. In the following description, for the purpose of explanation, many specific details are set forth in order to provide a thorough understanding of the exemplary embodiments. However, it will be apparent to those skilled in the art that the subject matter may be practiced without these specific details.
[0016] In one aspect, the state of the VM is monitored, and if the VM is inactive, the VM is automatically shut down without a user command to shut down the VM. In some cases, the number of active connections in the VM is monitored, and if the number of active connections is below a certain threshold for a minimum amount of time, the VM is shut down. In some cases, if there is a single connection, the VM remains active, but other thresholds may be configured. In some cases, a notification message is sent from a connection monitor at the VM to the cloud service that provides the VM. The cloud service will shut down the VM based on configurable shutdown rules.
[0017] One general aspect includes a method that includes operations for determining a number of active connections of a virtual machine (VM). The method also includes checking a disconnect rule to determine an automatic shutdown of the VM. The disconnect rule is based on the number of active connections of the VM, and the disconnect rule defines criteria for determining when to automatically shut down the VM. The method also includes, based on determining to automatically shut down the VM, sending a message to a VM manager program executing at a cloud service provider indicating that the VM is inactive. The VM manager program is configured to shut down the VM in response to receiving the message indicating that the VM is inactive.
[0018] One general aspect includes a method that includes an operation of determining, by a cloud service server, a number of terminal service connections of a virtual machine (VM) executing on the cloud service server. Additionally, the method includes checking, by the cloud service server, a disconnect rule to determine an automatic shutdown of the VM. The disconnect rule is based on the number of terminal service connections of the VM, and the disconnect rule defines criteria for determining when to automatically shut down the VM. Additionally, the method includes shutting down the VM in response to automatically shutting down the VM.
[0019] Figure 1 is a simplified diagram of a computer environment for deploying virtual machines (VMs) according to some exemplary embodiments. A cloud service server 102 provides a variety of services, including deployment of multiple VMs 116. Although a single cloud service server 102 is shown, the services may be provided by multiple servers in a distributed manner.
[0020] An example of a VM provider is from Microsoft TM Azure TM , to provide Windows TM or Linux TM VM. Some embodiments are given with reference to Azure, but the same principles can be used for other VM services.
[0021] The cloud service server 102 may be accessed using a client device 104 via a network 114, such as the Internet. The client device 104 includes an operating system (OS) 108 to enable execution of applications 106 on the client device 104. If the client device 104 provisions a VM 116 on the cloud service server 102, the VM 116 may be accessed through terminal services, which includes a VM window 110 on the client device 104 that provides a user interface that presents the user interface that the VM machine 116 would provide.
[0022] Terminal Services, also known as Remote Desktop Services in Windows Server, is a component of Microsoft Windows that allows users to access applications and data on remote computers over a network. Windows applications, or the entire desktop of a computer running Terminal Services, can be accessed by a remote client device 104 such as a VM window 110. Using Terminal Services, the user interface of the application is presented at the client. Any input is redirected over the network to the server, where execution of the application occurs.
[0023] Cloud service server 102 also includes a VM manager 118, a directory service 120, one or more cloud servers 124, and a cloud repository 128. The VM manager is responsible for configuring, provisioning, managing, monitoring, and deprovisioning VMs 116. Directory service 120 implements the Azure Active Directory (Azure AD) enterprise entity service, which provides user management, single sign-on, multi-factor authentication, and other directory-related services.
[0024] One or more cloud servers 124 provide computing resources for implementing services of cloud services. In addition, cloud storage 128 allows users to store data on the cloud. The data in cloud storage 128 can also be configured to be accessed by VM 116. Client device 104 and VM 116 can access other servers 140 via network 114.
[0025] Users often want to release VM 116 when it is not in use, also known as shutting down or deprovisioning, so that they can save money. Another benefit of shutting down VM 116 is improved security, because an unexecuting VM may not be targeted by malicious users.
[0026] However, automatically shutting down an idle VM may be difficult because if the VM is truly idle, it may be difficult to access. For example, if network activity is used to determine whether a VM is idle, the VM may not have a remote desktop connection (e.g., the remote desktop application on the client device has been closed), but the VM may still be performing network activities, such as a web page that periodically updates information on a browser, an email client that periodically checks for new emails, an active connection to an application server, etc. Therefore, the VM may appear to be active, but to the user, the VM may be considered idle because the remote desktop connection has been closed.
[0027] In addition, sometimes it may appear that the VM is idle, but the VM may be performing valuable work. For example, a developer may build an application server on a VM, an operation that may take several hours. Once the developer initiates the operation to build the application server, the developer may shut down the remote desktop (e.g., the client device is a laptop that goes to sleep due to an inactivity timer), but the developer does not want the VM to shut down. Because automatically shutting down the VM would be a harmful operation for the user.
[0028] In one aspect, a flexible system is presented for automatically shutting down a VM. The system can be configured to accommodate multiple scenarios for shutting down a VM, e.g., exempting a VM from being shut down, automatically shutting down if a remote desktop is closed, providing a timer to shut down after a VM has been idle for a minimum amount of time, configuring parameters that define when a VM is considered idle, etc.
[0029] In addition, a connection monitoring program installed in the VM can determine when the VM is idle. The connection monitor interacts with the cloud service server executing the VM to automatically shut down the VM. In addition, the cloud service server has configurable connection parameters for verifying whether the VM should be shut down.
[0030] Figure 2 is a schematic diagram of a computer environment with programmable logic for managing automatic shutdown of idle VMs according to some exemplary embodiments. The cloud service server 202 includes additional programs to monitor VMs and shut down VMs when they are not in use.
[0031] The cloud service server 202 includes a reference Figure 1 The same modules as described for the cloud service server 102, plus a VM connection monitor 206. In addition, one or more VMs 116 include a connection monitor 212 to determine when the VM is idle. The VM also includes an OS 212, an executing application 210, a network interface card (NIC) 218 communicating via a virtual network, and a virtual repository 216 for storing data of the VM 116.
[0032] The connection monitor 212 checks the activity in the VM to determine when the VM is a candidate for shutdown. Figure 3 More details are provided regarding connection monitor 212. When connection monitor 212 detects a condition for shutting down a VM, connection monitor 212 sends a message, referred to herein as an idle VM message, to VM connection monitor 206 to notify the latter that VM 116 is a candidate for shutdown.
[0033] In some exemplary embodiments, the Idle VM message is sent via HTTP POST, but any other type of inter-process messaging method may be used. HTTP POST is a method for sending data from an HTTP client to a server, and HTTP POST requests that the web server accept the data contained in the body of the message. For example, HTTP POST is often used when submitting login or contact forms to a server or updating files and images.
[0034] When the VM connection monitor 206 receives an idle VM message, the VM connection monitor 206 checks the configurable shutdown logic referred to herein as disconnect parameters 208 to determine whether to shut down the VM. Figure 5 More details of the disconnect logic for the VM connection monitor 206 are provided.
[0035] Client device 204 includes Figure 1The same elements of the client device 104 of the present invention are provided, plus a VM connection manager 220, for configuring the disconnection parameters 208 and disconnection rules used by the connection monitor 212. In some exemplary embodiments, a user interface (UI) is presented by the VM connection manager to enable configuration. The UI can be presented by the cloud service server 202 or the connection monitor.
[0036] Figure 3 is a sample architecture for implementing a connection monitor according to some exemplary embodiments. The connection monitor 212 includes an OS interface 302 , a connection detection program 304 , a VM manager interface 306 , and one or more disconnect rules 308 .
[0037] The OS interface 302 provides interaction with the OS 214 executed on the VM. For example, the OS interface 302 collects information about active processes and active connections in the VM. For example, the OS interface 302 can make calls via the Win32 API to obtain information about terminal service connections, including the number of active terminal connections. The connection detection program 304 determines whether there are active connections in the VM based on the information obtained from the OS. If the number of connections is below a predetermined threshold (e.g., below 1 connection, which indicates that there are no active connections), the connection detection program 304 notifies the cloud service server 202 via the VM manager interface 306.
[0038] VM manager interface 306 interacts with VM connection monitor 206 at cloud service server 202 to send an idle VM message for shutting down the VM. As discussed above, the idle VM message can be an HTTP POST. In addition, VM manager interface 306 can respond to information requests (e.g., number of active connections) (e.g., from VM connection monitor 206 at cloud service server 202) to provide information about the number of active connections, and optionally other information, such as how long the connection has been active, or some other statistics related to the connection.
[0039] The connection detection program 304 utilizes disconnect rules that define the criteria for when to shut down a VM. As used herein, a connection is an ongoing interaction between a VM and another device (real or virtual) for the purpose of exchanging data. For example, a connection may be a TCP / IP network connection to a server. An exemplary disconnect rule is "disconnect the VM when the number of terminal services connections is zero."
[0040] The most common type of connection for a VM is a terminal services connection, but there may be other types of connections, such as connections to email servers, application servers, web servers, etc. The types of connections considered for determining whether a VM is idle are configurable and defined in disconnect rules 308. For example, an email client that periodically checks an email server for new emails may not be configured as an active connection, or these types of connections will be ignored in determining whether a VM is idle. In most cases, it is expected that the number of terminal services connections will be the primary factor in determining whether a VM is idle, but other connection types may also be configured.
[0041] In addition, a time threshold can be configured so that the VM is not shut down until there are no active connections for a period exceeding the time threshold. For example, a developer may be working on migrating a portion of Microsoft Exchange, a process that may take several hours. The developer will not want to shut down the VM during this time, so the time threshold can be set to 24 hours so that the VM is not shut down during this process.
[0042] Additionally, disconnect rules 308 may be configured for some VMs, but other VMs may be configured not to be shut down and are exempt from the inactivity test.
[0043] In addition, the disconnection rule 308 may also include time windows. A first time window may be defined to automatically shut down the VM. For example, the VM will be allowed to execute during working hours between 9 a.m. and 5 p.m. A second time window may be defined to ensure that the VM is not shut down during that period. For example, the VM will not be shut down between 9 a.m. and 10 p.m., which is the time when users tend to start using the VM. This will avoid inconvenience for users who do not want to have to log into the VM multiple times. It is noted that during Figure 3 The embodiments illustrated in the are examples and do not describe every possible embodiment. Other embodiments may utilize different modules or combine the functions of several modules. Figure 3 The embodiments illustrated in the present invention should therefore not be construed as exclusive or limiting, but rather as illustrative.
[0044] Figure 4 4 is a flow chart of a method 400 for monitoring whether a VM has active connections according to some exemplary embodiments. At operation 402, the number of active connections is checked for one or more types of connections. A typical connection is a terminal service connection, but other types of connections may be included.
[0045] At operation 402, the number n of active connections is checked for one or more connection types. For example, the number of active terminal connections is requested from the OS via an API.
[0046] From operation 402, the method 400 proceeds to operation 404, where a check is performed to determine whether n is greater than zero. If n is greater than zero, the method 400 proceeds to operation 406, and if n is less than or equal to zero, the method 400 proceeds to operation 408. In other embodiments, the threshold value may be greater than zero, such as 1, 5, 10, etc. That is, if the VM has one active connection, the VM will also be shut down.
[0047] At operation 406, if a timer has been set, the timer is stopped because there is more than one active connection. In other embodiments, a timer is not used, and once the number of connections is zero, the VM is shut down without further waiting. From operation 406, method 400 returns to operation 402.
[0048] At operation 408, a check is made to determine if the timer is set. If the timer has been set, the method 400 proceeds to operation 412, and if the timer is not set, the method proceeds to operation 410 where the timer is started and the method returns to operation 402.
[0049] At operation 412, a check is made to determine if the timer has expired. If the timer has expired, the method 400 proceeds to operation 414, where an idle VM message is sent to the VM connection monitor. If the timer has not expired, the method 400 returns to operation 402.
[0050] Note that other embodiments may not use a timer, but instead track the time a VM is disconnected in a different manner, such as recording when a connection is established or closed. Figure 4 The embodiments illustrated in the present invention should therefore not be construed as exclusive or limiting, but rather as illustrative.
[0051] It is noted that the process of determining when to shut down a VM is configurable. The configurable options may include one or more of the following:
[0052] -Threshold number of terminal connections before shutting down the VM;
[0053] -Threshold number of SMTP connections before shutting down the VM;
[0054] -Threshold number of open web browser tabs before shutting down the VM;
[0055] -The minimum amount of time a VM can be inactive before being shut down;
[0056] -Exempt VM shutdown based on VM inactivity;
[0057] - Automatically shut down VMs without approval from the VM service provider; and
[0058] -The VM service provider makes the final determination when to shut down the VM.
[0059] Additionally, other types of connections may be considered, such as connections to a server (eg, a cloud file system).
[0060] Figure 5 is a flowchart of a method 500 for automatically shutting down a VM with no active connections according to some exemplary embodiments. Although the operations in this flowchart are given and described sequentially, a person skilled in the art will recognize that some or all operations may be performed in a different order, combined or omitted, or performed in parallel.
[0061] The VM connection monitor 206 of the cloud service server 202 receives the idle VM message and processes the idle VM message to determine when to shut down the VM. The VM connection monitor 206 checks the disconnect parameter 208 to determine when to shut down the VM.
[0062] Disconnection parameters 208 are similar to disconnection rules 308 of connection monitor 212, and may include the same rules described above with respect to number of connections, idle time threshold, VM exemption from shutdown, etc. Another rule may be to simply perform the action requested in the idle VM message, such as shutting down the VM. In some exemplary embodiments, connection monitor 212 does not count the inactivity time, and it is up to VM connection monitor 206 to determine whether a minimum threshold of inactivity time is required before shutting down the VM.
[0063] These rules for VM connection monitor 206 can be configured by a system administrator and, in some cases, by a user accessing the VM. If there is a conflict between disconnection rules 308 and disconnection parameters 208, in some embodiments, the disconnection parameters take precedence. In other embodiments, the opposite is implemented.
[0064] At operation 502, an idle VM message is received by the VM connection monitor 206. Additionally, at operation 504, disconnect parameters of the VM are checked.
[0065] From operation 504, the method 500 proceeds to operation 506 where a determination is made to shut down the VM. If the determination is to shut down the VM, the method 500 proceeds to operation 510, and if the determination is not to shut down the VM, the method 500 proceeds to operation 508 where no action is taken and the VM is not shut down.
[0066] At operation 510, the VM is shut down. For example, the VM connection monitor 206 sends a message to the VM manager to request the VM to be shut down.
[0067] Figure 66 is a flowchart of a method 600 for automatically shutting down an idle VM according to some exemplary embodiments. Although the operations in this flowchart are given and described sequentially, a person skilled in the art will recognize that some or all operations may be performed in a different order, combined or omitted, or performed in parallel.
[0068] Operation 602 is for determining a number of active connections of a virtual machine (VM).
[0069] From operation 602, method 600 proceeds to operation 604 where one or more processors examine disconnect rules to determine automatic shutdown of a VM. The disconnect rules are based on the number of active connections of the VM and define criteria for determining when to automatically shut down a VM.
[0070] From operation 604, method 600 proceeds to operation 606 to send a message indicating VM inactivity to a VM manager program executing at a cloud service provider based on determining to automatically shut down the VM. The VM manager program is configured to shut down the VM in response to receiving the message indicating VM inactivity.
[0071] In one example, method 600 also includes, for each active connection, establishing a communication channel between the VM and another computing device.
[0072] In one example, checking the disconnect rule includes checking the disconnect rule that defines automatic shutdown of the VM when the number of terminal service connections is equal to zero, and determining to automatically shut down the VM when the number of terminal service connections is equal to zero.
[0073] In one example, checking disconnect rules includes checking corresponding rules for one or more types of active connections.
[0074] In one example, checking the disconnect rule includes checking a threshold inactivity period, and automatically shutting down the VM after the VM has zero active connections for at least the threshold inactivity period.
[0075] In one example, checking the disconnection rule includes checking the 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.
[0076] In one example, checking the disconnect rule includes 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.
[0077] In one example, checking the disconnect rule includes checking a number of open web browser tabs, and determining to automatically shut down the VM when the number of open web browser tabs is below a predetermined threshold number of open web browser tabs.
[0078] In one example, checking the disconnect rule includes checking an amount of time that the VM has been inactive, and determining to automatically shut down the VM after the VM has been inactive for a minimum amount of time.
[0079] In one example, checking the disconnect rule includes detecting that the other VM is configured not to shut down due to inactivity, and refraining from shutting down the other VM due to inactivity.
[0080] In one example, the cloud service provider also includes a disconnect parameter for determining when to shut down the VM after receiving the idle VM message.
[0081] In one example, the disconnect parameters include one or more of: a threshold number of terminal connections before shutting down the VM, a threshold number of SMTP connections before shutting down the VM, a threshold number of web browser tabs open before shutting down the VM, a minimum amount of time that the VM is inactive before shutting down the VM, and a VM not shutting down due to inactivity.
[0082] In one example, method 600 also includes causing presentation of a user interface for configuring disconnect rules for the VM.
[0083] Another general aspect is a system, comprising: a memory including instructions and one or more computer processors. The instructions, when executed by the one or more computer processors, cause the one or more computer processors to perform operations, including: determining, by a cloud service server, a number of terminal service connections of a virtual machine (VM) running on the cloud service server; checking, by the cloud service server, a disconnection rule to automatically shut down the VM, a disconnection rule based on the number of terminal service connections of the VM, a disconnection rule defining criteria for determining when to automatically shut down the VM; and shutting down the VM in response to automatically shutting down the VM.
[0084] In another general aspect, a machine-readable storage medium (e.g., a non-transitory storage medium) includes instructions that, when executed by a machine, cause the machine to perform operations, including: determining, by a cloud service server, the number of terminal service connections of a virtual machine (VM) running on the cloud service server; checking, by the cloud service server, to determine a disconnect rule for automatically shutting down a VM, a disconnect rule based on the number of terminal service connections of the VM, a disconnect rule that defines criteria for determining when to automatically shut down a VM; and shutting down the VM in response to the automatic shutdown of the VM.
[0085] According to the above disclosure, various examples are described below. It should be noted that one or more features of the examples (alone or in combination) should be considered within the disclosure of the present application.
[0086] Figure 7 is a flow chart of a method 700 for automatically shutting down an idle VM according to some example embodiments.
[0087] Operation 702 is an operation for determining, by the cloud service server, the number of terminal service connections of a virtual machine (VM) executed on the cloud service server.
[0088] From operation 702, method 700 proceeds to operation 704, where the cloud service server checks disconnect rules to determine automatic shutdown of the VM. The disconnect rules are based on the number of terminal service connections of the VM, and the disconnect rules define criteria for determining when to automatically shut down the VM.
[0089] From operation 704, the method 700 proceeds to operation 706 where the VM is shut down in response to automatically shutting down the VM.
[0090] In one example, each active connection is an ongoing interaction between a VM and another computing device to exchange data.
[0091] In one example, checking the disconnect rule includes checking the disconnect rule that defines automatic shutdown of the VM when the number of terminal service connections is equal to zero, and determining to automatically shut down the VM when the number of terminal service connections is equal to zero.
[0092] In one example, checking disconnect rules includes checking corresponding rules for one or more types of active connections.
[0093] In one example, checking the disconnect rule includes checking a threshold inactivity period, and automatically shutting down the VM after the VM has zero active connections for at least the threshold inactivity period.
[0094] In one example, checking the disconnection rule includes checking the 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.
[0095] Figure 8800 on which one or more exemplary processes described herein may be implemented or controlled. In alternative embodiments, the machine 800 may operate as a standalone device or may be connected (e.g., networked) to other machines. In a networked deployment, the machine 800 may operate in the capacity of a server machine, a client machine, or both in a server-client network environment. In an example, the machine 800 may act as a peer machine in a peer-to-peer (P2P) (or other distributed) network environment. In addition, although only a single machine 800 is shown, the term "machine" will also be used to include any collection of machines that individually or collectively execute a set (or multiple sets) of instructions to perform any one or more of the methods discussed herein, such as via cloud computing, software as a service (SaaS), or other computer cluster configurations.
[0096] As described herein, examples may include logic or several components or mechanisms, or may be operated by logic, several components or mechanisms. A circuit system is a collection of circuits implemented in a tangible entity including hardware (e.g., simple circuits, gate circuits, logic components). Circuit system members may change flexibly over time, and the underlying hardware may change. A circuit system includes members that can perform specified operations individually or in combination when operating. In an example, the hardware of the circuit system may be designed to perform specific operations (e.g., hardwired) invariably. In an example, the hardware of the circuit system may include variably connected physical components (e.g., execution units, transistors, simple circuits), which include computer-readable media that are physically modified (e.g., magnetic modification, electrical modification, by movable placement of constant mass particles) for encoding instructions for specific operations. When connecting physical components, the underlying electrical properties of the hardware components are changed, such as from an insulator to a conductor, or vice versa. Instructions enable embedded hardware (e.g., execution units or loading mechanisms) to generate members of the circuit system in hardware via variable connections, thereby performing parts of specific operations when operating. Thus, when the device is operating, the computer-readable medium is communicatively coupled to other components of the circuit system members. In examples, any physical component may be used in more than one member of more than one circuit system. For example, in operation, an execution unit may be used in a first circuit of a first circuit system at one point in time and reused by a second circuit in the first circuit system or by a third circuit in the second circuit system at a different time.
[0097] The machine (e.g., computer system) 800 may include a hardware processor 802 (e.g., a central processing unit (CPU), a hardware processor core, or any combination thereof), a graphics processing unit (GPU) 803, a main memory 804, and a static memory 806, some or all of which may communicate with each other via an interconnection link (e.g., a bus) 808. The machine 800 may also include a display device 810, an alphanumeric input device 812 (e.g., a keyboard), and a user interface (UI) navigation device 814 (e.g., a mouse). In one example, the display device 810, the alphanumeric input device 812, and the UI navigation device 814 may be a touch screen display. The machine 800 may additionally include a mass storage device (e.g., a drive unit) 816, a signal generating device 818 (e.g., a speaker), a network interface device 820, and one or more sensors 821, such as a global positioning system (GPS) sensor, a compass, an accelerometer, or another sensor. The machine 800 may include an output controller 828, such as a serial (e.g., Universal Serial Bus (USB)) connection, a parallel connection, other wired or wireless (e.g., infrared (IR), near field communication (NFC)) connection, to communicate with or control one or more peripheral devices (e.g., printer, card reader).
[0098] The mass storage device 816 may include a communication device readable medium 822 on which is stored one or more sets of data structures or instructions 824 (e.g., software) embodied or utilized by any one or more of the techniques or functionalities described herein. The instructions 824 may also reside, completely or at least partially, within the main memory 804, static memory 806, hardware processor 802, or GPU 803 during execution thereof by the machine 800. In an example, one or any combination of the hardware processor 803, GPU 803, main memory 804, static memory 806, or mass storage device 816 may constitute a machine-readable medium.
[0099] Although the machine-readable medium 822 is illustrated as a single medium, the term “machine-readable medium” may include a single medium or multiple media (eg, a centralized or distributed database, and / or associated caches and servers) configured to store one or more instructions 824 .
[0100] The term "machine-readable medium" may include any medium capable of storing, encoding, or carrying instructions 824 for execution by the machine 800 and causing the machine 800 to perform any one or more of the techniques of the present disclosure, or capable of storing, encoding, or carrying data structures used by such instructions 824 or associated with such instructions. Non-limiting machine-readable medium examples may include solid-state memory and optical and magnetic media. In an example, a mass machine-readable medium includes a machine-readable medium 822 having a plurality of particles, the particles having a constant (e.g., stationary) mass. Therefore, the mass machine-readable medium is not a transiently propagated signal. Specific examples of mass machine-readable media may include: non-volatile memory, such as semiconductor memory devices (e.g., electrically programmable read-only memory (EPROM)), electrically erasable programmable read-only memory (EEPROM)) and flash memory devices; disks, such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks.
[0101] The instructions 824 may also be transmitted or received via the network interface device 820 over the communication network 826 using a transmission medium.
[0102] Throughout this specification, multiple examples can be implemented as a single instance of the components, operations or structures. Although the individual operations of one or more methods are illustrated and described as independent operations, one or more individual operations can be performed simultaneously, and it is not necessary to perform the operations in the order shown in the figure. The structure and function introduced as a separate component in the exemplary configuration can be implemented as a combined structure or component. Similarly, each structure and function introduced as a single component can be implemented as each separate component. These and other changes, modifications, additions and improvements fall within the scope of the subject matter of this paper.
[0103] The embodiments illustrated herein are described in sufficient detail to enable those skilled in the art to practice the disclosed teachings. Other embodiments may be used and derived therefrom, so that structural and logical substitutions and modifications may be made without departing from the scope of the present disclosure. Therefore, the specific embodiments should not be understood in a restrictive sense, and the scope of each embodiment is limited only by the appended claims together with the full scope of equivalents to which such claims are entitled.
[0104] As used herein, the word "or" can be interpreted in the sense of inclusion or exclusion. In addition, multiple instances can be provided for resources, operations or structures described as single instances herein. In addition, the boundaries between various resources, operations, modules, engines and databases are arbitrary to a certain extent, and specific operations are illustrated in the context of specific illustrative configurations. Other functional allocations can be envisioned, which can fall within the scope of various embodiments of the present disclosure. In general, the structures and functions introduced as separate resources in the exemplary configuration can be implemented as merged structures or resources. Similarly, each structure and function introduced as a single resource can be implemented as each separate resource. These and other changes, modifications, additions and improvements fall within the scope of the embodiments of the present disclosure represented by the attached claims. Accordingly, the specification and drawings should be considered in an illustrative sense rather than in a limiting sense.
Claims
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, a disconnect rule to determine an automatic shutdown of the VM, the disconnect rule being based on the number of active connections of the VM, the disconnect rule defining criteria for determining when to automatically shut down the VM; as well as Based on determining to automatically shut down the VM, a message indicating that the VM is inactive is sent to a VM manager program executed at a cloud service provider, wherein the VM manager program is configured to shut down the VM in response to receiving the message indicating that the VM is inactive.
2. The method according to claim 1, wherein: Each active connection is an ongoing interaction between the VM and another computing device for the exchange of data.
3. The method according to claim 2, further comprising: For each active connection, a communication channel is established between the VM and the other computing device.
4. The method according to claim 1, wherein: Check disconnect rules include: checking a disconnect rule defining automatic shutdown of the VM when the number of terminal service connections equals zero; and When the number of terminal service connections is equal to zero, it is determined to automatically shut down the VM.
5. The method according to claim 1, wherein: Check disconnect rules include: Checks for appropriate rules for one or more types of active connections.
6. The method according to claim 1, wherein: Checking the disconnection rules includes: Check threshold inactivity periods; and The VM is automatically shut down after the VM has zero active connections for at least the threshold inactivity period.
7. The method according to claim 1, wherein: Checking the disconnection rules includes: Check the number of terminal connections; and When the number of terminal connections is lower than a predetermined threshold number of terminal connections, it is determined to automatically shut down the VM.
8. The method according to claim 1, wherein: Checking the disconnection rules includes: Checks a threshold number of Simple Mail Transfer Protocol (SMTP) connections; and When the number of SMTP connections is lower than the threshold number of SMTP connections, it is determined to automatically shut down the VM.
9. The method according to claim 1, wherein: Checking the disconnection rules includes: Check the number of open web browser tabs; and When the number of open web browser tabs is lower than a predetermined threshold number of open web browser tabs, it is determined to automatically shut down the VM.
10. The method according to claim 1, wherein: Checking the disconnection rules includes: checking an amount of time that the VM has been inactive; and Automatically shutting down the VM is determined after a minimum amount of time of inactivity of the VM.
11. The method according to claim 1, wherein: Checking the disconnection rules includes: detecting that another VM is configured not to shut down due to inactivity; and Avoid shutting down the other VM due to inactivity.
12. The method according to claim 1, wherein: The VM manager program includes a disconnect parameter for determining when to shut down the VM after receiving the message.
13. The method according to claim 12, wherein: The disconnect parameters include one or more of: a threshold number of terminal connections before shutting down the VM, a threshold number of SMTP connections before shutting down the VM, a threshold number of web browser tabs open before shutting down the VM, a minimum amount of time the VM is inactive before shutting down the VM, and a VM not shutting down due to inactivity.
14. A system comprising modules for performing any method according to claims 1-13.
15. At least one machine-readable medium comprising instructions which, when executed by a machine, cause the machine to perform any method according to claims 1-13.
