Optimizing provisioning through automated virtual machine template generation

Software that dynamically updates virtual machine templates at deterministic intervals in order to reduce patching time, by performing the following operations: (i) identifying a virtual machine (VM) provisioned according to a first VM template; (ii) initiating a patching process that applies a set of patch(es) to the VM, thereby creating a patched VM; (iii) determining that an amount of time taken to complete the patching process is greater than a predetermined threshold; and (iv) responsive to determining that the amount of time taken to complete the patching process is greater than the predetermined threshold, generating a second VM template based, at least in part, on the patched VM.

BACKGROUND

The present invention relates generally to the field of cloud computing, and more particularly to managing virtual devices in a cloud computing environment.

Cloud computing is the delivery of computing as a service rather than a product, whereby shared resources, software, and information are provided to computers and other devices as a utility over a network (typically the Internet). An enabling technology for cloud computing is virtualization. Virtualization software allows a physical computing device to be electronically separated into one or more “virtual” devices, each of which can be easily used and managed to perform computing tasks. Some cloud computing providers manage virtual devices using services such as anti-virus, backup, disaster recovery, monitoring, health-check, security, and patching, for example (where the service of managing virtual devices in a cloud computing environment is sometimes referred to as a “managed cloud service” and/or a “cloud managed service”).

Patching is a known service for managing virtual devices in a cloud computing environment. Generally speaking, patching involves updating provisioned virtual machines (VMs) by obtaining and applying approved operating system and software patches. In many cloud computing environments, a new VM is created by deploying a VM template, a reusable image created from a VM (or, more specifically, a snapshot of a VM at a certain place in time).

SUMMARY

According to an aspect of the present invention, there is a method, computer program product and/or system that performs the following operations (not necessarily in the following order): (i) identifying a virtual machine (VM) provisioned according to a first VM template; (ii) initiating a patching process that applies a set of patch(es) to the VM, thereby creating a patched VM; (iii) determining that an amount of time taken to complete the patching process is greater than a predetermined threshold; and (iv) responsive to determining that the amount of time taken to complete the patching process is greater than the predetermined threshold, generating a second VM template based, at least in part, on the patched VM.

DETAILED DESCRIPTION

In typical cloud computing environments, virtual machines (VMs) are provisioned based on preexisting VM templates. When new software updates (or “patches”) need to be installed on these virtual machines, the patches are applied directly to the virtual machines, which can be a time consuming and resource intensive process. Embodiments of the present invention dynamically update VM templates at deterministic intervals in order to reduce “patching” time. More specifically, certain embodiments of the present invention dynamically update VM templates once a threshold of time has been breached by the patching process. This Detailed Description section is divided into the following sub-sections: (i) The Hardware and Software Environment; (ii) Example Embodiment; (iii) Further Comments and/or Embodiments; and (iv) Definitions.

I. The Hardware and Software Environment

Characteristics are as follows:

Service Models are as follows:

Deployment Models are as follows:

Hardware and software layer60includes hardware and software components. Examples of hardware components include mainframes; RISC (Reduced Instruction Set Computer) architecture based servers; storage devices; networks and networking components. In some embodiments software components include network application server software.

Workloads layer66provides examples of functionality for which the cloud computing environment may be utilized. Examples of workloads and functions which may be provided from this layer include: mapping and navigation; software development and lifecycle management; virtual classroom education delivery; data analytics processing; transaction processing; and functionality according to the present invention (see function block66a) as will be discussed in detail, below, in the following sub-sections of this Detailed description section.

FIG. 4shows flowchart400depicting a method according to the present invention.FIG. 5shows program500for performing at least some of the method operations of flowchart400. This method and associated software will now be discussed, over the course of the following paragraphs, with extensive reference toFIG. 4(for the method operation blocks) andFIG. 5(for the software blocks). One physical location where program500ofFIG. 5may be stored is in storage block60a(seeFIG. 3). It should be noted that this example embodiment (also referred to in this sub-section as the “present embodiment,” the “present example,” the “present example embodiment,” and the like) is used herein for example purposes, in order to help depict the scope of the present invention. As such, other embodiments (such as embodiments discussed in the Further Comments and/or Embodiments sub-section, below) may be configured in different ways or refer to other features, advantages, and/or characteristics not fully discussed in this sub-section.

FIG. 4andFIG. 5. refer to a method and associated software for dynamically updating virtual machine (VM) templates in order to reduce an amount of time required to patch VMs provisioned according to those templates. Generally speaking, provisioning a VM includes creating/installing the VM and provisioning the various resources necessary for utilization of the VM. In many cloud computing environments, VMs are provisioned according to VM templates, which define a “beginning” or “default” state for a VM being provisioned. In many cases (including in some embodiments of the present invention), VM templates are created from snapshots of existing VMs, where a snapshot of a VM is a copy of the VM captured at a certain point in time. A VM (and its corresponding snapshot) may include a wide variety of information, including, but certainly not limited to: (i) log files; (ii) the state of the VM's BIOS; (iii) the contents of the VM's disk drive(s); (iv) the contents of the VM's memory (and/or a corresponding paging file); and/or (v) configuration data. In some embodiments, VM templates are, in fact, VM snapshots, while in other embodiments, VM templates include computer program instructions adapted to recreate the conditions present in VM snapshots (including, for example, the log files, configuration files, disk drive contents, memory contents, and BIOS information mentioned above).

Processing begins at operation S405, where identify VM module (“mod”)505identifies a virtual machine (VM) provisioned according to a first VM template. In this embodiment, a purpose of identifying the VM is to determine whether the particular VM is provisioned according to an inefficient or outdated VM template. As such, any VM present in the cloud computing environment of this embodiment may be identified in the step. In some embodiments, the identification of the VM occurs automatically, shortly after the VM has been provisioned. In other embodiments, identify VM mod505is initialized by an advisor module adapted to identify potential VMs (and corresponding templates) for optimizing. However, these examples are not meant to be limiting, and identify VM mod505may identify VMs provisioned according to VM templates using any known (or yet to be known) methods.

Processing proceeds to operation S410, where patching mod510initiates a patching process that applies a set of patches to the VM (thereby creating a “patched VM”). In many cases, including in the present example embodiment, the patching process is a managed service in a cloud computing environment. Furthermore, as used herein, a “patch” is any update that is to be applied to a VM. In some embodiments (including the present example embodiment), a patch is an update to the VM's operating system or to software running on the VM. However, this is not always the case. In some embodiments, patches include, for example: (i) new and/or replacement files for the VM's disk drive(s); (ii) instructions for duplicating, moving, and/or deleting files located on the VM's disk drive(s); (iii) new and/or replacement configuration files for the VM; and/or (iv) instructions for performing a set of actions on the VM.

Processing proceeds to operation S415, where determine timing mod515determines an amount of time taken to complete the patching process. The determination of the amount of time taken to complete the patching process may include any of a wide variety of known (or yet to be known methods). In some embodiments, the determination includes: (i) recording a first timestamp at the time that the patching process is initiated; (ii) recording a second timestamp at the time that the patching process is completed; and (iii) calculating a difference between the first timestamp and the second timestamp. In other embodiments, the determination includes recording the amount of time that it takes for each of a plurality of patching subprocesses to complete, and calculating the sum of those recorded amounts of time. In still other (or the same) embodiments, the determination includes performing additional calculations to accommodate for events that occur during patching that affect the overall time taken to complete the patching process. For example, in one embodiment, a system outage causes the patching process to take longer than it normally would have under typical circumstances. In this embodiment, determine timing mod515may subtract an amount of time corresponding to the system outage from the overall patching process time, in order to better represent the amount of time that that patching process would have taken under typical circumstances.

Processing proceeds to operation S420, where determine threshold mod520determines whether the amount of time taken to complete the patching process is greater than a predetermined threshold. The predetermined threshold may include a wide variety of possible durations (for example, one minute, one hour, one day, etc.) and may be determined using a wide variety of known (or yet to be known) threshold determining methods. In certain embodiments, a cost function is used to determine the threshold. In these embodiments, for example, the cost function determines an amount of time that must elapse before the cost (for example, the resource cost) of patching the VM is greater than the cost of creating a new VM template that already includes the patches. In other embodiments, the predetermined threshold may simply be set by a user/administrator of the cloud computing environment.

It should be noted that in alternate embodiments, the threshold need not necessarily: (i) be predetermined; and/or (ii) be an amount of time. For example, in some embodiments, instead of being predetermined, the threshold may, in fact, be determined automatically based on machine logic. Or, in some embodiments, instead of being an amount of time, the threshold may be a number of patch installations performed on the VM, where the threshold is met once the VM has received a certain number of patches (for example, 10 patches). These examples are not meant to be limiting, however, and the threshold may include any of a wide variety of known (or yet to be known) thresholds capable of indicating that a new VM template should be created.

In certain embodiments of the present invention, determine threshold mod520may consider an aggregate amount of time taken to complete multiple patching processes (also sometimes referred to as patching “subprocesses”) when determining whether the threshold has been met. In these embodiments, the number of patching subprocesses to aggregate may be set manually by a user or may be determined by a hardware and/or software module (such as mod520) of the cloud computing environment. For example, in certain embodiments, a cost function (that is, a cost function different from the cost function discussed in the previous paragraph) is used to determine whether the amount of time taken to complete a plurality of patching subprocesses is more expensive than simply updating one or more VM templates to include the patches included in the patching subprocesses.

Processing proceeds to operation S425, where, on condition that the patching process was determined (in operation S420) to have exceeded the predetermined threshold, generate VM templates mod525generates a second VM template based, at least in part, on the patched VM. Stated another way, in this operation, if the patching process exceed (for example, took longer than) the predetermined threshold, mod525creates a new VM template using the patched VM as a model. As a result, the second VM template will include the patches from the patching process, thereby reducing the number of post-provisioning patches that need to be applied to VMs provisioned according to the second VM template. In many embodiments, the generating of the second VM template includes creating a snapshot of the patched VM after the patching process has completed. The snapshot may then be: (i) used as the second VM template; and/or (ii) be used in generating the second VM template.

Processing proceeds to operation S430, where, when a new VM is to be provisioned, provision VM mod530provisions the new VM according to the second VM template. Or, stated another way, when it comes time to provision a new VM according to the first VM template, provision VM mod530replaces the first VM template with the second VM template. As a result, the newly provisioned VM will already include the patches that had previously been applied to the first VM (that is, the VM identified in operation S405), thereby reducing the amount of time during which the new VM will need to be subjected to patching processes. In some embodiments, the first VM template is deleted, as it is no longer needed for provisioning new VMs. In other embodiments, the first VM is kept for backup purposes or other reasons.

Some embodiments of the present invention recognize the following facts, potential problems and/or potential areas for improvement with respect to the current state of the art: (i) the length of time required to patch a provisioned virtual machine (VM) becomes greater over time; (ii) the length of time required to patch a provisioned VM can render a VM unusable during a target frame of availability; (iii) the process of patching a VM can monopolize network traffic (for example, when many provisioned VMs are being patched); (iv) existing VM templates are created at specified time intervals (for example, every 2 months, or every 90 days); (v) outdated VMs (for example, VMs created from outdated templates) may take a long time to patch; and/or (vi) if many patches are released over a short period of time (and/or prior to an update to a VM template), the patches can be time consuming to implement.

Some embodiments of the present invention dynamically update VM templates at deterministic intervals in order to reduce the cloud managed service “patching” time. For example, some embodiments dynamically update VM templates once a threshold of time has been breached by the patching process. In these embodiments, an algorithm can be used within a control program to dynamically generate a new VM template (for future provisioning) from a provisioned VM when: (i) the patch managed service completes; and (ii) the time to compete the patch managed service has exceeded a specified time threshold.

FIG. 6shows flowchart600depicting a method for updating VM templates according to the present invention (where the method is performed, at least in part, by a second embodiment system, discussed below). In some embodiments, the method is performed automatically (for example, upon installation of a VM according to a VM template). In other embodiments, the method is performed by an advisor module.

Processing begins at operation S605, where a control program provisions a new VM using template A650. Processing then proceeds to operation S610, where the control program records a start time for the patch process. In this embodiment, the start time is set to a variable called “StartTime”.

Processing proceeds to operation S615, where the control program initiates the patching process on the provisioned VM, applying a set of patches to the VM.

Processing proceeds to operation S620, where, once the patching process is complete, the control program records the stop time for the patch process. In this embodiment, the stop time is set to a variable called “StopTime”. Once the stop time has been recorded, the control program computes the total time taken for patching by subtracting the start time from the stop time (for example, by calculating “StopTime−StartTime”). In this embodiment, the total time is set to a variable called “TotalTime”.

Processing proceeds to operation S625, where the control program determines whether the total time is greater than a pre-determined threshold value (for example, 1 hour) where, in this embodiment, the pre-determined threshold is stored in a variable called “ThresholdTimeValue”. If the total time is not greater than the threshold value, processing ends. However, if the total time is greater than the threshold value, processing proceeds to operation S630, where the control program captures a new template A′ from the provisioned VM. In this embodiment, template A′ is captured by taking a snapshot of the patched VM. Processing then proceeds to operation S635, where template A650is replaced by template A′, and template A′ is used for subsequent provisioning activity.

FIG. 7shows system700according to an embodiment of a cloud computing environment according to the present invention (specifically, the second embodiment system). As shown inFIG. 7, request705is received by site service mediator (SSM)710, and SSM710send the request to business process manager (BPM)715. The request includes a payload that provides details relating to the various aspects of the request. For example, if the request (or an aspect of the request) is to deploy a virtual machine, the request contains both the virtual machine configuration as well as configuration of the VM's operating system. Or, if the request involves installing a managed service agent, then the request includes all of the configuration information from that agent. Referring back to the method discussed in relation toFIG. 6, “requests” generated by the method and performed by system700may include, for example: (i) provisioning a VM (see operation S605); (ii) applying patches (see operation S615); (iii) capturing a new template A′ (see operation S630); and/or (iv) replacing template A650with template A′ (see operation S635).

Referring still toFIG. 7, information regarding the request may be sent to vCenter730or managed services abstraction layer (MSAL)720. MSAL720provides configuration, installing, and un-installing managed services. MSAL720works in concert with chef735, which provides various “recipes” to perform those configurations, installations, and uninstallations. vCenter730manages the life cycle of virtual machines. Some of vCenter730's management tasks include, but are not limited to: deployment, customization, powering on, shutdown, reboot, taking snapshots, and/or restoring snapshots. Both vCenter730and MSAL720are connected to storage resource manager (SRM)725, which provides templates for OS deployments (and is a possible storage location for template A650and template A′).

In some situations, chef735installs agent instances745a,745b,745c, and745dfor monitoring, patching, backup, and SA&D (“Service Activation and Deactivation”), respectively. These agent instances are powered by backend servers750a,750b,750c, and750d, which provide the managed services for monitoring, patching, backup, and SA&D, respectively. When the method depicted in flowchart600applies patches to the provisioned VM (see operation S615, discussed above), one or more agent instances (for example, instance745b) are created from backend server750b).