Maintaining apparent connectivity during virtual switch maintenance
By adopting a new architecture and operating method for the virtual networking layer, the problem of network connection interruption during virtual switch maintenance was solved, and apparent connectivity was maintained during virtual switch maintenance, reducing downtime and data loss and improving maintenance efficiency.
Patent Information
- Application Number
- CN201980031565.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-05-11
- Filing Date
- 2019-05-03
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2039-05-03
AI Technical Summary
During virtual switch maintenance, existing technologies can cause network connectivity interruptions, leading to application downtime, data loss, and significant downtime, resulting in economic losses for cloud service providers.
A new architecture and operating method of virtual networking layer are adopted. By using virtual switch agent and host network adapter agent, connection state information is saved and restored to maintain apparent connectivity and avoid interruption of actual network connection.
During virtual switch maintenance, maintaining stable network connections for hosts and virtual machines reduces downtime, prevents data loss and application interference, and improves maintenance efficiency.
Smart Images

Figure CN112136113B_ABST
Abstract
Description
[0001] Copyright Notice
[0002] This patent document contains copyrighted material. The copyright holder does not object to anyone facsimile reproduction of the patent document or patent disclosure in the form of a patent document or record in the Patent and Trademark Office, but reserves all other copyrights. Background Technology
[0003] In computer systems, hardware virtualization abstracts the low-level details of the computer system's hardware from the user, rather than presenting a virtual computing platform where its resources can be used. Typically, the computer system's input devices, output devices, network adapters, and other hardware devices are presented as logical abstractions in the virtual platform. Similarly, the computer system's processing units, memory, and storage devices are hidden from the user. In many common configurations, the computer system supports multiple partitions. In the host (parent or root) partition, the host controls how the virtual platform is used in one or more guest (child) partitions. In the guest partition, the host creates a simulated computer environment—a virtual machine ("VM")—where guest software runs. The virtualization resources of the virtual platform can be used to install a guest OS in the VM, and applications can execute in conjunction with the guest OS in the VM. The execution of the guest OS and applications in the VM is as if they were running directly on physical hardware, although there are some limitations in accessing system resources. The host can access the computer system's hardware resources. When the guest OS or applications in the VM use virtualization resources, the host can mediate access to the computer system's hardware resources. This prevents guest software from abusing or overusing system resources, such as network access, storage, memory, and processing units.
[0004] Virtual platforms can hide the details of the physical network adapter used to access the network. Instead, guest software in the guest partition connects to the network through a virtual networking layer. In a physical network, a network switch has multiple ports and routes traffic from any port of the network switch to any other port of the network switch. Similarly, a virtual networking layer can include a virtual switch, which is capable of routing traffic from any port of the virtual switch to any other port of the virtual switch. In a typical configuration, one port of the virtual switch is connected to the physical network adapter (which is connected to the external network), and the other ports of the virtual switch are connected to the VMs. The virtual switch allows a single physical network adapter to provide network connectivity for any number of VMs. The virtual switch can also be connected to a host.
[0005] From time to time, virtual switches are updated or otherwise changed. To change the version of a virtual switch, the connection to the virtual switch is disconnected or disabled. In practice, changing the version of a virtual switch can involve (1) disabling the physical network adapter for the host, (2) disabling the virtual network adapter for the VM, (3) disabling the virtual network adapter for the host, (4) unloading a previous version of the virtual switch from storage, (5) loading the current version of the virtual switch into storage, (6) restoring / enabling the physical network adapter for the host, (7) restoring / enabling the virtual network adapter for the VM, and (8) restoring / enabling the virtual network adapter for the host. Disabling a physical or virtual network adapter may disconnect network connections used by the host or VM. This may cause applications running on the host or VM to stop, or otherwise cause disruption to applications when network connections managed by the host or VM are lost and restored. The state of the VM may need to be saved and then restored, or the application may need to be restarted, potentially resulting in significant downtime, loss of correct application state, and / or data loss. Specifically, the loss of functionality for applications running on the host machine (e.g., monitoring VMs, performing diagnostic tests, or tracking which applications running on the host or VMs are active) can result in significant downtime and revenue loss for cloud service providers (who may host commercial web services or critical infrastructure services for enterprises or other organizations). Even if network connectivity loss for hosts and VMs is well managed, it can still be interrupted during virtual switch maintenance. For cloud service providers, the consequences of virtual switch maintenance can be a major issue. Depending on the terms of the service agreement, if the network connectivity outage lasts longer than the minimum duration, the cloud service provider may be required to offer a substantial discount or refund. Summary of the Invention
[0006] In summary, this paper details various innovations proposed for the maintenance of virtual switches in the virtual networking layer. These innovations include new architectures for the virtual networking layer and new operations performed during virtual switch maintenance. In some example implementations, the interruption to actual network connectivity is minimized during virtual switch maintenance—below the timeout threshold representing a network connectivity failure. While the virtual switch is under maintenance, connectivity to the host, VMs, and physical network adapters can be maintained. Despite some interruption to actual network connectivity, apparent connectivity (for VMs) over the connection between the VM and the virtual switch can be maintained during virtual switch maintenance. Similarly, apparent connectivity (for the host) over the connection between the host and the virtual switch can be maintained during virtual switch maintenance.
[0007] According to one aspect of the innovation described herein, a computer system provides a virtual networking layer. The virtual networking layer includes a virtual switch and a virtual switch agent. The virtual switch is configured to transmit data between multiple ports of the virtual switch. For each of the multiple VMs, the virtual switch agent is configured to mediate the transmission of data between the VM and the virtual switch over the connection via the VM network adapter. The virtual switch agent is also configured to persist state information defining the characteristics of the connection via the VM network adapter when the version of the virtual switch is changed. This supports the maintenance of the apparent connectivity of the VMs over the connection via the VM network adapter. For example, the virtual switch agent can be configured to save and retrieve state information for the connected VM network adapter, and / or save and retrieve state information for the channel between the virtual switch and the VM.
[0008] The virtual networking layer may also include a host network adapter agent. The host network adapter agent is configured to mediate the transmission of data over the connection via the host virtual network adapter between the host and the virtual switch for hosts connected to the virtual networking layer. The host network adapter agent is also configured to retain state information defining the characteristics of the connection via the host virtual network adapter when the version of the virtual switch is changed. This supports the maintenance of the apparent connectivity for the host over the connection via the host virtual network adapter. For example, the host network adapter agent may be configured to save and retrieve state information for the connected host virtual network adapter, and / or save and retrieve state information for the host physical network adapter.
[0009] According to another aspect of the innovation described herein, in a computer system providing a virtual networking layer, an orchestration agent performs operations for servicing a virtual switch. The orchestration agent suspends network traffic through the virtual switch and, for each of the VMs connected to the virtual switch, saves state information of the VM network adapter for the connection between the VM and the virtual switch. The orchestration agent unloads a first version of the virtual switch from memory and loads a second version of the virtual switch into memory. For each of the VMs, the orchestration agent retrieves the state information of the VM network adapter for the connection between the VM and the virtual switch and restores the state of the VM network adapter. The orchestration agent then resumes network traffic through the virtual switch. In this way, for a VM, the apparent connectivity to the virtual switch can be maintained during virtual switch servicing.
[0010] The orchestration agent can also perform operations involving the host's physical network adapter. For example, before pausing network traffic through the virtual switch, the orchestration agent can save state information for the host's physical network adapter and release any hardware resources allocated from the host's physical network adapter for traffic acceleration. After loading a second version of the virtual switch into memory, the orchestration agent can retrieve the state information for the host's physical network adapter and restore the host's physical network adapter's state. After resuming network traffic through the virtual switch, the orchestration agent can bind to the host's physical network adapter, thereby enabling the allocation of hardware resources from the host's physical network adapter for traffic acceleration. In this way, for the host, the apparent connectivity to the virtual switch can be maintained during virtual switch maintenance.
[0011] According to another aspect of the innovation described herein, in a computer system providing a virtual networking layer, one or more service managers perform operations for configuring the virtual networking layer. The service managers load virtual switch agents into memory and load virtual switches into memory. The service managers register virtual switches with the virtual switch agents. For each of the multiple VMs, the service managers create a connection between the VM and the virtual switch. The service managers may also load host network adapter agents into memory and register virtual switches with the host network adapter agents. In this way, the service managers can initialize the virtual networking layer to perform operations for maintaining the virtual switches, as described above.
[0012] This invention can be implemented as part of a method, as part of a computer system configured to perform the method, or as part of a tangible computer-readable medium storing computer-executable instructions for causing the computer system to perform the method. Various ingenious methods can be used in combination or separately. This summary is provided to introduce the chosen concepts in a simplified form, which will be further described in the detailed description below. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. The foregoing and other objects, features, and advantages of the invention will become clearer from the following detailed description with reference to the accompanying drawings. Attached Figure Description
[0013] Figure 1 This is a diagram illustrating an example computer system in which some of the described embodiments may be implemented.
[0014] Figure 2 This is a diagram illustrating an example computer system using hardware virtualization.
[0015] Figure 3a , 3b Figures 4 and 5 are diagrams illustrating an example architecture that includes a network virtualization layer with virtual switches and virtual switch agents.
[0016] Figures 5a-5e It is a list of function prototypes, interfaces, parameters used in registration, and other structures for virtual switches and host network adapter proxies.
[0017] Figures 6a-6i It is a list of function prototypes, interfaces, parameters used in registration, and other structures for virtual switches and virtual switch proxies.
[0018] Figure 7a and 7b This is a flowchart illustrating an example technology for configuring a network virtualization layer with virtual switches and virtual switch agents.
[0019] Figure 8a and 8b This is a flowchart illustrating an example technology used for repairing virtual switches. Detailed Implementation
[0020] This document details various innovations for the maintenance of virtual switches within the virtual networking layer. Specifically, these innovations include a new architecture for the virtual networking layer and new operations performed when maintaining virtual switches. In some example implementations, state information defining various characteristics of the connection is preserved before unloading a previous version of the virtual switch and then used to restore the connection state after loading the current version of the virtual switch. Disruptions to actual network connectivity are minimal—below a timeout threshold representing a network connectivity failure. Depending on the implementation, these innovations can offer various advantages.
[0021] For example, apparent network connectivity for hosts can be maintained during virtual switch maintenance. During virtual switch maintenance, applications running on the hosts (e.g., monitoring applications, diagnostic applications) can continue to operate normally without loss of application state or data, and with minimal or no disruption to networking operations. Network traffic can be buffered in a virtual networking layer and then delivered normally during virtual switch maintenance.
[0022] As another example, from the host's perspective, the network adapter's state can appear operational during virtual switch maintenance. The host network adapter agent can be kept in memory during virtual switch maintenance, making the host appear to remain connected to the network adapter (via the virtual switch). Alternatively, the virtual switch agent can be kept in memory during virtual switch maintenance, making the host appear to remain connected to the network adapter (via the virtual switch). During virtual switch maintenance, applications running on the host do not need to perform any special actions to maintain network connectivity.
[0023] As another example, virtual switch maintenance can be performed without disabling the host physical network adapter. State information for the host physical network adapter can be saved and then retrieved for quick restoration of the host physical network adapter's state.
[0024] As another example, apparent network connectivity for VMs can be maintained during virtual switch maintenance. Applications running on VMs can continue to operate normally during virtual switch maintenance without loss of application state or data, and there is little or no disruption to networking operations. Network traffic can be buffered in a virtual networking layer and then delivered normally during virtual switch maintenance.
[0025] As another example, from the virtual machine's perspective, the network adapter can appear operational during virtual switch maintenance. A virtual switch agent can be kept in memory during virtual switch maintenance, allowing the VM to appear to remain connected to the network adapter (via the virtual switch). During virtual switch maintenance, applications running on the VM do not need to perform any special actions to maintain network connectivity.
[0026] As another example, VMs can continue to run during virtual switch maintenance. Even though the version of the virtual switch providing network connectivity is changed, VM pauses and restarts are still avoided.
[0027] As another example, the virtual switch maintenance process can be accelerated. By saving / retrieving state information in the virtual switch agent and / or host network adapter agent, the connection state of the virtual switch can be quickly restored without tearing down and recreating the connection. Furthermore, the time consumed by virtual switch maintenance can be reduced by releasing hardware resources allocated for traffic acceleration before virtual switch maintenance begins (while network traffic can still flow slowly through the virtual switch).
[0028] Therefore, when a virtual switch is under maintenance, connectivity to hosts, VMs, and physical network adapters can be maintained. Although some interruption occurs to actual network connectivity, apparent connectivity is maintained over these connections during virtual switch maintenance.
[0029] While the connection between a virtual switch and a network adapter (e.g., a virtual network adapter or a physical network adapter) can be direct, it typically traverses one or more layers of intermediate drivers. The connection between a virtual switch and a network adapter (e.g., a virtual network adapter or a physical network adapter) can utilize a logical communication channel between the virtual switch and the network adapter (such as a VM bus channel or other channels). The term "connection" does not indicate or imply a direct physical connection between the two connected components.
[0030] Various alternatives to the examples described herein are possible. For example, some methods described herein can be modified by changing the order of the described method actions, segmenting, repeating, or omitting certain method actions, etc. Various aspects of the disclosed techniques can be used in combination or individually. Different embodiments utilize one or more of the described innovations. Some of the innovations described herein solve one or more problems mentioned in the background art. Typically, a given technique / tool cannot solve all such problems.
[0031] I. Example computer system.
[0032] Figure 1 A general example of a suitable computer system (100) in which some of the innovations described herein can be implemented is shown. The innovations described herein relate to virtual switch repair. The computer system (100) is not intended to impose any limitations on its use or scope of function other than its use in virtual switch repair, as the invention can be implemented in a variety of computer systems, including dedicated computer systems adapted for networking and / or hardware virtualization.
[0033] refer to Figure 1 The computer system (100) includes one or more processing cores (110...11x) of a central processing unit (“CPU”) and local on-chip memory (118). The processing cores (110...11x) execute computer-executable instructions. The number of processing cores (110...11x) depends on the implementation and may be, for example, four or eight. The local memory (118) may be volatile memory (e.g., registers, cache, RAM), non-volatile memory (e.g., ROM, EEPROM, flash memory, etc.), or some combination of both that are accessible to the respective processing cores (110...11x).
[0034] Local memory (118) can store, in the form of computer-executable instructions, software (180) for a virtual networking layer that maintains apparent connectivity during virtual switch maintenance, for operation by the corresponding processing cores (110…11x). Figure 1 In this context, the local memory (118) is an on-chip memory, such as one or more caches, and the access and transfer operations of the processing core (110...11x) to this memory are relatively fast.
[0035] The computer system (100) may include a processing core (not shown) of a graphics processing unit (“GPU”) and local memory (not shown). The number of processing cores of the GPU depends on the implementation. Alternatively, the computer system (100) may include one or more processing cores of a system-on-a-chip (“SoC”), an application-specific integrated circuit (“ASIC”) or other integrated circuit, and associated memory. The processing cores(s) may execute one or more innovative computer-executable instructions for virtual switch maintenance.
[0036] The computer system (100) includes shared memory (120), which may consist of volatile memory (e.g., RAM), non-volatile memory (e.g., ROM, EEPROM, flash memory, etc.) accessible to the processing core(s), or some combination thereof. Memory (120) stores software (180) implemented in the form of computer-executable instructions to maintain apparent connectivity of the virtual networking layer during maintenance of the virtual switch. Figure 1 In the process, the shared memory (120) is an off-chip memory, and the access and transfer operations of the processing core to this memory are relatively slow.
[0037] The computer system (100) includes one or more network adapters (140). As used herein, the term network adapter refers to any network interface card (“NIC”), network interface, network interface controller, or network interface device. Typically, a network adapter supports communication at both the data link layer and the physical layer. Depending on its role, a network adapter can be software (e.g., a VM network adapter or a host virtual network adapter) or hardware (e.g., a host physical network adapter). The network adapters (140) enable communication with another computing entity (e.g., a server, other computer system) over a network. The network can be a wide area network (WAN), a local area network (LAN), a storage area network (SLAN), or another type of network. The network adapters (140) can support wired and / or wireless connections for WANs, LANs, SLANs, or other networks. For example, the network adapters (140) can include one or more Wi-Fi transceivers, Ethernet ports, cellular transceivers, and / or another type of network adapter, along with associated drivers, software, etc. The network adapters (140) transmit data via modulated data signals over the network connections. A modulated data signal is a signal whose one or more characteristics are set or altered in a way that allows information to be encoded in the signal. As an example and not a limitation, network connections may use electrical, optical, RF, or other carrier waves.
[0038] The computer system (100) also includes one or more input devices (150). The input devices may be touch input devices such as a keyboard, mouse, pen or trackball, scanning devices, or other devices that provide input to the computer system (100). The computer system (100) may also include camera input, audio input, motion sensor / tracker input, game controller input, media player and / or video input.
[0039] The computer system (100) includes one or more output devices (160). The output devices (160) may be a printer, a CD burner, or another device that provides output from the computer system (100). Video output may provide video output to a display device. Audio output may provide audio output to one or more speakers.
[0040] The storage device (170) may be removable or non-removable and includes magnetic media (such as disks, magnetic tapes, or cassette tapes), optical disc media, and / or any other media that can be used to store information and can be accessed within the computer system (100). The storage device (170) stores instructions for implementing software (180) for maintaining apparent connectivity of the virtual networking layer during maintenance of the virtual switch.
[0041] Interconnection mechanisms (not shown), such as buses, controllers, or networks, enable the interconnection of components of the computer system (100). Typically, operating system software (not shown) provides an operating environment for other software executing in the computer system (100) and coordinates the activities of the components of the computer system (100).
[0042] Figure 1 The computer system (100) is a physical computer system (e.g., for a host computer system). Virtual machines may include, for example, Figure 1 The components of the organization shown.
[0043] This invention can be described in the general context of computer-readable media. A computer-readable medium is any available tangible medium that can be accessed within a computing environment. By way of example and not limitation, for a computer system (100), a computer-readable medium includes memories (118, 120), storage devices (170), and combinations thereof. The term computer-readable medium does not include transient propagating signals or carrier waves.
[0044] Innovations can be described within the general context of computer-executable instructions executed on a computer system targeting a real or virtual processor. Computer-executable instructions can include instructions executable on the processing core of a general-purpose processor to provide the functionality described herein, instructions executable to control a GPU or dedicated hardware to provide the functionality described herein, instructions executable on the processing core of a GPU to provide the functionality described herein, and / or instructions executable on the processing core of a dedicated processor to provide the functionality described herein. In some implementations, computer-executable instructions can be organized within program modules. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., that perform specific tasks or implement specific abstract data types. In various embodiments, the functionality of program modules can be combined or divided among program modules as desired. The computer-executable instructions for program modules can execute within a local or distributed computer system.
[0045] Typically, a computer system or device can be local or distributed, and can include dedicated hardware and / or any combination of hardware and software that implements the functions described herein. For presentation purposes, detailed descriptions use terms such as “determine,” “receive,” and “provide” to describe computer operations within a computer system. These terms indicate operations performed by a computer and should not be confused with actions performed by humans. The actual computer operations corresponding to these terms depend on the implementation.
[0046] II. Example architecture for hardware virtualization.
[0047] This section describes an example architecture for hardware virtualization. Figure 2A computer system (200) using hardware virtualization is shown. The computer system (200) includes a user-mode software layer (210), a kernel-mode software layer (220), a virtualization layer (230), and physical hardware (240).
[0048] Physical hardware (240) includes various types of hardware devices. For example, physical hardware (240) includes a processing core, memory, storage devices, one or more network adapters, input devices, and / or output devices, as described in the reference. Figure 1 The computer system (100) described herein. In particular, the physical hardware (240) includes at least one host physical network adapter that is configurable to connect to an external network, which may be a wide area network, a local area network, a storage area network, or another network.
[0049] The virtualization layer (230) is a software layer that runs between the physical hardware (240) and the OS running in the partition. The virtualization layer (230) abstracts away the low-level details of the physical hardware (240) of the computer system (200). The virtualization layer (230) presents the computer system's (200) input devices, output devices, network adapters, and other hardware devices as resources that can be used from the partition. The virtualization layer (230) similarly hides the details of the processing kernel, memory, and storage devices, rather than presenting system resources that can be allocated to the partition.
[0050] Through the virtualization layer (230), the computer system (200) supports multiple partitions, which are isolated execution environments. The partitions include a host (parent or root) partition (shown as partition 0) and multiple guest (child) partitions (shown as partitions 1…n). The virtualization layer (230) provides each partition with a set of virtualized resources, such as memory, processing cycles, input devices, output devices, network adapters, etc. The virtualization layer (230) can manage policies for accessing resources from different partitions.
[0051] The host partition includes software for the host that manages the resources of the computer system (200) and controls how the virtualization layer (230) is used in other partitions. The host partition is responsible for booting the virtualization layer (230) and creating guest partitions. Typically, the host has privileged access to the physical hardware (240) of the computer system (200) for at least some types of resources. The host is sometimes referred to as the management OS, control program, virtual machine monitor, or host software.
[0052] Each guest partition includes a virtual machine (“VM”), which is a simulated computer environment in which guest software executes. For example, a VM is a virtual guest computer that is implemented in software and hosted in a guest partition. Each VM executes in a different guest partition. Typically, a VM simulates a complete computer system in an isolated environment within the guest partition. A VM may host a guest OS, on which applications run. Typically, a VM has non-privileged access to the physical hardware (240) resources of the computer system (200), rather than direct access. Guest software in a VM can use virtualized resources (230) exposed through a virtualization layer. When guest software in a VM uses virtualized resources, requests can be directed to the host, which mediates access to physical hardware resources (240).
[0053] In partition 0, the kernel-mode software layer (220) includes drivers and resources for managing the OS. Some drivers / resources are used to access the physical hardware (240) of the computer system (200). Other drivers / resources in partition 0 interact with the virtualization layer (230) to mediate access to the resources of the computer system (200), or with drivers / resources in partitions 1 through n. Specifically, for partition 0, the drivers / resources of the kernel-mode software layer (220) include network protocol drivers (e.g., for TCP / IP) and virtual networking layer components (such as virtual network adapters, virtual switches, virtual switch agents, host network adapter agents, and / or host physical network adapter drivers).
[0054] In each of partitions 1 through n, the kernel-mode software layer (220) includes drivers and resources for the guest OS of the VM. In partitions 1 through n, the drivers / resources interact with the virtualization layer (230) to request and use resources of the computer system (200) (as exposed through the virtualization layer (230)) or with drivers / resources in partition 0. Specifically, for partitions 1 through n, the drivers / resources of the kernel-mode software layer (220) include network protocol drivers (e.g., for TCP / IP) and virtual networking layer components (such as VM network adapters and / or network virtual service clients).
[0055] Conceptually, there are some similarities between the kernel-mode software layer (220) and the virtualization layer (230). Both layers abstract away the low-level details of resources and present access to these resources to higher-level components. However, typically, the drivers / resources of the kernel-mode software layer (220) are assigned to a specific partition and execute within that partition (although drivers / resources in the virtual networking layer support some form of inter-partition communication). The virtualization layer (230) supports communication between the host and VMs in different partitions.
[0056] The user-mode software layer (210) includes software that runs in the partition and uses the drivers / resources of the kernel-mode software layer (220). In partitions 1 through n, the user-mode software layer (210) includes arbitrary applications that execute in the VM. These applications execute as if they were running directly on the physical hardware, although there are some restrictions on accessing system resources. In partition 0, the user-mode software layer (210) includes arbitrary applications that execute on behalf of the host, as well as services, agents, etc.
[0057] III. Example architecture for the virtual networking layer.
[0058] This section describes example architectures of a virtual networking layer in which virtual switches can be effectively repaired. Depending on the configuration, the virtual networking layer can connect one or more virtual machines (“VMs”) to a host and / or an external network. In some example architectures, the virtual networking layer includes a virtual switch and a virtual switch agent. In other example architectures, the virtual networking layer includes a virtual switch, a virtual switch agent, and a host network adapter agent.
[0059] A. Example virtual switch.
[0060] A physical network switch has multiple ports and routes traffic from any one port to any other port on the network switch. Similarly, a virtual switch in a virtual networking layer is able to route traffic from one port of the virtual switch to another port on the virtual switch. Typically, a virtual switch can route traffic from any port on the virtual switch to any other port on the virtual switch; however, alternatively, certain portions can be isolated or decoupled from other ports. In some configurations, one port of the virtual switch is connected to a physical network adapter, which is connected to an external network, while the other ports of the virtual switch are connected to VMs. VMs connect to the virtual switch via virtual network adapters (VM network adapters). In some example implementations, the VM network adapter has a Media Access Control (“MAC”) address. In this way, the virtual switch allows a single physical network adapter to provide network connectivity for any number of VMs. By forwarding packets to the target virtual switch, a VM can send packets to a host (via the virtual network adapter for the host), send packets to another VM (via the VM network adapter for that VM), or send packets over an external network (via the physical network adapter).
[0061] A virtual switch can be connected to a host, enabling the host to communicate with VMs and / or connect to external networks. The host connects to the virtual switch via a virtual network adapter (host virtual network adapter). In some example implementations, the host virtual network adapter has a MAC address. By forwarding packets to the target virtual switch, the host can send packets to VMs (via the VM network adapter for the VM) or to external networks (via a physical network adapter).
[0062] Virtual switches, for example, use MAC addresses to process packets and forward them to their destinations, performing basic routing functions as switches (or hubs or bridges). This provides "Layer 2" functionality according to the OSI network stack model. In some example implementations, virtual switches can also function as routers, providing "Layer 3" functionality according to the OSI network stack model.
[0063] In some example implementations, the virtual switch is extensible. Switch extensions are filter drivers attached to the virtual switch. The virtual switch can include extensions that perform other functions, such as capturing network traffic, filtering network traffic, monitoring network traffic, or forwarding network traffic (to virtual or physical network adapters connected to the virtual switch port).
[0064] In some example implementations, a virtual switch can be configured to function as a private virtual switch, an internal virtual switch, or an external virtual switch. If a virtual switch is configured as a private virtual switch, then (a) each of at least two ports of the virtual switch is connected to a different VM, (b) all ports of the virtual switch are not connected to an external network, and (c) all ports of the virtual switch are not connected to a host. A private virtual switch allows network traffic to be exchanged between any two VMs (not the host or an external network). If a virtual switch is configured as an internal virtual switch, then (a) each of at least one port of the virtual switch is connected to a different VM, (b) all ports of the virtual switch are not connected to an external network, and (c) the virtual switch is connected to a host via a host virtual network adapter. An internal virtual switch allows network traffic to be exchanged between any two VMs or between any VM and a host (not the external network). If a virtual switch is configured as an external virtual switch, then (a) each of at least one port of the virtual switch is connected to a different VM, (b) one of the ports of the virtual switch is connected to an external network via a host physical network adapter, and (c) the virtual switch can be connected to a host via a host virtual network adapter. An external virtual switch allows network traffic to be exchanged between any two VMs, between any VM and a host, between any VM and an external network, or between a host and an external network.
[0065] B. Example virtual networking layer with virtual switch agent.
[0066] This section describes an example architecture for a virtual networking layer with a virtual switch agent. Figure 3a In the example architecture (301), the virtual switch (350) supports network operations for hosts and multiple VMs running in different partitions. The host runs in partition 0, and the VMs run in partitions 1 through n respectively.
[0067] One or more applications (310) run in the host partition. The applications (310) may include applications that monitor the activity of agents, diagnostic applications, and / or check the activity of applications in the host and guest partitions, and that report “liveliness” updates to a central server. The applications (310) may also include another arbitrary application.
[0068] Multiple applications (310) are bound to a network stack (320). The network stack (320) provides networking services to the multiple applications (310), implementing one or more networking protocols (e.g., TCP / IP, UDP / IP, or other combinations of transport and network protocols). The network stack (320) is bound to a host virtual network adapter (330). For example, the host virtual network adapter (330) is a host virtual NIC.
[0069] The host virtual network adapter (330) operates within the host partition. When the virtual switch (350) is connected to an external network, the host virtual network adapter (330) can be bound to the host physical network adapter (360). In this configuration, the host virtual network adapter (330) emulates the host physical network adapter (360) and forwards packets to and from either the host physical network adapter (360) or the VM network adapters (331…33n) via the virtual switch (350). Alternatively, the host virtual network adapter (330) can be bound to an intermediate driver (e.g., an NDIS multiplexer) that is bound to a group of one or more physical network adapters represented by the host physical network adapter (360). In this configuration, the extension of the virtual switch (350) is exposed to each network adapter in the group, and the network adapters in the group can potentially be managed. When the virtual switch (350) is not connected to an external network, the host virtual network adapter (330) is not bound to the host physical network adapter (360), but it can still be used to forward packets through the virtual switch (350) to one of the VM network adapters (331...33n) and from one of the VM network adapters (331...33n).
[0070] Within the host partition, one or more other host services, processes, and / or agents (339) run. For example, one or more service managers running in the host partition can be configured to perform operations for configuring the virtual networking layer—loading a virtual switch agent (340) (e.g., as a boot driver), loading a virtual switch (350) (e.g., as an auto-start driver), registering the virtual switch (350) with the virtual switch agent (340), and creating a connection between the virtual switch (350) and the VM. The service managers (multiple) can be host OS components. Further details regarding example operations for configuring the virtual networking layer can be found in section V.
[0071] As another example, an orchestration agent running in a host partition can be configured to perform operations (350) for servicing a virtual switch. The orchestration agent can run scripts that specify the operations (350) for servicing the virtual switch. Depending on the implementation, various agents, engines, etc., can run scripts. Further details regarding example operations for servicing a virtual switch (350) can be found in section VI.
[0072] As another example, virtual machine management services, hypervisor networking service agents, or other control agents can run on the host partition. Typically, such services / agents control the behavior of VMs and other aspects of virtualization.
[0073] One or more applications (311…31n) run in each of the guest partitions. The applications (311…31n) can include any application. In each guest partition, the applications (311…31n) are bound to a network stack (321…32n) that provides networking services to the applications (311…31n), implementing one or more networking protocols (e.g., TCP / IP, UDP / IP, or other combinations of transport and network protocols). In each guest partition, the network stack (321…32n) is bound to a VM network adapter (331…33n). For example, the VM network adapter (331…33n) is a VM NIC. In each guest partition, the VM network adapter (331…33n) is exposed in the guest OS running in the guest partition. VM network adapters (331…33n) can emulate physical network adapters to forward packets to and from ports of the virtual switch (350), for example, via VM bus channels. VM network adapters can be configured to access the virtual switch (350) regardless of whether the virtual switch (350) is configured to operate as an external, internal, or private virtual switch.
[0074] The virtual switch agent (340) is a thin software layer that executes within the host partition. The virtual switch agent (340) manages network adapters (e.g., VM network adapters, host virtual network adapters) connected to the ports of the virtual switch (350) on behalf of the virtual switch (350). For each of the VMs, the virtual switch agent (340) is configured to mediate data transfers via a connection between the VM and the virtual switch (350) through one of the VM network adapters (331…33n). (Because the virtual switch agent (340) mediates the data transfers, the data itself does not actually need to be passed through the virtual switch agent (340).) For example, the connection between the VM and the virtual switch (350) uses a channel between the virtual switch (350) and the VM.
[0075] In some example implementations, a virtual switch agent (340) is loaded as a driver and registers itself as a virtual switch in the system. The virtual switch agent (340) operates as part of kernel mode. Other components (e.g., running in user mode) can send input / output control (“IOCTL”) calls to the virtual switch agent (340), which is registered as a virtual switch in the system, and the virtual switch agent (340) will pass the IOCTL calls to the virtual switch (350) if the virtual switch (350) is registered. (The virtual switch agent (340) may ignore IOCTL calls before the virtual switch (350) is registered or during virtual switch maintenance.) Alternatively, after the virtual switch (350) is registered, the virtual switch agent (340) may delegate the processing of IOCTL calls to another entity.
[0076] However, if the virtual switch agent (340) is already loaded, it remains loaded in memory during virtual switch maintenance to maintain the existence of network interfaces and preserve network connectivity for applications running in the host and guest partitions. During virtual switch maintenance, the network stacks (321…32n) in the guest partition can remain bound to the VM network adapters (331…33n) in the guest partition. The virtual switch agent (340) is configured to retain state information for each VM (multiple VMs) when the virtual switch version changes, defining the characteristics of connections made through the corresponding VM network adapters (331…33n). This supports maintaining the apparent connectivity of VMs over connections made through VM network adapters (331…33n). For example, the virtual switch agent (340) can be configured to save and retrieve state information for connected VM network adapters. Such state information can be used to restore the state of the VM network adapters. As another example, the virtual switch agent (340) can be configured to save and retrieve state information of the channel between the virtual switch and the VM. This state information can be used to restore the channel's state. In this way, the VM can continue to run during virtual switch maintenance.
[0077] The virtual switch (350) also operates within the host partition. The virtual switch (350) is configured to transfer data between multiple ports of the virtual switch. For example, the virtual switch (350) can operate as described in section III.A. The virtual switch (350) can be connected to the virtual switch agent (340) via one or more dedicated interfaces.
[0078] The host physical network adapter (360) connects to an external network and can represent a single network adapter, a network switch, or a group of network adapters. The host physical network adapter (360) can also connect to a port of a virtual switch (350). The host physical network adapter (360) can be bound to a host virtual network adapter (330). Alternatively, if the host physical network adapter (360) represents a group of network adapters, the host virtual network adapter (330) can be bound to an intermediate driver that is bound to the host physical network adapter (360) (representing the group).
[0079] exist Figure 3aIn the example architecture (301), the virtual switch agent (340) is also configured to mediate data transfer between the host and the virtual switch (350) over the connection via the host virtual network adapter (330) for hosts connected to the virtual networking layer. (Since the virtual switch agent (340) mediates data transfer, data does not actually need to be transferred through the virtual switch agent (340).) When the version of the virtual switch (350) is changed, the virtual switch agent (340) retains state information that defines the characteristics of the connection over the host virtual network adapter (330). This supports the maintenance of the apparent connectivity for the host over the connection via the host virtual network adapter (330). For example, the virtual switch agent (340) can be configured to save and retrieve state information for the connected host virtual network adapter. Such state information can be used to restore the state of the host virtual network adapter. As another example, the virtual switch agent (340) can be configured to save and retrieve state information for the host physical network adapter (360). Such state information can be used to restore the state of the host physical network adapter (360). Conversely, in Figure 3b In the example architecture (302), different components mediate data transmission through the connection between the host and the virtual switch, and retain state information that defines the characteristics of the connection when the version of the virtual switch is changed.
[0080] exist Figure 3a In the example architecture (301), both the host partition and the guest partition are connected to the same virtual switch (350) that targets the same host physical network adapter (360). Alternatively, different partitions can be connected to different virtual switches, and each virtual switch can be used for a different host physical network adapter, or there may be no host physical network adapter. A given partition can be connected to multiple different virtual switches.
[0081] C. An example virtual networking layer with virtual switch agents and host network adapter agents.
[0082] This section describes an example architecture for a virtual networking layer with virtual switch agents and host network adapter agents. Figure 3b In the example architecture (302), the virtual switch (350) supports networking operations for hosts and multiple VMs running in different partitions. The host runs in partition 0, and the VMs run in partitions 1 through n respectively.
[0083] One or more applications (310) run in the host partition and are bound to the network stack (320), as referenced. Figure 3a The example architecture (301) is described. The network stack (320) is bound to the host network adapter agent (349).
[0084] The host network adapter agent (349) is an agent for the host virtual network adapter (351), which is implemented as part of a virtual switch (352). In some example implementations, the host virtual network adapter (351) and the virtual switch (352) are part of the same binary. When the virtual switch (352) is connected to an external network, the host virtual network adapter (351) can be bound to the host physical network adapter (360). In this configuration, the host virtual network adapter (351) emulates the host physical network adapter (360) and forwards packets to and from one of the host physical network adapter (360) or VM network adapters (331...33n) via the virtual switch (352). Alternatively, the host virtual network adapter (351) can be bound to an intermediate driver (e.g., an NDIS multiplexer) that is bound to a group or more physical network adapters represented by the host physical network adapter (360). In this configuration, the extension of the virtual switch (352) is exposed to each network adapter in the group, and the network adapters in the group can be potentially managed. When the virtual switch (352) is not connected to an external network, the host virtual network adapter (351) is not bound to the host physical network adapter (360), but can still be used to forward packets to and from one of the VM network adapters (331...33n) via the virtual switch (352).
[0085] Within the host partition, one or more other host services, processes, and / or agents (339) run. For example, one or more service managers running in the host partition may be configured to perform operations for configuring the virtual networking layer—loading the virtual switch agent (341) and the host network adapter agent (349) (e.g., as a boot driver), loading the virtual switch (352) (e.g., as an auto-start driver), registering the virtual switch (352) with the virtual switch agent (340), registering the virtual switch (352) with the host network adapter agent (349), and creating a connection between the virtual switch (352) and the VM. The service managers (multiple) may be host OS components. Further details regarding example operations for configuring the virtual networking layer can be found in section V. Alternatively, as another example, other host services, processes, and / or agents (339) may include an orchestration agent that may perform operations for servicing the virtual switch (352), as described in section VI.
[0086] Each of the guest partitions 1 through n includes one or more applications (311 through 31n), a network stack (321 through 32n), and a VM network adapter (331 through 33n), as shown in the reference. Figure 3a The example architecture (301) is described.
[0087] The virtual switch agent (341) is a thin software layer that executes within the host partition. The virtual switch agent (341) manages the network adapters (e.g., VM network adapters) connected to the ports of the virtual switch (352) on behalf of the virtual switch (352). For each of the (multiple) VMs, the virtual switch agent (341) is configured to mediate data transfers between the VM and the virtual switch (352) over one of the VM network adapters (331…33n). (Because the virtual switch agent (341) mediates data transfers, data does not actually need to be passed through the virtual switch agent (341).) For example, the connection between the VM and the virtual switch (352) uses a channel between the virtual switch (352) and the VM.
[0088] In some example implementations, a virtual switch agent (341) is loaded as a driver and registers itself as a virtual switch in the system. The virtual switch agent (341) operates as part of kernel mode. Other components (e.g., running in user mode) can send IOCTL calls to the virtual switch agent (341), which is registered as a virtual switch in the system, and the virtual switch agent (341) relays the IOCTL calls to the virtual switch (352) once the virtual switch (352) is registered. (The virtual switch agent (341) may ignore IOCTL calls before the virtual switch (352) is registered or during virtual switch maintenance.) Alternatively, after the virtual switch (352) is registered, the virtual switch agent (341) may delegate the processing of IOCTL calls to another entity.
[0089] However, if the virtual switch agent (341) is already loaded, it remains loaded in memory during virtual switch maintenance to maintain the existence of network interfaces and network connectivity for applications running in the guest partition. During virtual switch maintenance, the network stacks (321…32n) in the guest partition can remain bound to the VM network adapters (331…33n) in the guest partition. The virtual switch agent (341) is configured to retain state information, as referenced in the documentation, for each VM in the VM(s) when the virtual switch version changes, defining the characteristics of connections made via the VM network adapters (331…33n) for the VM(s). Figure 3a The virtual switch agent (340) is described. This supports maintaining the apparent connectivity for VMs over the connection via VM network adapters (331...33n). In this way, VMs can continue to operate during virtual switch maintenance.
[0090] A virtual switch (352) also operates within the host partition. The virtual switch (352) is configured to transfer data between multiple ports of the virtual switch. For example, the virtual switch (352) can operate as described in section III.A. The virtual switch (352) can also be connected to a virtual switch agent (341) via one or more dedicated interfaces. The virtual switch (352) can also be connected to a host network adapter agent (349) via one or more dedicated interfaces.
[0091] The host network adapter agent (349) is another thin software layer that executes within the host partition. The host network adapter agent (349) manages network adapters (e.g., host virtual network adapters) on behalf of the virtual switch (352). For the host, the host network adapter agent (349) is configured to mediate data transfers over the connection between the host and the virtual switch (352) via the host virtual network adapter (351). (Because the host network adapter agent (349) mediates data transfers, data does not actually need to be transferred through the host network adapter agent (349).)
[0092] In some example implementations, the host network adapter agent (349) is loaded as a driver and registers itself in the system as a miniature port driver representing the virtual switch (352). The host network adapter agent (349) operates as part of kernel mode. The host network adapter agent (349) helps maintain state information for the host virtual network adapter (351) and the corresponding host physical network adapter (360) during virtual switch maintenance.
[0093] However, if the host network adapter agent (349) is already loaded, it remains loaded in memory during virtual switch maintenance to maintain the existence of network interfaces and network connectivity for applications running in the host partition. During virtual switch maintenance, the network stack (320) in the host partition can remain bound to the host network adapter agent (349). The host network adapter agent (349) is configured to retain state information for the host when the virtual switch version changes, defining the characteristics of the connection via the host virtual network adapter (351) for the host. This supports the maintenance of apparent connectivity for the host over the connection via the host virtual network adapter (351). For example, the host network adapter agent (349) can be configured to save and retrieve state information for the connected host virtual network adapter (351). Such state information can be used to restore the state of the host virtual network adapter (351). As another example, the host network adapter agent (349) can be configured to save and retrieve state information for the host physical network adapter (360). This status information can be used to restore the status of the host's physical network adapter (360). In this way, the host can continue to operate during virtual switch maintenance.
[0094] The host physical network adapter (360) connects to the external network and can represent a single network adapter, a network switch, or a group of network adapters, as shown in the reference. Figure 3a The example architecture (301) is described.
[0095] exist Figure 3b In the example architecture (302), both the host partition and the guest partition are connected to the same virtual switch (352) that targets the same host physical network adapter (360). Alternatively, different partitions can be connected to different virtual switches, and each virtual switch can be used for a different host physical network adapter, or there may be no host physical network adapter. A given partition can be connected to multiple different virtual switches.
[0096] D. Example architecture and interface of a virtual networking layer with virtual switch agent and host network adapter agent.
[0097] This section describes another example architecture and interface for a virtual networking layer with virtual switch agents and host network adapter agents. Figure 4 In the example architecture (400), the virtual switch (441) supports networking operations for hosts and multiple VMs running in different partitions. The host runs in partition 0, and multiple VMs run in partitions 1 through n respectively. For simplicity, Figure 4The example shows a partition (partition n), but the example architecture (400) can be extended to any number of partitions, such as partition n.
[0098] One or more applications (410) run in the host partition. The applications (410) may include applications that monitor the activity of agents, diagnostic applications, and / or check the activity of applications in the host and guest partitions, and that report “activity” updates to a central server. The applications (410) may also include another arbitrary application.
[0099] Multiple applications (410) are bound to a network stack (420). The network stack (420) provides networking services to the multiple applications (410), implementing one or more networking protocols (e.g., TCP / IP, UDP / IP, or other combinations of transport and network protocols). The network stack (420) is bound to a host network adapter agent (432).
[0100] Within the host partition, one or more other host services, processes, and / or agents run. For example, the Virtual Machine Management Service (“VMMS”) (429), the HyperManager Networking Service agent, or other control agents may run in the host partition. Typically, such services / agents control the behavior of the VMs and other aspects of virtualization. The host partition includes a VM worker process (“VMWP”) (428) for each VM, which manages various aspects of the VM. The VMWP (428) starts a virtual motherboard and virtual BIOS for the VM. For connections between the virtual switch (441) and the VM, the VMWP (428) starts a network VSC (44n) in the guest partition for the VM.
[0101] As another example, one or more service managers running in the host partition can be configured to perform operations for configuring the virtual networking layer—loading the virtual switch agent (430) and the host network adapter agent (432) (e.g., as a boot driver), loading the virtual switch (e.g., as an auto-start driver), registering the virtual switch (441) to the virtual switch agent (430), registering the virtual switch (441) to the host network adapter agent (432), and creating a connection between the virtual switch (441) and the VM. The service managers (multiple) can be host OS components. Further details regarding example operations for configuring the virtual networking layer can be found in section V.
[0102] As another example, an orchestration agent (427) running in a host partition can be configured to perform operations (441) for servicing a virtual switch. The orchestration agent can run a script that specifies the operations (441) for servicing the virtual switch. Depending on the implementation, various agents, engines, etc., can run scripts. Further details regarding example operations for servicing a virtual switch (441) can be found in section VI.
[0103] One or more applications (41n) run in guest partition n. The applications (41n) can include any application. In guest partition n, the applications (41n) are bound to a network stack (42n) that provides networking services to the applications (41n), implementing one or more networking protocols (e.g., TCP / IP, UDP / IP, or other combinations of transport and network protocols). In guest partition n, the network stack (42n) is bound to a VM network adapter (43n). For example, the VM network adapter (43n) is a VM NIC. The VM network adapter (43n) is exposed in the guest OS running in the guest partition. The VM network adapter (43n) can emulate a physical network adapter to forward packets to and from ports of a virtual switch (441), for example, via a VM bus channel (46n). The VM network adapter can be configured to access the virtual switch (441), regardless of whether the virtual switch (441) is configured to operate as an external virtual switch, an internal virtual switch, or a private virtual switch.
[0104] The network VSC (44n) runs in the guest OS of the guest partition n. The network VSC (44n) exposes the VM network adapter (43n) to the guest software in VM n. By default, the network VSC (44n) connects to a port of the virtual switch (441) to send packets to or receive packets from the virtual switch (441). Specifically, the network VSC (44n) connects to the virtual switch (441) via a VM bus channel (46n) to a network virtual service provider (“VSP”). The network VSP runs in the host partition and includes the virtual switch (441), thus providing maintenance to support networking access by VMs in the guest partition. In this way, the network VSC (44n) can deliver packets to the host, another VM, or an external network. (In alternative mode, the network VSC (44n) can connect to the virtual function of the host physical network adapter (470) and send / receive packets directly through the physical network adapter (470). In this alternative mode, the NIC switch on the physical network adapter (470) can bridge network traffic between the virtual function and the adapter's physical network interface.)
[0105] The channel client library (465) provides services to network VSPs and network VSCs (44n) for creating VM bus channels. A VM bus channel is a virtual communication bus that can transfer control and data messages between host partitions and guest partitions. Specifically, the VM bus channel transfers control and data messages between the network VSP of the host partition and the network VSC of the guest partition. Figure 4 The VM bus channel (46n) between the virtual switch agent (441) of the network VSP in the host partition and the network VSC (44n) in the guest partition n is shown. Different VM bus channels can similarly pass control and data messages between the host partition and each other guest partition.
[0106] The channel client library (465) exposes a callback interface that can be invoked to mediate data transfers over the VM bus channel. For example, the callback interface exposed by the channel client library (465) is a public interface. Functions of the callback interface can be called by wrapper functions implemented in the virtual switch agent (430), such as... Figure 6c and 6d The function pointer to this function can be provided to the virtual switch agent (430) when the virtual switch (441) registers with the virtual switch agent (see also: Figure 6e and 6h To mediate data transfers via the connection between the virtual switch (441) and VMn, the virtual switch agent (430) can be configured to call the target function of the callback interface implemented by the channel client library (465). When the version of the virtual switch (441) is changed, the function pointer to the target function of the callback interface implemented by the channel client library (465) can be preserved. The target function of the callback interface implemented by the channel client library (465) can also be called from the network VSC (44n).
[0107] The virtual switch agent (430) is a thin software layer that executes within the host partition. The virtual switch agent (430) manages network adapters (e.g., VM network adapters) connected to ports of the virtual switch (441) on behalf of the virtual switch (441). For VM n, the virtual switch agent (430) is configured to mediate data transfer between the VM and the virtual switch (441) over the connection via the VM network adapter (43n). (Because the virtual switch agent (430) mediates data transfer, data does not actually need to be passed through the virtual switch agent (430).) Figure 4 In this configuration, the connection between VM n and the virtual switch (441) uses the VM bus channel (46n).
[0108] In some example implementations, a virtual switch agent (430) is loaded as a driver and registers itself as a virtual switch in the system. The virtual switch agent (430) operates as part of kernel mode. Other components (e.g., running in user mode) can send IOCTL calls to the virtual switch agent (430), which is registered as a virtual switch in the system, and the virtual switch agent (430) relays the IOCTL calls to the virtual switch (441) if the virtual switch (441) is registered. (The virtual switch agent (430) can ignore IOCTL calls before the virtual switch (441) is registered or during virtual switch maintenance.) Alternatively, after the virtual switch (441) is registered, the virtual switch agent (430) can delegate the processing of IOCTL calls to another entity.
[0109] However, if the virtual switch agent (430) is already loaded, it remains loaded in memory during virtual switch maintenance to maintain the existence of network interfaces and network connectivity for applications running in the guest partition. During virtual switch maintenance, the network stack (42n) in guest partition n can remain bound to the VM network adapter (43n) in the guest partition. The virtual switch agent (430) is configured to retain state information defining the characteristics of connections made via the VM network adapter (43n) for each VM(s) when the version of the virtual switch (441) is changed. This supports the maintenance of apparent connectivity for VMs over connections made via the VM network adapter (43n). For example, the virtual switch agent (430) can be configured to save and retrieve state information for connected VM network adapters (43n). Such state information can be used to restore the state of the VM network adapter (43n). As another example, the virtual switch agent (430) can be configured to save and retrieve the status information of the VM bus channel (46n) between the virtual switch (441) and the network VSC (44n) for the VM. This status information can be used to restore the state of the VM bus channel (46n). In this way, VM n can continue to operate during virtual switch maintenance.
[0110] A virtual switch (441) also operates within the host partition. The virtual switch (441) is configured to transfer data between multiple ports of the virtual switch. For example, the virtual switch (441) can operate as described in section III.A. The virtual switch (441) includes one or more extensions (449) that can operate as described in section III.A. The virtual switch (441) can be connected to a virtual switch agent (430) via one or more dedicated interfaces.
[0111] For example, the virtual switch agent (430) can implement functions of the callback interface that the virtual switch (441) can call, such as Figure 6f As shown. When the virtual switch (441) registers with the virtual switch agent (430), the virtual switch agent (430) can provide the virtual switch (441) with function pointers for such functions, such as Figure 6g and 6i As shown. For example, these functions may include: (a) a function for unregistering the virtual switch (441) from the virtual switch agent (430), (b) a function for setting the maintenance status of the virtual switch (441), (c) a function for obtaining the maintenance status of the virtual switch (441), (d) a function for requesting channel allocation, (e) a function for requesting channel cleanup, and / or (f) a function for providing channel callbacks. The virtual switch agent (430) may also implement encapsulated functions (see... Figures 6c-6d The encapsulated function calls the target function of the callback interface implemented by the channel client library (465). Alternatively, the virtual switch agent (430) can implement other functions and / or additional functions of the callback interface that can be called by the virtual switch (441).
[0112] As another example, the virtual switch (441) can implement functions of the callback interface that the virtual switch agent (430) can call, such as Figure 6b As shown. When the virtual switch (441) registers with the virtual switch agent (430), the virtual switch (441) can provide the virtual switch agent (430) with function pointers for functions such as... Figure 6e and 6h As shown. For example, for a device associated with the host physical network adapter (470), these functions may include: (a) a function for requesting the processor to create, (b) a function for requesting the processor to shut down, (c) a function for requesting a read operation, (d) a function for requesting a write operation, and / or (e) a function for requesting an internal device control operation. Alternatively, the virtual switch (441) may implement other functions and / or additional functions of the callback interface that can be called by the virtual switch agent (430).
[0113] The host network adapter agent (432) is another thin software layer that executes within the host partition. The host network adapter agent (432) manages the host virtual network adapter (442) on behalf of the virtual switch (441). The host network adapter agent (432) is an agent for the host virtual network adapter (442), which is implemented as part of the virtual switch (441). In some example implementations, the host virtual network adapter (442) and the virtual switch (441) are part of the same binary. When the virtual switch (441) is connected to an external network, the host virtual network adapter (442) can bind to the host physical network adapter (470). In this configuration, the host virtual network adapter (442) emulates the host physical network adapter (470) and forwards packets to and from the host physical network adapter (470) or VM network adapter (43n) via the virtual switch (441). Alternatively, the host virtual network adapter (442) can be bound to an intermediate driver (e.g., an NDIS multiplexer) that is bound to a group of one or more physical network adapters represented by the host physical network adapter (470). In this configuration, an extension (449) to the virtual switch (441) is exposed to each network adapter in the group and can potentially manage the network adapters in the group. When the virtual switch (441) is not connected to an external network, the host virtual network adapter (442) is not bound to the host physical network adapter (470), but can still be used to forward packets to and from the VM network adapter (43n) via the virtual switch (441). For the host, the host network adapter agent (432) is configured to mediate data transfer between the host and the virtual switch (441) over the connection via the host virtual network adapter (442). (Since the host network adapter agent (432) mediates data transfer, data does not actually need to be passed through the host network adapter agent (432).)
[0114] In some example implementations, the host network adapter agent (432) is loaded as a driver and registers itself in the system as a miniature port driver representing the virtual switch (441). The host network adapter agent (432) operates as part of kernel mode. The host network adapter agent (432) helps maintain state information for the host virtual network adapter (441) and the corresponding host physical network adapter (470) during virtual switch maintenance.
[0115] However, if the host network adapter agent (432) is already loaded, it remains loaded in memory during virtual switch maintenance to maintain the existence of network interfaces and network connectivity for applications running in the host partition. During virtual switch maintenance, the network stack (420) in the host partition can remain bound to the host network adapter agent (432). The host network adapter agent (432) is configured to retain state information defining the characteristics of the connection via the host virtual network adapter (442) for the host when the version of the virtual switch (441) is changed. This supports the maintenance of apparent connectivity for the host over the connection via the host virtual network adapter (442). For example, the host network adapter agent (432) can be configured to save and retrieve state information for the connected host virtual network adapter (442). Such state information can be used to restore the state of the host virtual network adapter (442). As another example, the host network adapter agent (432) can be configured to save and retrieve state information for the host physical network adapter (470). This status information can be used to restore the status of the host's physical network adapter (470). In this way, the host can continue to operate during virtual switch maintenance.
[0116] The virtual switch (441) can connect to the host network adapter agent (432) through one or more dedicated interfaces. For example, the host network adapter agent (432) can implement functions of the callback interface that the virtual switch (441) can call, such as... Figures 5b-5c As shown. When the virtual switch (441) registers with the host network adapter agent (432), the host network adapter agent (432) can provide the virtual switch (441) with function pointers for such functions, such as Figure 5e As shown. For example, these functions may include: (a) a function for unregistering the virtual switch (441) from the host network adapter agent (432); (b) a function for unloading the host physical network adapter driver (460); (c) a function for checking whether the host physical network adapter driver (460) has been reloaded; (d) a function for saving configuration information for the host physical network adapter driver (460); and / or (e) a function for retrieving configuration information for the host physical network adapter driver (460). The host network adapter agent (432) may also implement wrapper functions (see... Figures 5b-5cThe encapsulated function calls the target function of the callback interface implemented by the host physical network adapter driver (460), such as a target function for setting properties, initializing the network interface, or starting the network interface. Alternatively, the host network adapter agent (432) may implement other functions and / or additional functions of the callback interface that can be called by the virtual switch (441).
[0117] The host physical network adapter driver (460) implements functions for managing the host physical network adapter (470). For example, the host physical network adapter driver (460) is a miniature port driver that controls the host physical network adapter (470). The host physical network adapter driver (460) can implement NDIS functions, which will be called by the wrapper functions of the host network adapter agent (432) when the wrapper functions of the host network adapter agent (432) are invoked.
[0118] The host physical network adapter (470) connects to an external network and can represent a single network adapter, a network switch, or a group of network adapters. The host physical network adapter (470) can also connect to a port of a virtual switch (441). The host physical network adapter (470) can be bound to a host virtual network adapter (442). Alternatively, if the host physical network adapter (470) represents a group of network adapters, the host virtual network adapter (442) can be bound to an intermediate driver that is bound to the host physical network adapter (470) (representing the group).
[0119] IV. Example functions and interfaces.
[0120] This section describes example functions that are called in some example implementations to register a virtual switch with a virtual switch agent and a host network adapter agent. It also describes example functions implemented by the virtual switch, virtual switch agent, and host network adapter agent in these example implementations, as well as example functions called by the virtual switch, virtual switch agent, and host network adapter agent.
[0121] A function can be any collection of routines, methods, or other operations that accepts zero or more input arguments from the caller and returns zero or more output arguments to the caller. A function pointer can be a reference to a memory address or any other type of reference to the function's entry point. A wrapper function contains a function pointer to another function (the target function). When the wrapper function is called, it in turn calls the target function, passing the same arguments received by the wrapper function. In some example implementations, virtual switch agents and host network adapter agents are relatively "thin" software layers that implement some functionality for virtual switch maintenance but also provide shimming functionality. The virtual switch agent includes wrapper functions that in turn call the target function of the channel client library. The host network adapter agent includes wrapper functions that in turn call the target function of the host physical network adapter driver. All calls to the wrapper function are ignored until a function pointer to the target function is provided. After the function pointer to the target function is provided (e.g., when the virtual switch is registered), calls to the wrapper function are properly handled by the target function.
[0122] A. The interface between the virtual switch and the host network adapter agent.
[0123] Figures 5a-5e This shows the function prototype, the parameters used for registration, and a list (501-505) of other structures used by the virtual switch and host network adapter agent, which acts as a proxy for the host's physical network adapter. These different lists (501-505) may be part of a header file containing types and definitions shared between the virtual switch and the host network adapter agent.
[0124] Figure 5a List (501) shows the input / output control (“IOCTL”) calls used to register the virtual switch (vmswitch) with the host network adapter agent. Figure 5d List (504) shows the input parameters provided by the virtual switch when the virtual switch registers with the host network adapter agent. The input parameters include the characteristics of the host physical network adapter driver (specifically the NDIS miniport driver) for which the host network adapter agent will act as a shim layer.
[0125] Figure 5eList (505) shows the output parameters returned to the virtual switch when the virtual switch registers with the host network adapter agent. The output parameters include a handle identifier and a function pointer. The handle identifier identifies the host physical network adapter driver (NDIS miniport driver) associated with the host network adapter agent. The function pointer references a function of the callback interface implemented by the host network adapter agent, such as... Figure 5b and 5c Limited to certain terms.
[0126] Figure 5b and 5c Lists (502-503) show the function prototypes of functions implemented as part of the callback interface by the host network adapter agent. The virtual switch can invoke functions of the callback interface using function pointers received when registering with the host network adapter agent. Some function prototypes shown in lists (502-503) are for "control" functions that the virtual switch can call for various reasons. For example, the virtual switch can call the function associated with VMS_NIC_PROXY_MINIPORT_RELOADED to check if the host physical network adapter driver (specifically the NDIS miniport driver) has been reloaded. The virtual switch can call the function associated with VMS_NIC_PROXY_CONFIG_SAVE to save configuration information for the host physical network adapter driver (and thus for the host physical network adapter). In particular, this function can be called during virtual switch maintenance to store configuration information for the host physical network adapter driver (and the host physical network adapter), ensuring the information is retained. The virtual switch can call the function associated with `VMS_NIC_PROXY_CONFIG_RESTORE` to restore the configuration for the host physical network adapter driver (and the host physical network adapter) using previously saved configuration information. Specifically, this function can be called to retrieve configuration information and restore the configuration for the host physical network adapter driver (and the host physical network adapter) during virtual switch maintenance. The virtual switch can call the function associated with `VMS_NIC_PROXY_MINIPORT_UNLOAD` to unload the host physical network adapter driver. Finally, the virtual switch can call the function associated with `VMS_NIC_PROXY_UNREGISTER` to unregister the virtual switch from the host network adapter agent.
[0127] The other function prototypes shown in lists (502-503) target “wrapped” functions implemented by the host network adapter proxy, which, when called from a virtual switch, in turn call the corresponding target function of another component (e.g., the NDIS function of the host physical network adapter driver). For example, a virtual switch (e.g., through a host virtual network adapter implemented as part of the virtual switch) may call the wrapped function implemented by the host network adapter proxy in response to a call from a protocol driver in the network stack. The wrapped function then calls the corresponding target function using the input parameters for the wrapped function as input parameters for the corresponding target function. For example, the wrapped function and the corresponding target function may be called to set properties of the host physical network adapter driver (and therefore the host physical network adapter). Alternatively, the wrapped function and the corresponding target function may be called to indicate a state, initialize a device instance, set an optional handler, or handle notification events for the host physical network adapter driver (and therefore the host physical network adapter). Alternatively, the wrapped function and the corresponding target function may be called to initialize, start, or uninitialize the host physical network adapter driver (and therefore the host physical network adapter).
[0128] When its agent calls the target function, the host network adapter agent can save information about the host virtual network adapters associated with the host physical network adapter, enabling this information to be retained during virtual switch maintenance. Alternatively, such information about the host virtual network adapters can be saved along with the calls to the host network adapter agent during virtual switch maintenance.
[0129] B. The interface between the virtual switch and the virtual switch agent.
[0130] Figures 6a-6i The document shows the function prototypes, the parameters used in registration, and a list of other structures (601-609) for virtual switches and virtual switch agents used as proxies for virtual switches. These different lists (601-609) may be part of a header file containing types and definitions shared between virtual switches and virtual switch agents.
[0131] Figure 6a The list (601) shows the header files that can be merged. Figure 6g List (607) shows the IOCTL calls used to register a virtual switch (vmswitch) with the virtual switch agent. Figure 6hList (608) shows the input parameters provided by the virtual switch when the virtual switch registers with the virtual switch agent. The input parameters include pointers to context information and the virtual switch driver object, function pointers to functions of the callback interface implemented by the virtual switch, and pointers to functions of the callback interface implemented by the channel client library (specifically, the VMBus kernel-mode client library). Figure 6e List (605) shows the function pointers provided by the virtual switch when the virtual switch registers with the virtual switch agent.
[0132] Figure 6i List (609) shows the output parameters returned to the virtual switch when the virtual switch registers with the virtual switch agent. The output parameters include pointers to context information for the virtual switch agent and function pointers to functions of callback interfaces implemented by the virtual switch agent. Figure 6f The last function in list (606) represents the function pointer provided by the virtual switch agent when the virtual switch registers with the virtual switch agent.
[0133] Figure 6b List (602) shows the function prototypes of functions implemented by the virtual switch as part of the callback interface. The function pointer received when the virtual switch is registered (see [reference]) is used. Figure 6e , 6g (and 6h), the virtual switch agent can call functions of the callback interface. The function prototypes shown in Listing (602) are for "control" functions that the virtual switch agent can call to create a processor for a device, shut down a processor for a device, request a device to read from a specified buffer, request a device to write to a specified buffer, or convey some kind of internal device control request. For (and 6h), the virtual switch agent can call functions of the callback interface. Figure 6bThe five functions associated with the function prototypes shown take the following input parameters: `DeviceObject` is a pointer provided by the caller to a structure for the device object; `Irp` is a pointer provided by the caller to a structure indicating the requested operation; the `Irp` structure includes pointers to buffers (e.g., an empty buffer for read operations, or a buffer storing data for write operations), flags, and other parameters. Specifically, in a virtual switch, the function associated with `VMSWITCH_CREATE_HANDLER` is a scheduler for `IRP_MJ_CREATE`, while the function associated with `VMSWITCH_CLOSE_HANDLER` is a scheduler for `IRP_MJ_CLOSE`. The function associated with `VMSWITCH_READ_HANDLER` is a scheduler for `IRP_MJ_READ`, which is the code in the request to read data from the device object. With this function, the virtual switch can transfer data from the device object to memory (e.g., for a VM bus channel). The function associated with `VMSWITCH_WRITE_HANDLER` is a scheduler for `IRP_MJ_WRITE`, which is the code in the request to write data to the device object. For this function, the virtual switch can transfer data from memory to the device object (e.g., for a VM bus channel). Finally, the function associated with VMSWITCH_IOCTRL_HANDLER handles internal device control requests.
[0134] Alternatively, a virtual switch agent can pass pointers to another entity. Figure 6b The function pointer is a function that is explicitly defined in the code, and can call functions of the callback interface implemented by the virtual switch. Alternatively, the virtual switch agent can encapsulate the function pointer in a wrapper function implemented in the virtual switch agent and called by another entity.
[0135] Figure 6c and 6d Lists (603-604) in the table pertain to the intermediaries used for data transfer. Lists (603-604) show function prototypes for wrapper functions implemented in the virtual switch agent, which in turn call the corresponding target function of a callback interface implemented by a channel client library (e.g., a kernel-mode client library for VM bus channels). When a virtual switch registers with the virtual switch agent, the virtual switch provides the virtual switch agent with a function pointer to the target function of the callback interface in the channel client library (see [link to documentation]). Figure 6e , 6g(6h). Encapsulated functions are defined within the virtual switch agent and can be called to use or modify the state of the channel between the virtual switch and the VM (specifically, the VM bus channel between the network VSP of the virtual switch and the network VSC of the VM). The encapsulated function calls the corresponding target function using its input parameters as input parameters. Alternatively, a function pointer to the target function of the callback interface of the channel client library can be provided to the VM client (e.g., the network VSC of the VM), which can then call these functions to use or modify the state of the channel (specifically, the VM bus channel).
[0136] In the virtual switch agent, the encapsulation function associated with VMSWITCH_VMNICPVT_KMCL_CHANNELOPENED corresponds to the target function associated with EVT_VMB_CHANNEL_OPENED in the channel client library. This target function is invoked when a client endpoint in the guest VM opens a channel that has been provided to it. For the encapsulation function, the input parameter (VmbChannel) indicates the channel opened by the guest VM.
[0137] In the virtual switch agent, the encapsulation function associated with VMSWITCH_VMNICPVT_KMCL_CHANNELCLOSED corresponds to the target function associated with EVT_VMB_CHANNEL_CLOSED in the channel client library. This target function is invoked when a client endpoint in the guest VM closes the channel, or when the relative endpoint closes or cancels the channel (through a call to the encapsulation function). For the encapsulation function, the input parameter (VmbChannel) indicates the channel to be closed.
[0138] In the virtual switch agent, the encapsulation function associated with VMSWITCH_VMNICPVT_KMCL_CHANNELSUSPEND corresponds to the target function associated with EVT_VMB_CHANNEL_SUSPEND in the channel client library. This target function is called at the server endpoint when the client endpoint is closing or deleting a channel (which moves the server to a stopped state). For the encapsulation function, the input parameter (channel) indicates the channel that is being suspended.
[0139] In the virtual switch agent, the encapsulation function associated with VMSWITCH_VMNICPVT_KMCL_CHANNELSTARTED corresponds to the target function associated with EVT_VMB_CHANNEL_STARTED in the channel client library. This target function is called at either endpoint after the channel is fully configured but before any packets are delivered (this occurs when the opposite endpoint opens the channel or reopens it after closing it). For the encapsulation function, the input parameter (channel) indicates the channel being started.
[0140] In the virtual switch agent, the encapsulation function associated with VMSWITCH_VMNICPVT_KMCL_PROCESSPACKET corresponds to the objective function associated with EVT_VMB_CHANNEL_PROCESS_PACKET in the channel client library. This objective function is invoked when a packet arrives at the incoming ring buffer (either by the client endpoint of the guest VM or by the encapsulation function of the virtual switch through the virtual switch agent). For the encapsulation function, the input parameter Channel indicates the channel on which the packet arrives. The input parameter PacketCompletionContext indicates the completion context, which identifies the packet to the channel client library when the transaction can exit. The input parameter PacketBuf indicates the packet (buffer) sent by the relative endpoint. The input parameter BufSize indicates the length of the packet (buffer) in bytes. The input parameter Flags indicates various attributes of the packet.
[0141] In the virtual switch agent, the encapsulation function associated with VMSWITCH_VMNICPVT_KMCL_PACKETSENT corresponds to the target function associated with EVT_VMB_PACKET_COMPLETION_ROUTINE in the channel client library. This target function is invoked when the transaction associated with the sent packet completes (either by the client endpoint of the guest VM or by the encapsulation function of the virtual switch through the virtual switch agent). For the encapsulation function, the input parameter PacketObject indicates the packet whose transaction has been completed. The input parameter Status is the status code. The input parameter Buffer indicates the buffer containing the completion response (if any) from the relative endpoint. The input parameter Length indicates the length of the buffer in bytes.
[0142] In the virtual switch agent, the encapsulation function associated with VMSWITCH_VMNICPVT_KMCL_CHANNELSAVEPACKET corresponds to the objective function associated with EVT_VMB_CHANNEL_SAVE_PACKET in the channel client library. This objective function is called (by the virtual switch acting as the network VSP endpoint through the virtual switch agent) when the VSP endpoint must save the state associated with a packet. For the encapsulation function, the input parameter VmbChannel indicates the channel on which the packet arrives. The input parameter Packet indicates the packet on which the VSP saves its state. The output parameter SaveBuf indicates the buffer into which the state is saved. The input parameter SaveBufSize indicates the length of the buffer in bytes. The output parameter BytesNeeded indicates the size required to save the state of the transaction in bytes.
[0143] In the virtual switch agent, the encapsulation function associated with VMSWITCH_VMNICPVT_KMCL_CHANNELRESTOREPACKET corresponds to the target function associated with EVT_VMB_CHANNEL_RESTORE_PACKET in the channel client library. This target function is called (by the virtual switch acting as the network VSP endpoint through the virtual switch agent's encapsulation function) when the VSP endpoint must restore the state associated with a packet. For the encapsulation function, the input parameter VmbChannel indicates the channel on which the packet arrived. The input parameter LibBuf is a pointer to the packet object state inside the kernel-mode client library. The input parameter LibBufSize indicates the length of the buffer LibBuf in bytes. The input parameter SaveBuf is a pointer to the VSP-specific transaction state, corresponding to the buffer where the state is saved. The input parameter SaveBufSize indicates the length of the buffer SaveBuf in bytes.
[0144] In the virtual switch agent, the encapsulation function associated with VMSWITCH_VMNICPVT_KMCL_PROCESSINGCOMPLETE corresponds to the target function associated with EVT_VMB_CHANNEL_PROCESSING_COMPLETE in the channel client library. This target function is invoked (either by the client endpoint of the guest VM or by the encapsulation function of the virtual switch through the virtual switch agent) if there is a pause before delivering subsequent packets, when a batch of packets has already been delivered by the target function for EVT_VMB_CHANNEL_PROCESS_PACKET. For the encapsulation function, the input parameter Channel indicates the channel on which packets are delivered. The input parameter PacketCount indicates the number of packets delivered in the batch.
[0145] Finally, the encapsulation functions associated with VMSWITCH_VMPDPVT_KMCL_CHANNELOPENED and VMSWITCH_VMPDPVT_KMCL_CHANNELCLOSED in the virtual switch agent correspond to the target functions in the channel client library used to open or close channels for packet direct (“PD”) mode processing. Similarly, the encapsulation functions associated with VMSWITCH_VMNICPVT_VERSION6HANDLE_RXPDBATCH and VMSWITCH_VMNICPVT_VERSION6HANDLE_TXPDBATCH in the virtual switch agent correspond to the target functions in the channel client library used to receive or send a batch of packets in PD mode processing.
[0146] Figure 6e List (605) shows the function table provided by the virtual switch to the virtual switch agent when the virtual switch registers with the virtual switch agent. The virtual switch will provide function pointers to functions of the callback interfaces implemented by the virtual switch (see [link to function table]). Figure 6b ) and function pointers to functions that point to callback interfaces implemented by the channel client library (see Figure 6c and 6d The function pointer is placed in the function table. Within its wrapper function, the virtual switch agent uses a function pointer to a function that points to a callback interface implemented by the channel client library. This way, even if the virtual switch is unloaded from memory, the function pointer can be retained (stored within the virtual switch agent).
[0147] If the virtual switch is uninstalled / reloaded during virtual switch maintenance, a new function pointer table (e.g., ...) can be provided to the virtual switch agent. Figure 6e(As shown). Although it is assumed that the function pointer to a function in the channel client library is still valid, the function pointer to a function in the callback interface implemented by the virtual switch may have changed.
[0148] Figure 6f List (606) shows the function prototypes of the callback interface functions implemented by the virtual switch agent. When a virtual switch registers with the virtual switch agent, the virtual switch agent provides the function pointers to the virtual switch as part of the function table shown at the end of list (606) (see [link to relevant documentation]). Figure 6g and 6i Then, the virtual switch can call one of the functions of the callback interface. Some of the functions implemented in the virtual switch agent are related to registration or maintenance (e.g., functions for unregistering the virtual switch, functions for initiating maintenance, and / or functions for checking if maintenance has been initiated). Other functions implemented in the virtual switch agent are related to channel configuration (e.g., functions for assigning channels, functions for cleaning up channels, and / or functions for setting channel callbacks). Such functions can be wrapper functions, which in turn call target functions for channel configuration implemented by another component.
[0149] In the callback interface implemented by the virtual switch agent, the virtual switch calls the function related to VMSPROXY_UNREGISTER to unregister the virtual switch from the virtual switch agent. The input parameter is a pointer to the agent context, which is returned as part of the output in the IOCTL request when the virtual switch registers with the virtual switch agent.
[0150] In the callback interface implemented by the virtual switch agent, the virtual switch calls the function associated with VMSPROXY_IS_SERVICING_STARTED to retrieve the maintenance status stored in the virtual switch agent. This function returns a boolean value—the maintenance status.
[0151] In the callback interface implemented by the virtual switch agent, the virtual switch calls the function associated with VMSPROXY_SET_IS_SERVICING_STARTED to set the maintenance status stored in the virtual state agent. The input parameter is a boolean value, and the maintenance status is set to that boolean value.
[0152] In the callback interface implemented by the virtual switch agent, the virtual switch calls the function associated with VMSPROXY_VMBCHANNEL_ALLOCATE to allocate a channel (specifically, a VM bus channel). The input parameter ParentDeviceObject indicates the device object associated with the channel. The input parameter NicName indicates the network adapter associated with the channel, and the input parameter ChannelIndex indicates the channel index. The output parameter *Channel returns the data structure for the channel.
[0153] In the callback interface implemented by the virtual switch agent, the virtual switch calls the function associated with VMSPROXY_VMBCHANNEL_CLEANUP_WHEN_NOT_SERVICING to clean up the channel. The input parameters NicName, ChannelIndex, and VmbChannel indicate the channel to be cleaned up.
[0154] Finally, in the callback interface implemented by the virtual switch agent, the virtual switch calls the function associated with VMSPROXY_SET_VMBCHANNEL_CALLBACKS to register the callback for the channel. This function can be used for the Network Buffer List (“NBL”) and PD path. The input parameter IsPD indicates whether the mode is NBL or PD. (The PacketDirectProvider Interface extends NDIS with an accelerated I / O model for both physical and virtual environments, which can increase the number of packets processed per second and reduce jitter. PD paths can be used when the application prefers it and there are sufficient hardware resources to accommodate it.) The input parameter Channel indicates the channel, and the input parameters IsPrimaryChannel and IsReceiveChannel indicate the channel's attributes.
[0155] V. Example operations for configuring the virtual networking layer.
[0156] This section describes examples of operations performed to configure a virtual networking layer, which includes virtual switches registered with a virtual switch agent (e.g., such as...). Figure 3a (As shown in the configuration). This section also describes examples of operations performed to configure a virtual networking layer, which includes virtual switches registered with virtual switch agents and host network adapter agents (e.g., such as...). Figure 3b (or configuration 4 as shown).
[0157] A. Configure virtual switches and virtual switch agents.
[0158] Figure 7aExample technology (701) for configuring a network virtualization layer including virtual switches and virtual switch agents is shown. (See reference...) Figure 3a One or more service managers or other entities described may perform the technique (701). Some operations of the example technique (701) are performed during the boot process of the computer system. Other operations of the example technique (701) may be performed later when the VM is added to a guest partition supported by the computer system.
[0159] One of the service managers loads (710) the virtual switch agent into memory. For example, the virtual switch agent can be loaded as a boot driver. The virtual switch agent registers with the computer system as a virtual switch. That is, the virtual switch agent appears to be a virtual switch for both the host and the VM.
[0160] One of the service managers also loads (730) the virtual switch into memory. For example, the virtual switch and the virtual switch agent are loaded in the same process space. Then, one of the service managers registers (740) the virtual switch with the virtual switch agent. For example, the service manager initiates, as follows: Figure 6g The IOCTL call is shown. In this case, the virtual switch provides the virtual switch agent with function pointers to a set of functions of the callback interface implemented by the virtual switch (see, for example, [link to relevant documentation]). Figure 6b , 6e And 6h). The virtual switch also provides the virtual switch agent with function pointers to a set of functions of the callback interface implemented by the channel client library (see, for example, 6h). Figures 6c-6e And 6h). The virtual switch agent provides the virtual switch with function pointers to a set of functions of the callback interface implemented by the virtual switch agent (see, for example, 6h). Figure 6f and 6i Alternatively, a virtual switch can be registered with a virtual switch agent in some other way (e.g., by using a different callback interface).
[0161] When a virtual switch is loaded and registered, a connection between the host and the virtual switch can be automatically created via a virtual switch proxy. Alternatively, one of the service managers can create the connection between the host and the virtual switch via a virtual switch proxy separately. Either way, a virtual network adapter is created for the connected host and bound to the host's network stack (e.g., a TCP / IP protocol driver). In this case, even though the virtual switch is loaded and registered, the virtual switch proxy still appears to be a virtual switch for both the host and the VM.
[0162] Subsequently, for each of the (multiple) VMs, one of the service managers creates a (760) connection between the VM and the virtual switch via a virtual switch agent. For example, when a new instance of a VM starts, a virtual machine worker process (“VMWP”) is started in the host partition for the VM. The VMWP starts the VM’s virtual motherboard and virtual BIOS. For the connection between the virtual switch and the VM, the VMWP starts a network virtual service client (“VSC”) in the guest partition. For example, the network VSC is a virtual NDIS miniport loaded as part of a driver. Function pointers to a set of functions of a callback interface implemented by the channel client library can be provided to the network VSC for the VM. By creating a new VM network adapter, creating a new VM bus channel (for the VM), and connecting the VM bus channel to the virtual switch, the VMWP connects the network VSC to the virtual switch via the virtual switch agent. Channel operations can be requested from the virtual switch agent using IOCTL commands, which forward the IOCTL commands to the virtual switch. Alternatively, the connection between the virtual switch and the VM can be created in other ways. At this point, the virtual switch agent still appears as a virtual switch for components of the virtual networking layer (such as host virtual network adapters for hosts and VM network adapters for VMs) and a virtual switch for clients of the virtual networking layer for hosts and VMs.
[0163] B. Configure virtual switches, virtual switch proxies, and host network adapter proxies.
[0164] Figure 7b Example technology (702) for configuring a network virtualization layer including virtual switches, virtual switch agents, and host network adapter agents is shown. (See reference...) Figure 3b One or more service managers, or those described in 4 or otherwise, can perform technique (702). Some operations of example technique (702) are performed during the boot process of the computer system. Other operations of example technique (702) may be performed later when the VM is added to a guest partition supported by the computer system.
[0165] One of the service managers loads (710) the virtual switch agent into storage, as per the reference. Figure 7a The example technology (701) is described.
[0166] One of the service managers also loads (715) the host network adapter agent into memory. For example, the host network adapter agent can be loaded as a boot driver. The host network adapter agent registers with the computer system as a host physical network adapter driver (e.g., a miniport driver). That is, the host network adapter agent appears to be the host physical network adapter driver for the host.
[0167] One of the service managers binds the host network adapter agent (725) to the host-targeted network stack. For example, the host network adapter agent is bound to a protocol driver (e.g., for TCP / IP) in the host partition. The host network adapter agent is an agent for the host physical network adapter driver that implements a set of objective functions to configure and control the host physical network adapter.
[0168] One of the service managers loads (730) the virtual switch into memory and registers (740) the virtual switch with the virtual switch agent, as per reference. Figure 7a The example technology (701) is described.
[0169] One of the service managers registers the (735) virtual switch with the host network adapter agent. For example, the service manager initiates a process such as... Figure 5a The IOCTL call is shown. In this case, the host network adapter agent provides the virtual switch with function pointers to a set of control functions of the callback interface implemented by the host network adapter agent (see, for example, [link to relevant documentation]). Figure 5b , 5c And 5e). The host network adapter agent also provides the virtual switch with function pointers to a set of encapsulated functions of the callback interface implemented by the host network adapter agent (see, for example, 5e). Figure 5b , 5c (and 5e). The encapsulation function encapsulates the target function implemented by the host physical network adapter driver. Alternatively, the virtual switch can be registered with the host network adapter agent in some other way (e.g., using a different callback interface).
[0170] like Figure 3b and 4 As shown, in some configurations, the host virtual network adapter (for the host physical network adapter) is implemented as part of the virtual switch. When the virtual switch is loaded and registered with the host network adapter agent, a connection between the host and the virtual switch is automatically created through the host network adapter agent. Alternatively, the host virtual network adapter (for the host physical network adapter) can be implemented separately from the virtual switch. In this case, even if the virtual switch is loaded and registered, the host network adapter agent still appears to be the host physical network adapter for the host, while the virtual switch agent still appears to be the virtual switch for the VM.
[0171] Subsequently, for each of the (multiple VMs), one of the service managers creates (760) connections between the VM and the virtual switch, brokered through the virtual switch, as per the reference. Figure 7a The example technology (701) is described.
[0172] VI. Example operation for repairing virtual switches.
[0173] This section describes examples of operations performed to repair virtual switches registered with a virtual switch agent. This section also describes examples of operations performed to repair virtual switches registered with both the virtual switch agent and the host network adapter agent. In some example implementations, the process of repairing a virtual switch (including switching the version of the virtual switch) takes less time than the network connection's "timeout" period (e.g., 9 or 10 seconds). Thus, for the host or VM, the repair of the virtual switch appears as a temporary disruption to network delivery.
[0174] Typically, the virtual switch maintenance process preserves certain state information about the connections from the virtual switch to the host and VM components. It disconnects the virtual switch from the underlying host physical network adapter, unloads the previous version of the virtual switch, loads the current version, reconnects the virtual switch to the underlying host physical network adapter, and uses the preserved state information to restore connections to the host and VM components. Throughout the virtual switch maintenance process, the virtual switch agent and channel client libraries remain loaded in memory. Function pointers to functions implemented by the virtual service agent and functions implemented by the channel client library remain valid. If a host network adapter agent is used, it also remains loaded in memory throughout the virtual switch maintenance process. Function pointers to functions implemented by the host network adapter agent remain valid. In this way, even in the event of a brief interruption of actual network connectivity, the apparent connectivity to the virtual switch (and any network accessible through the virtual switch) for the host and VMs can be maintained during virtual switch maintenance.
[0175] A. Repairing virtual switches registered with a virtual switch agent.
[0176] Figure 8a An example technique (801) for repairing virtual switches in a network virtualization layer that includes virtual switches and virtual switch agents is shown. (See reference...) Figure 3a The described orchestration agent or other means may perform the technology (801).
[0177] First, the orchestration agent suspends (820) network traffic through the virtual switch. For example, the orchestration agent temporarily stops network traffic on the data path to the host and the data path to the VM, while maintaining the operational state of the networking interface. In some example implementations, the VM bus channel to the VM is suspended. This operation freezes the data flow but keeps existing network connections and sockets open. If the orchestration agent calls a function for each VM bus channel to suspend the channel and thus pause network traffic on that channel, network traffic can be queued, buffered, etc., within the channel until network traffic resumes.
[0178] For each of the (multiple) VMs, the orchestration agent stores (830) state information for the VM network adapters connecting the VM to the virtual switch. For example, for each of the (multiple) VMs, while the VM is still running, the state information for the VM network adapters connecting the VM to the virtual switch is stored in memory accessible to the virtual switch agent. Figure 3a In the configuration shown, the orchestration agent can also store state information for the host virtual network adapters used in connections between the host and the virtual switch. For example, the state information for the host virtual network adapters is stored in memory accessible to the virtual switch agent. Alternatively, the orchestration agent stores additional and / or supplementary state information for connections from the virtual switch to the host and / or VM.
[0179] When a virtual switch has been bound to an underlying host physical network adapter (e.g., the virtual switch is not a dedicated switch or internal switch), the orchestration agent unbinds the virtual switch from the host physical network adapter. This disconnects the virtual switch from the host physical network adapter and any drivers for the host physical network adapter (e.g., any host network adapter drivers between the virtual switch and the host physical network adapter). Before unbinding, the orchestration agent can save state information for the host physical network adapter (e.g., the host physical network adapter drivers).
[0180] In some example implementations, virtual switches use extensions (e.g., for filtering, monitoring, and capture). The orchestration agent can store state information for the components used to implement these extensions (e.g., virtual network adapters).
[0181] At this point, the reference to the virtual switch has disappeared, and the virtual switch can be unloaded from storage. The orchestration agent unloads the first version (i.e., the previous version) of the virtual switch from storage (840) without interrupting the apparent connectivity for the host and (multiple) VMs (over their respective connections to the virtual switch). The host and VMs remain connected to the virtual switch agent, which is registered as a virtual switch in the computer system. Function pointers to functions of the callback interfaces implemented by the virtual switch agent are maintained. Thus, the host and VMs may not be aware that the virtual switch has been unloaded. For the host and VMs, the apparent connectivity over their respective connections to the virtual switch (and any networks accessible through the virtual switch) is maintained.
[0182] The orchestration agent loads (850) a second version of the virtual switch into memory. For example, after unloading a previous version of the virtual switch, the orchestration agent immediately loads the current version of the virtual switch as a binary file into memory.
[0183] For each of the (multiple) VMs, the orchestration agent retrieves (860) the state information of the VM network adapter for the connection between the VM and the virtual switch, and restores the state of the VM network adapter. For example, while the VM is running, the orchestration agent recovers the VM network adapter information from the virtual switch-accessible storage and restores the state of the VM network adapter. At this point, the connection from the virtual switch to the VM is restored. Figure 3a In the configuration shown, the orchestration agent can also retrieve state information of the host virtual network adapter for the connection between the host and the virtual switch, and restore the state of the host virtual network adapter. For example, while the host is running, the orchestration agent restores the host virtual network adapter information from storage accessible by the virtual switch agent and restores the state of the host virtual network adapter. Alternatively, the orchestration agent retrieves other and / or additional state information and uses the retrieved state information to restore the connection from the virtual switch to the host and / or VM.
[0184] The orchestration agent continues (870) network traffic through the virtual switch. For example, the orchestration agent unfreezes network traffic on both the host-side data path and the VM-side data path. In some example implementations, a VM bus channel for a VM is started. If the orchestration agent calls a function for each VM bus channel to start the channel and thus continue network traffic on that channel, network traffic that is already queued, buffered, etc., in the channel can be delivered.
[0185] When a virtual switch is to be bound to an underlying host physical network adapter (e.g., the virtual switch is not a dedicated switch or internal switch), the orchestration agent binds the virtual switch to the host physical network adapter. Before binding, the orchestration agent can retrieve state information for the host physical network adapter (e.g., the host physical network adapter driver) and use the retrieved state information to restore the state of the host physical network adapter (e.g., the host physical network adapter driver). This reconnects the virtual switch to the host physical network adapter and any drivers for the host physical network adapter (e.g., any host network adapter drivers between the virtual switch and the host physical network adapter).
[0186] If the virtual switch uses extensions (e.g., for filtering, monitoring, or capturing), the orchestration agent can re-enable the extensions, retrieve saved state information for the components (e.g., virtual network adapters) used to implement these extensions, and restore the state of the components (e.g., virtual network adapters) using the retrieved state information.
[0187] At this point, network connectivity is active. Host network adapter connectivity and VM network adapter connectivity have been fully restored, with the updated virtual switch running.
[0188] B. Repair the virtual switches registered with the virtual switch agent and the host network adapter agent.
[0189] Figure 8b An example technique (802) for repairing virtual switches in a network virtualization layer that includes virtual switches, virtual switch agents, and host network adapter agents is shown. (See reference...) Figure 3b Or the orchestration agent described in 4 or otherwise may perform the technology (802).
[0190] First, the orchestration agent stores (810) state information for the host physical network adapter. For example, the orchestration agent stores configuration information for the host physical network adapter (e.g., for the host physical network adapter driver) in a memory accessible to the host network adapter agent.
[0191] To unbind the virtual switch from the host physical network adapter, the orchestration agent releases (815) any hardware resources allocated from the host physical network adapter for traffic acceleration. For example, the orchestration agent disables hardware-assisted acceleration features (such as vPort and virtual machine queues), which releases the resources allocated from the host physical network adapter for traffic acceleration. Disabling hardware-assisted acceleration results in network "exhaustion"—network traffic continues to flow, but less efficiently than when hardware-assisted acceleration is enabled. The host physical network adapter remains connected to the virtual switch and is operational at this point. (Although hardware-assisted acceleration is disabled before the virtual switch is switched, disabling it takes time, which is unrelated to the virtual switch switching itself. In some example implementations, disabling hardware-assisted acceleration takes approximately 7 seconds. Network traffic continues to move; however, this delay is not considered a network failure.)
[0192] The orchestration agent pauses (820) network traffic through the virtual switch and, for each of the (multiple) VMs, saves (830) the status information of the VM network adapter for the connection between the VM and the virtual switch, as shown in the reference. Figure 8a As described in Example Technology (801). The orchestration agent may also store state information for the host virtual network adapters for the connection between the host and the virtual switch. For example, the state information for the host virtual network adapters is stored in memory accessible to the host network adapter agent. Alternatively, the orchestration agent stores additional and / or supplementary state information for the connection from the virtual switch to the host and / or VM.
[0193] In some example implementations, virtual switches use extensions (e.g., for filtering, monitoring, and capture). The orchestration agent can store state information for the components used to implement these extensions (e.g., virtual network adapters).
[0194] The orchestration agent unbinds the virtual switch from the host physical network adapter (835). This disconnects the virtual switch from the host physical network adapter and any drivers for the host physical network adapter (e.g., any host network adapter drivers between the virtual switch and the host physical network adapter).
[0195] At this point, the reference to the virtual switch has disappeared, and the virtual switch can be unloaded from storage. The orchestration agent unloads the first version (i.e., the previous version) of the virtual switch from storage (840) without interrupting the apparent connectivity of the host and (multiple) VMs (over their respective connections to the virtual switch). The host remains connected to the host network adapter agent, which is registered as the host physical network adapter driver in the computer system. The VMs remain connected to the virtual switch agent, which is registered as virtual switches in the computer system. Function pointers to functions of the callback interfaces implemented by the host network adapter agent and the virtual switch agent are maintained. Thus, the host and VMs may not be aware that the virtual switch has been unloaded. For the host and VMs, the apparent connectivity over their respective connections to the virtual switch (and any networks accessible through the virtual switch) is maintained.
[0196] The orchestration agent loads the second version (850) of the virtual switch into memory, as per the reference. Figure 8a The example technology (801) is described.
[0197] The orchestration agent retrieves (855) state information for the host physical network adapter and restores the state of the host physical network adapter. For example, the orchestration agent retrieves configuration information for the host physical network adapter (e.g., the host physical network adapter driver) from memory accessible to the host network adapter agent and restores the state of the host physical network adapter (e.g., the host physical network adapter driver). In this way, the orchestration agent can connect to the host network adapter agent, discover existing instances of the host physical network adapter driver (e.g., for a NIC miniport instance), read previously stored network adapter-related state information from the host network adapter agent, and thus restore the state of the host physical network adapter driver (e.g., for a NIC miniport instance). Alternatively, the orchestration agent retrieves other and / or additional state information from the host network adapter agent and uses the retrieved state information to restore connectivity from the virtual switch to the host and / or the host physical network adapter.
[0198] For each of the (multiple) VMs, the orchestration agent retrieves (860) the state information of the VM network adapter for the connection between the VM and the virtual switch, and restores the state of the VM network adapter, as shown in the reference. Figure 8aAs described in Example Technology (801). At this point, the connection from the virtual switch to the VM is restored. The orchestration agent can also retrieve the state information of the host virtual network adapter for the connection between the host and the virtual switch, and restore the state of the host virtual network adapter. For example, while the host is running, the orchestration agent restores the host virtual network adapter information from memory accessible by the host network adapter agent and restores the state of the host virtual network adapter. Alternatively, the orchestration agent retrieves other and / or additional state information from the virtual switch agent or the host network adapter agent, and uses the retrieved state information to restore the connection from the virtual switch to the host and / or VM.
[0199] The orchestration agent continues (870) network traffic through the virtual switch, as referenced. Figure 8a The example technology (801) is described.
[0200] If a virtual switch uses extensions (e.g., for filtering, monitoring, or capturing), the orchestration agent can re-enable the extensions, retrieve saved state information for the components (e.g., virtual network adapters) used to implement those extensions, and use the retrieved state information to restore the state of the components (e.g., virtual network adapters).
[0201] The orchestration agent binds the virtual switch (880) to the host physical network adapter. This reconnects the virtual switch to the host physical network adapter and any drivers for the host physical network adapter (e.g., any host network adapter drivers between the virtual switch and the host physical network adapter). Binding the virtual switch to the host physical network adapter enables the allocation of hardware resources from the host physical network adapter for traffic acceleration. For example, the binding process enables hardware-assisted acceleration features such as vPort and VM queues, which can help optimize traffic flow through the host physical network adapter and VM network adapters. Hardware-assisted acceleration can be negotiated between the virtual switch and the host physical network adapter.
[0202] At this point, network connectivity is in operation. Host network adapter connectivity and VM network adapter connectivity have been fully restored, with the updated virtual switch running.
[0203] C. Other substitutions and changes.
[0204] In previous example techniques (801, 802), state information about the VM network adapter was saved and used to restore the VM network adapter's state. Alternatively, during virtual switch maintenance, other and / or additional information can be saved and used to restore the state of the connection between the virtual switch and the VM. For example, the virtual switch agent can save at least some state information about the channels of the connection (e.g., configuration information for VM bus channels). In some example implementations, the virtual switch agent automatically saves this channel state information because it handles calls to configure, control channels, etc. Therefore, the virtual switch agent can save channel state information during the initial configuration phase before virtual switch maintenance begins. When the virtual switch calls a virtual switch agent function to allocate a channel, the virtual switch agent can save the channel state information. Alternatively, this channel state information can be saved as part of the virtual switch maintenance. Regardless of when the channel state information is saved, the orchestration agent can retrieve the saved information and restore the channel state after the virtual switch is reloaded.
[0205] In the second prior example technique (802), state information about the host physical network adapter is saved and used to restore the state of the host physical network adapter. Alternatively, during virtual switch maintenance, other and / or additional information can be saved and used to restore the state of the connection between the virtual switch and the host. For example, at least some state information about the connected host virtual network adapter can be saved by the host network adapter agent or the virtual switch agent. In some example implementations, the host network adapter agent implements the automatic saving of such host virtual network adapter state information because it handles NDIS calls to the host physical network adapter driver. Therefore, the host network adapter agent can save the host virtual network adapter state information during the initial configuration phase before virtual switch maintenance begins. The host network adapter agent can save state information about the host virtual network adapter when the virtual switch registers with the host network adapter agent or sets attributes of the host physical network adapter. Alternatively, such host virtual network adapter state information can be saved as part of virtual switch maintenance. Regardless of when the state information about the host virtual network adapter is saved, the orchestration agent can retrieve the saved information and restore the state of the host virtual network adapter after the virtual switch is reloaded.
[0206] In the aforementioned example, the state information is stored in memory accessible to the virtual switch agent, and / or in memory accessible to the host network adapter agent (if present). Alternatively, the state information may be stored in persistent storage.
[0207] In some example implementations, before saving state information to the virtual switch agent and / or host network adapter agent, and before pausing network traffic through the virtual switch, the orchestration agent sets a status indicator to indicate the initiation of a maintenance operation (and that the virtual switch is not operating in a normal state). For example, the orchestration agent sends an IOCTL command to the virtual switch, which (through a call to a function of a callback interface implemented by the virtual switch agent) sets a flag in the virtual switch agent to indicate that a maintenance operation has been initiated. Subsequently, after restoring the connection state of the host and VM, and after resuming network traffic through the virtual switch, the orchestration agent sets a status indicator to indicate the completion of the maintenance operation (and that the virtual switch is operating in a normal state). For example, the orchestration agent sends an IOCTL command to the virtual switch, which (through a call to a function of a callback interface implemented by the virtual switch agent) sets a flag in the virtual switch agent to indicate that the maintenance operation has been completed. The binding of the virtual switch to the underlying host physical network adapter (and thus hardware-assisted acceleration) can depend on a status indicator that indicates the maintenance operation has been completed (and that the virtual switch is operating in a normal state). Therefore, the status indicator can be checked as a condition before binding occurs. For example, a virtual switch can call a function of a callback interface implemented by the virtual switch proxy to check the status indicator.
[0208] Given that the principles of the disclosed invention can be applied to many possible embodiments thereto, it should be understood that the illustrated embodiments are merely preferred examples of the invention and should not be considered as limiting the scope of the invention. Rather, the scope of the invention is defined by the appended claims. Therefore, we claim protection for all contents falling within the scope and spirit of these claims as our invention.
Claims
1. A computer system comprising one or more processing units and a memory, the computer system providing a virtual networking layer, the virtual networking layer comprising: A virtual switch is configured to transmit data between multiple ports of the virtual switch; as well as A virtual switch agent is configured to target each of one or more virtual machines ("VMs"): Regulates the transmission of data between the VM and the virtual switch via the VM network adapter; as well as When the version of the virtual switch is changed, state information defining the characteristics of the connection through the VM network adapter is retained to support the maintenance of apparent connectivity for the VM over the connection through the VM network adapter, wherein, in order to retain the state information defining the characteristics of the connection through the VM network adapter, the virtual switch agent is configured as follows: Save and retrieve the status information of the VM network adapter for the connection; and / or Save and retrieve the status information of the channel between the virtual switch and the VM. The virtual switch agent is registered as a virtual switch in the computer system, and when the version of the virtual switch is changed, the virtual switch agent remains loaded in the memory and the one or more virtual machines remain connected to the virtual switch agent.
2. The computer system of claim 1, wherein the virtual networking layer further comprises a host network adapter agent configured to target a host connected to the virtual networking layer: Mediation of data transmission between the host and the virtual switch via the host virtual network adapter; and When the version of the virtual switch is changed, state information defining the characteristics of the connection via the host virtual network adapter is retained, thereby supporting the maintenance of the apparent connectivity of the host over the connection via the host virtual network adapter.
3. The computer system of claim 2, wherein, in order to retain the state information defining the characteristics of the connection via the host virtual network adapter, the host network adapter agent is configured to: Save and retrieve the status information of the host virtual network adapter for the connection; and / or Save and retrieve status information for the host's physical network adapter.
4. The computer system of claim 1, wherein the virtual switch agent is further configured to target hosts connected to the virtual networking layer: Mediation of data transmission between the host and the virtual switch via the host virtual network adapter; and When the version of the virtual switch is changed, state information defining the characteristics of the connection via the host virtual network adapter is retained, thereby supporting the maintenance of the apparent connectivity of the host over the connection via the host virtual network adapter.
5. The computer system of claim 1, wherein the computer system further provides one or more service managers, the one or more service managers being configured to perform operations for configuring the virtual networking layer, the operations for configuring the virtual networking layer including: Load the virtual switch agent into memory; Load the virtual switch into memory. Register the virtual switch with the virtual switch agent; as well as For each of the one or more VMs, create the connection between the VM and the virtual switch.
6. The computer system of claim 5, wherein the operation for configuring the virtual networking layer further comprises: Load the host network adapter agent into memory; as well as Register the virtual switch with the host network adapter agent.
7. The computer system of claim 1, wherein the computer system further provides an orchestration agent configured to perform operations for maintaining the virtual switch, the operations for maintaining the virtual switch including: Suspend network traffic passing through the virtual switch; For each of the one or more VMs, store the status information of the VM network adapter for the connection between the VM and the virtual switch; Unload the first version of the virtual switch from the storage; Load the second version of the virtual switch into memory; For each of the one or more VMs, retrieve the state information of the VM network adapter for the connection between the VM and the virtual switch, and restore the state of the VM network adapter; and Continue network traffic through the virtual switch.
8. The computer system of claim 7, wherein the operation for servicing the virtual switch further comprises: Save the status information for the host's physical network adapter; Release the hardware resources allocated from the host physical network adapter for traffic acceleration; Retrieve the status information for the host physical network adapter and restore the status of the host physical network adapter; as well as Bind to the host physical network adapter to enable the allocation of hardware resources from the host physical network adapter for traffic acceleration.
9. The computer system of claim 1, wherein, in order to mediate the transmission of data over the connection, the virtual switch agent is configured to call a target function implemented by a channel client library, wherein a wrapper function for the target function is defined in the virtual switch agent, and a function pointer to the target function implemented by the channel client library is retained when the version of the virtual switch is changed.
10. The computer system of claim 1, wherein the virtual switch agent implements one or more of the following: A function used to unregister the virtual switch from the virtual switch agent; Functions for setting the maintenance status of the virtual switch; A function for obtaining the maintenance status of the virtual switch; A function used to request channel allocation; Functions used to request channel cleanup; as well as Functions used to provide channel callbacks.
11. The computer system of claim 1, wherein the virtual switch, for a device associated with a host physical network adapter, implements one or more of the following: Functions used for request handler creation; A function used to request the handler to close; A function used to request a read operation; A function used to request a write operation; and Functions used to request internal device control operations.
12. The computer system of claim 1, wherein the virtual switch and the virtual switch agent are executed in a host partition, and wherein for each of the one or more VMs: The VMs are executed in different guest partitions; and The connection between the VM and the virtual switch uses the channel between the virtual switch and the VM.
13. A method for maintaining a virtual switch in a computer system providing a virtual networking layer, the method comprising: Suspend network traffic passing through the virtual switch; A virtual switch agent is used to mediate the transmission of data between a virtual machine (VM) and the virtual switch via a VM network adapter, wherein the virtual switch agent is registered as a virtual switch in the computer system. The virtual switch agent is used to store the status information of the VM network adapter for the connection between the VM and the virtual switch; The first version of the virtual switch is unloaded from the memory while the virtual switch agent remains loaded in memory and the one or more virtual machines remain connected to the virtual switch agent, without interrupting the apparent connectivity for the one or more VMs; Load the second version of the virtual switch into memory; For each of the one or more VMs, retrieve the state information of the VM network adapter for the connection between the VM and the virtual switch, and restore the state of the VM network adapter; as well as Continue network traffic through the virtual switch; The method further includes: Before pausing network traffic through the virtual switch, save the state information for the host physical network adapter and release any hardware resources allocated from the host physical network adapter for traffic acceleration. After loading the second version of the virtual switch into memory, the state information for the host physical network adapter is retrieved, and the state of the host physical network adapter is restored; and After network traffic continues through the virtual switch, it is bound to the host physical network adapter, thereby enabling the allocation of hardware resources from the host physical network adapter for traffic acceleration.
14. The method of claim 13, further comprising: Before saving the status information for the host physical network adapter, a status indicator is set to indicate the start of maintenance operations; as well as After network traffic continues through the virtual switch, a status indicator is set to indicate the completion of the maintenance operation, wherein the binding to the host physical network adapter depends on the completion of the maintenance operation.
15. The method according to claim 13, wherein: For each of the one or more VMs, the state information of the connected VM network adapter is saved to and retrieved from the virtual switch agent-accessible memory. and The status information of the host physical network adapter is saved to or retrieved from a memory accessible to the host network adapter agent or the virtual switch agent.
16. The method of claim 13, wherein before the maintenance of the virtual switch begins: At least some state information about the host virtual network adapter is saved; and At least some state information for the channel of the connection is saved.
17. One or more computer-readable media storing computer-executable instructions, said computer-executable instructions being programmed to cause a computer system to perform operations for configuring a virtual networking layer, said operations including: A virtual switch agent is loaded into memory, the virtual switch agent being registered as a virtual machine in the computer system, the virtual switch agent being configured to, for each of one or more virtual machines ("VMs"): mediate the transmission of data between the VM and the virtual switch over the connection via the VM network adapter; and when the version of the virtual switch is changed, save and retrieve the state information of the VM network adapter for the connection. And / or save and retrieve state information for the channel between the virtual switch and the VM, to retain state information defining the characteristics of the connection through the VM network adapter, wherein when the version of the virtual switch is changed, the virtual switch agent remains loaded in the memory and the one or more virtual machines remain connected to the virtual switch agent; Load the virtual switch into memory; Register the virtual switch with the virtual switch agent; as well as For each of one or more virtual machines ("VMs"), create a connection between the VM and the virtual switch.
18. The one or more computer-readable media of claim 17, wherein the operation further comprises: Load the host network adapter agent into memory; as well as Register the virtual switch with the host network adapter agent.
Citation Information
Patent Citations
Controlling a network interface using virtual switch proxying
CN104067231A
Upgrading method and device for virtual switch
WO2018077052A1