Abstract:
The method includes modifying a routing rule of a load balancer of the system, the rule representing at least one parameter for communications between a client device and the first VM to specify that data from the client device destined for the first VM instance is queued, suspending processing, at the first VM instance, of pending requests from the client device, transmitting data, from the first VM instance, to the load balancer representing the state of the or each suspended request, modifying the routing rule to specify that the endpoint for a communication channel from the second VM instance is the client device, transmitting the or each suspended request to the second VM instance, and modifying the routing rule to specify transmission of data from the client device directly to the second VM instance.

Description:
TECHNICAL FIELD 
       [0001]    Aspects relate, in general to a method and system for migrating a data session, a network element and a computer program product for the same. 
       BACKGROUND 
       [0002]    Cloud components and services in a cloud-based or virtualized system (all of which are referred to as service, from hereon in, without loss of generality) can grow and shrink their allocated resources dynamically based on instantaneous workload conditions. 
         [0003]    For example, virtual machine (VM) instances of the system that are used to provide the service can be spawned or deleted. Such VM instances will typically execute an application for a service, or an application part that, in conjunction with other VM instances executing application parts, can process data to provide a service. 
         [0004]    A load-balancer (LB) element can be used to spread incoming requests across the available VMs of the service for clients. That is, client requests (and processed data to be passed to a client) can be distributed using an LB element of the system. The LB will typically distribute requests between VMs according to some policy (e.g., weighted round-robin or least-loaded or based on the source IP address and/or other IP header fields, or others). 
       SUMMARY 
       [0005]    According to an example, there is provided a method, in a virtualized system comprising multiple virtual machine (VM) instances executing over physical hardware, for migrating a data session from a first VM to a second VM, the method comprising modifying a routing rule of a load balancer of the system, the rule representing at least one parameter for communications between a client device and the first VM to specify that data from the client device destined for the first VM instance is queued, suspending processing, at the first VM instance, of pending requests from the client device, transmitting data, from the first VM instance, to the load balancer representing the state of the or each suspended request, modifying the routing rule to specify that the endpoint for a communication channel from the second VM instance is the client device, transmitting the or each suspended request to the second VM instance, and modifying the routing rule to specify transmission of data from the client device directly to the second VM instance. Data relating to a suspended request can be queued in a buffer device of the load balancer. The load balancer can be a software defined networking element, and wherein modifying the routing rule can include updating a routing table to specify an IP or MAC address of a device or VM instance, The load balancer can be inhibited, prevented or otherwise constrained from forwarding data from the client device to the first VM instance. Inhibition can automatically be implemented upon instantiation of a new VM instance. A data session can be migrated in response to scaling of the number of VM instances of the system due to a variation in system load. The load balancer can maintain a table of inhibited sessions representing sessions to be migrated or being migrated, the load balancer operable to queue data from the client device relating to an inhibited session. The table of inhibited sessions can include a queue for incoming packets that arrive while a session is inhibited. 
         [0006]    According to an example, there is provided a system comprising multiple virtual machine (VM) instances executing over physical hardware, the system including a network element operable to migrate a data session from a first VM to a second VM by modifying or receiving data representing a modified routing rule representing at least one parameter for communications between a client device and the first VM to specify that data from the client device destined for the first VM instance is queued, suspending processing, at the first VM instance, of pending requests from the client device, transmitting data, from the first VM instance, to the load balancer representing the state of the or each suspended request, modifying the routing rule to specify that the endpoint for a communication channel from the second VM instance is the client device, transmitting the or each suspended request to the second VM instance, and modifying the routing rule to specify transmission of data from the client device directly to the second VM instance. The network element can include a buffer operable to receive data to be queued from the client device. The system can inhibit the network element from forwarding data from the client device to the first VM instance. The network element can maintain a table of inhibited sessions representing sessions to be migrated or being migrated, the network element operable to queue data from the client device relating to an inhibited session. 
         [0007]    According to an example, there is provided a network element in a virtualized system comprising multiple virtual machine (VM) instances executing over physical hardware, the network element operable to migrate a data session from a first VM to a second VM, by modifying or receiving data representing a modified routing rule representing at least one parameter for communications between a client device and the first VM to specify that data from the client device destined for the first VM instance is queued, suspending processing, at the first VM instance, of pending requests from the client device, transmitting data, from the first VM instance, to the load balancer representing the state of the or each suspended request, modifying the routing rule to specify that the endpoint for a communication channel from the second VM instance is the client device, transmitting the or each suspended request to the second VM instance, and modifying the routing rule to specify transmission of data from the client device directly to the second VM instance, The network element can include a buffer device operable to store data representing a pending request from the client device. The network element can include a memory operable to store multiple routing rules including an IP or MAC address of a device or VM instance. 
         [0008]    According to an example, there is provided a computer program product, comprising a computer usable medium having computer readable program code embodied therein, said computer readable program code adapted to be executed to implement a method for migrating a data session as provided herein, 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0009]    Embodiments will now be described, by way of example only, with reference to the accompanying drawings, in which: 
           [0010]      FIG. 1  is a schematic representation of a typical system in which a load balancer is used to distribute data between clients and VMs; 
           [0011]      FIG. 2  is a schematic representation of a system including an SDN-enabled controller Network Element (SDN LB/NE) according to an example; and 
           [0012]      FIG. 3  is a schematic representation of a system including an SDN-enabled controller Network Element (SDN LB/NE) according to an example. 
       
    
    
     DESCRIPTION 
       [0013]    Example embodiments are described below in sufficient detail to enable those of ordinary skill in the art to embody and implement the systems and processes herein described. It is important to understand that embodiments can be provided in many alternate forms and should not be construed as limited to the examples set forth herein. 
         [0014]    Accordingly, while embodiments can be modified in various ways and take on various alternative forms, specific embodiments thereof are shown in the drawings and described in detail below as examples. There is no intent to limit to the particular forms disclosed. On the contrary, all modifications, equivalents, and alternatives falling within the scope of the appended claims should be included. Elements of the example embodiments are consistently denoted by the same reference numerals throughout the drawings and detailed description where appropriate. 
         [0015]    The terminology used herein to describe embodiments is not intended to limit the scope. The articles “a,” “an,” and “the” are singular in that they have a single referent, however the use of the singular form in the present document should not preclude the presence of more than one referent. In other words, elements referred to in the singular can number one or more, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises,” “comprising,” “includes,” and/or “including,” when used herein, specify the presence of stated features, items, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, items, steps, operations, elements, components, and/or groups thereof. 
         [0016]    Unless otherwise defined, all terms (including technical and scientific terms) used herein are to be interpreted as is customary in the art. It will be further understood that terms in common usage should also be interpreted as is customary in the relevant art and not in an idealized or overly formal sense unless expressly so defined herein. 
         [0017]    Typically, clients of a service executing on a virtualized system, such as a cloud-based platform in which multiple VM instances are executing over physical hardware, can be remote end-users who connect to an IP address corresponding to a load balancer (LB) of the system. The LB listens for and can accept the connection on behalf of the service or component that the client wishes to use, and can open a connection (internal to the LB plus VMs service ensemble) to one of the available service VMs according to the LB policy. The LB then forwards any traffic back and forth between the two connections, that is between the client and the (or each in the case that multiple VMs are used, for instance multiple VMs executing the same application or service) VM. 
         [0018]    From an elasticity perspective, this set-up has the advantage of allowing a seamless change of the VM that serves a particular user as needed for rebalancing the workload after an elastic growth or de-growth, without the user noticing anything. Indeed, in such cases, the LB would close the internal connection with a VM, and re-open it with another VM, without the client noticing anything, as the connection with the LB would not change. 
         [0019]      FIG. 1  is a schematic representation of a typical system in which a load balancer is used to distribute data between clients and VMs. Three client apparatuses  101   a - c  are served by two VMs  103   a - b  (upper part of  FIG. 1 ) via a LB  105 . Interconnects within the LB  105  indicating the flow of data between clients and VMs are schematically shown in  FIG. 1 . The VMs execute over physical hardware  102 . The LB  105  may be provided as a hardware component of the hardware  102 , or may be provided as a virtual component executing within the hardware  102 , perhaps even as a VM. For the sake of clarity, element  102  is not shown in other figures. 
         [0020]    As a result of a change in the load on the system, a scale-out process adds a third VM, VM 3   103   c  (lower part of  FIG. 1 ). Such scaling process are well known, and not described in any more detail. For example, if a metric associated with CPU load of VM 1   103   a  reaches or exceeds a threshold, a further VM (such as VM 3  for example) can be instantiated for the system in order to take a portion of the load from an overloaded VM and/or in order to deal with any new incoming requests that would otherwise have been passed to a VM that is at or reaching threshold (according to some known loading metric such as that noted above for example). The new VM, VM 3  ( 103   c ) can execute an application or application part for a service the same as that executed by VM 1 . That is, VM 3  can provide an additional instance of VM 1  that is able to reduce the load on VM 1  for the service in question and/or deal with any future requests from a client for the service or application. 
         [0021]    For instance, as noted in  FIG. 1 , Client 1  and Client 3  requests are passes by LB  105  to VM 1 . Depending on the demands placed on VM 1 , it would therefore be reasonable to assume that the load of VM 1  may be larger than the load of VM 2 , which is dealing with requests from Client 2  only. 
         [0022]    Once VM 3  is instantiated, the state of Client 3   101   c  can be moved from VM 1  to VM 3 . That is, for example, any pending requests to be handled by VM 1  can be moved to VM 3  for processing. This is seamless to the client. 
         [0023]    A TCP connection between the LB  105  and VM 1   103   a  that serves Client 3   101   c  can be taken down and a new TCP connection can be established with VM 3   103   c . This new TCP connection now sends Client 3 &#39;s network traffic to VM 3 , which is the new server for Client 3 . The disadvantage of this technique is that the LB  105  has to receive all the traffic coming from clients, and then forward it to the right destination VM. This adds latency to the end-to-end process of serving each user request, and it also adds computation load to the LB, which may easily saturate the LB available 
         [0024]    According to an example, a method and system as provided herein enables the migration of existing sessions, such as TCP/IP connections with clients, from one VM to another one without using a LB to receive and resend all the traffic. At the same time, the mechanism can guarantee no data loss in the migration and elasticity process. 
         [0025]    At a broad level, according to an example, a guest operating system executing within a VM is modified to enable migration of a TCP or UDP end-point, along with any associated state, to another VM within a cluster of VMs realizing a distributed service. For example, in a Linux OS, said modifications can be realized in the kernel realizing the TCP/IP networking stack for the OS; a state associated to a TCP/IP end-point includes TCP connection state data or previously received partial UDP packets (due to the use of fragmented UDP packets for example). An API can be provided for serializing a TCP/IP end-point into a byte stream that can be sent to a destination VM, where the end-point is perfectly restored de-serializing the byte stream. In an example, a part or the whole of the workload of a VM, along with any possibly associated state which may be stored internally to the VM, can be migrated from one VM to another. 
         [0026]    According to an example, a LB apparatus is a software defined networking (SDN)-capable network element that can dynamically route incoming requests to one of a number of VMs, rewriting the destination IP address of the request, normally identifying the LB device, and replacing it with the IP address of the actual target VM. 
         [0027]    Whenever a service requires migration of part of its workload from one VM to another—from a migrating (sending) VM to a destination (receiving) VM—the following protocol can be performed between the two involved VMs and the LB. 
         [0028]    The load balancer, or network element, can include multiple routing rules, such as in the form of a routing table for example, that include one or more parameters specifying the destination address, such as a MAC or IP address, for communications between a client device and a VM. For example, a routing rule can specify that data from a particular client is sent to a particular VM, which can be identified using its MAC or IP address for example. 
         [0029]    When a change in the load on the system results in a scale-out process that adds another VM, an overloaded VM can have parts of its load migrated to a new VM. Accordingly, any new processing requests from a client can be redirected to the new VM. In an example, any number of different policies can be applied to choose which of the clients processing should be moved to the new VM. For example, a routing rule can be used in which the IP address of the client is hashed using a hash function and then the hash value is used to decide which of the clients should be handled by the new VM, e.g., if 40% of the load is to be moved to the new VM, the client IP addresses can be hash to a value between 0 and 100 and those that hash to a value less than 40 can be migrated. A routing table can be automatically updated to reflect the decision reached by the routing rule. New requests can be handled by the LB by hashing the requestor&#39;s IP address and routing the request to a VM based on the hash value (such as the hash value modulo the number of VMs). 
         [0030]    The sending VM (or equivalently the sending host OS or hypervisor or a cloud orchestrator component) informs the LB (or the SDN controller which in turn reprograms the LB) that the migration of the service VM&#39;s entire service workload, or a part of it, is going to happen. For example, as a result of load variation in a system in which the VM executes to provide a service (or part of a service along with multiple other VMs) the sending VM may have reached a capacity threshold according to a metric (e.g. CPU load and so on, as are typically known). A further VM can therefore be instantiated in order to deal with further requests that would otherwise overload the migrating VM. 
         [0031]    According to an example, when a decision to instantiate a further VM is made (such as in response to an increased load for example, as it typical), the LB stops forwarding any further traffic related to the sessions that are being migrated. This inhibition can be done by maintaining a table of the inhibited sessions. The table can also contain a queue for incoming packets that arrive while a session is inhibited. For example, a VM may be serving a client for which another VM is to be instantiated due to an increase in load from the client for example. Sessions that are active in that VM can be logged or otherwise recorded in the table of inhibited sessions in order to record sessions for which data should be queued in order to enable the migration of one or more of the sessions to a new VM. 
         [0032]    Following an inhibition, the LB stores any incoming packets related to the affected sessions within an internal queue. In an example, a queue can be a storage device that is part of or is otherwise accessible to the LB, such as part of the physical hardware over which VMs are instantiated, for example. In an example, a session for a VM can represent a semi-permanent interactive information interchange between the client and a VM, or may more generally represent the on-going interactive information interchange between the client and a VM, which may cease, for example, when the client no longer wishes to use the VM, or until the VM is no longer active. Thus, it will be appreciated that migration of a session can include migrating session data associated with a semi-permanent interactive information interchange between the client and a VM, or migrating all interactions between a client and VM to another VM. An inhibited session can therefore be a session which is being or is to be migrated from one VM to another VM. 
         [0033]    The migrating VM carries over the migration of its workload or the to-be-migrated part of it, along with any associated state data, both application-level state and OS/kernel-level state, to the destination VM. This migration is done using standard data and thread migration techniques, i.e., the state associated with each request being migrated is copied to the destination VM. Any thread executing on a request is also migrated using standard thread migration techniques. 
         [0034]    The destination VM restores sessions and internal state corresponding to the migrated part of the workload within the service internal state and restores any corresponding TCP/IP end-points. The LB is informed that the migration has completed, and in response, the LB sends any queued traffic to the destination VM. When the LB has forwarded all queued traffic, it stops queuing new incoming traffic, and resumes forwarding such traffic as for all other traffic, i.e., the inhibiting mechanism is removed. Any traffic related to the migrated workload now gets its IP replaced with the new target VM IP address, and it is forwarded to the new VM. 
         [0035]    Whenever a service requires migration of a significant part of its workload, these steps can be iterated multiple times, with subparts of the workload migrated each time, in order to guarantee a sufficiently small inhibition period at the LB, corresponding to non-responsiveness of the service limited to the part of the workload/sessions/users being migrated. 
         [0036]      FIG. 2  is a schematic representation of a system including an SDN-enabled controller Network Element (SDN LB/NE) according to an example. In the example of  FIG. 2  (top portion before elastic growth  202 ), an SDN-enabled controller Network Element (SDN LB/NE)  201 , three remote clients  203   a - c  with TCP connections (denoted by arrows), and two VMs  205   a - b  that serve the clients  203   a - c  are provided. 
         [0037]    In an example, the VMs  205   a - b  execute over physical hardware  207 , which can be provided as part of a data center  209  for example, and the SDN LB/NE  201  is a network element connected by a local area network  211  to the machines running the VMs. The SDN LB/NE  201  distributes requests from the clients using the TCP/IP end points of the VMs. 
         [0038]    In the example of  FIG. 2 , when elastic growth  202  is initiated, the SDN LB/NE  201  is re-tasked to redirect the TCP connection  204  for Client 3   203   c  so that the end point that before was on VM 1   205   a  is moved to the newly established VM 3   205   c.    
         [0039]    In an example, the SDN LB/NE  201  can be reprogrammed to deliver data to VM 3 &#39;s MAC address instead of VM 1 &#39;s. For example, a routing table of the SDN LB/NE  201  can be updated to reflect the destination for data received from Client 3 . An update can be performed automatically or manually. For example, the MAC address of a new VM, VM 3 , which is instantiated in response to growth  202  (such as because of increased system load) is added to a list of available resources at the SDN LB/NE  201 . VM 3  is instantiated as a result of load variation in connection with VM 1 —that is, Client 3  requests for VM 1  have caused VM 1  to exceed or reach a capacity threshold for example. Accordingly, SDN LB/NE  201  can modify a destination address for request from Client 3  to new VM, VM 3 . A suitable process according to example is described in more detail below with reference to  FIG. 3 . 
         [0040]    The state of Client 3 &#39;s requests that are currently being served by VM 1  is migrated to VM 3 . After the scale/growth  202 , the situation at the bottom of  FIG. 2  is provided in which client 3  requests are handled by VM 3 . However, during the migration to VM 3 , there may be new incoming requests and there may be data flowing back to the client. 
         [0041]    Accordingly, and with reference to  FIG. 3 , which is a schematic representation of a system including an SDN-enabled controller Network Element (SDN LB/NE) according to an example, the following steps to achieve a safe and consistent migration to VM 3  can be performed. 
         [0042]    Upon initiation of the scale-up  302 , such as in response to load variation as described above for example, a new VM can be instantiated (VM 3 ,  301   c ). The process to instantiate a new VM in response to a variation in the load of a system, service or an individual VM is well known, and is not described here in any more detail. After the VM 3   301   c  starts, it is initiated with the application server code. For example, and again as is typically known, the new VM 3  receives data from the SDN LB/NE  303  which can include an application and modules such as communications and authentication modules for example to enable the VM to function. The SDN LB/NE  303  can also supply application specific modules to enable the VM to perform a required service via a storage location such as storage in hardware  207  for example. For example, if the VM in question is required to process audio data, an application specific module to convert one form of audio data to another can he provided to enable the VM to function as an audio convertor. Generally speaking, it is well known to instantiate a VM in response to load variation and to load that new VM with the desired application or service data to enable it to function as desired. 
         [0043]    Once VM 3  is instantiated and functional ( 310 ), the SDN LB/NE  303  is re-tasked or reprogrammed so that TCP messages from Client 3  are queued. For example, a routing table or similar at the SDN LB/NE  303  can be updated so that any messages from Client 3  are stored in a buffer or queue  304  of the SDN LB/NE  303 . 
         [0044]    VM 1  suspends processing of the requests from Client 3  and sends the state of these suspended requests to VM 3  via the SDN LB/NE  303 . The endpoint of Client 3 &#39;s TCP connection is reprogrammed in the SDN LB/NE  303  from VM 1  to VM 3 , so that any messages from VM 3  are passed to Client 3 . VM 3  receives Client 3 &#39;s state and resumes serving these requests. The SDN LB/NE  303  can then send any queued messages ( 304 ) to VM 3 . When all queued messages have been sent, the SDN LB/NE  303  can be reprogrammed to pass TCP messages from Client 3  directly to VM 3 . Hereafter all messages are routed to VM 3  (lower part of  FIG. 3 ). 
         [0045]    A similar set of steps can be executed at degrowth—the steps are identical except for the change of stopping a VM instead of starting a new one. 
         [0046]    Thus, according to an example, an SDN LB/NE efficiently routes every TCP connection to the correct VM at the hardware level while still allowing dynamic redirection of TCP connections so as to support elasticity. The overhead of passing messages between two TCP connections is eliminated almost entirely. In existing applications, this has been a limiting factor for scalable system in that all messages have to go through a LB and that means the LB is a bottleneck—one can have almost unlimited number of VMs, but a given LB can only support a limited number of TCP connections before it is saturated. According to an example, 1-2 orders of magnitude more VMs can be supported as an SDN enabled controller can route messages 1-2 orders of magnitude faster than a user process that read from one TCP connection and passes messages onto another TCP connection. 
         [0047]    In an example, the low level MAC addresses of the TCP connections are changed in an SDN LB/NE. 
         [0048]    As used herein, the term virtual machine is not intended to be limiting. For example, a virtual machine can be in the form of an execution environment in the form of a container, or by way of OS-level virtualization for example. Accordingly, different isolated containers, or namespaces, or execution environments, residing in the same OS, but sufficiently isolated so that they are essentially executing in an exclusive OS environment can be used. 
         [0049]    The present inventions can be embodied in other specific apparatus and/or methods. The described embodiments are to be considered in all respects as illustrative and not restrictive. In particular, the scope of the invention is indicated by the appended claims rather than by the description and figures herein. All changes that come within the meaning and range of equivalency of the claims are to be embraced within their scope.