PUBLIC CLOUD TECHNOLOGY-BASED SERVER SYSTEM AND ACCESS METHOD THEREOF
A public cloud technology-based server system including a server and an external device inserted into the server. A virtual machine manager in the server is configured to provide a virtual external device and a virtual memory for a virtual machine in the server. The virtual external device is obtained by device emulation based on the external device. The virtual memory is obtained by device emulation based on a memory configured for the external device. A virtual device driver of the virtual external device is configured to send, when the virtual external device accesses a target guest physical address (GPA) of the virtual memory, an access request carrying the target GPA to the external device.
This application is a continuation of International Application No. PCT/CN2025/071798, filed on Jan. 10, 2025, which claims priority to Chinese Patent Application No. 202410050423.8, filed on Jan. 12, 2024, and Chinese Patent Application No. 202410547732.6, filed on Apr. 29, 2024. All of the aforementioned patent applications are hereby incorporated by reference in their entireties.
TECHNICAL FIELDThe present disclosure relates to the field of cloud service technologies, and in particular, to a public cloud technology-based server system and an access method thereof.
BACKGROUNDWith the increasingly widespread application of cloud computing, the use of external devices on cloud servers is steadily increasing. As the quantity of external devices grows, a quantity of correspondences between guest physical addresses (GPAs) and host physical addresses (HPAs) that must be recorded by a remapping device for address translation increases accordingly. However, because the remapping device can record only a fixed quantity of correspondences between the GPAs and the HPAs, some correspondences may not be recorded. Consequently, when address translation relies on an unrecorded correspondence between the GPA and the HPA, address translation cannot be performed, leading to degraded address translation performance of the remapping device and in turn, reduced operational performance of the external device.
SUMMARYThe present disclosure provides a public cloud technology-based server system and an access method thereof. The present disclosure effectively improves the address translation performance of the server system, thereby improving the operational performance (for example, direct memory access (DMA) performance) of external devices and increasing the efficiency in memory management. The technical solutions provided in the present disclosure are as follows.
According to a first aspect, the present disclosure provides a public cloud technology-based server system. The server system includes a server and an external device inserted into the server. A connection channel is established between the server and the external device. The server is provided with a virtual machine and a virtual machine manager, the virtual machine manager is configured to provide virtual hardware for the virtual machine, the virtual hardware includes a virtual external device and a virtual memory, the virtual external device is obtained by device emulation based on the external device, the virtual memory is obtained by device emulation based on a memory configured for the external device, the virtual machine is provided with a virtual device driver for the virtual external device, and the virtual device driver is configured to send an access request to the external device when the virtual external device accesses a target guest physical address of the virtual memory, where the access request carries the target guest physical address. The external device is configured to: query, based on the access request, a first correspondence between a guest physical address and a host physical address to obtain a target host physical address corresponding to the target guest physical address; obtain target data recorded at the target host physical address; and send the target data to the virtual device driver.
It can be learned from the foregoing that, it is equivalent to that the server system offloads an address translation function to the external device, so that the external device directly manages memory allocated to the virtual machine, and shares a task of performing address translation on a target guest physical address in an access request. In this way, an address translation device like an input/output memory management unit (IOMMU)/system memory management unit (SMMU) in the server does not need to execute the address translation task, and a translation lookaside buffer (TLB) of the address translation device like the IOMMU/SMMU in the server does not need to record a correspondence of a target guest physical address accessed by the virtual external device of the external device, thereby reducing a quantity of correspondences that need to be recorded in the TLB, and alleviating a conflict between a small quantity of page table entries of the TLB and an excessive quantity of external devices. This reduces a probability of a TLB page fault in an address translation process, effectively improves the address translation performance of the server system, thereby improving operational performance (for example, DMA performance) of the external devices and increasing the efficiency in memory management.
In a possible embodiment, the server is further provided with an address management module. The external device is further configured to: when the first correspondence does not record the target host physical address corresponding to the target guest physical address, send a message indicating a matching failure to the address management module, where the message carries the target guest physical address. The address management module is configured to forward the message to the virtual machine manager. The virtual machine manager is configured to: allocate a memory block in the memory for the target guest physical address based on the message, establish a second correspondence between a host physical address of the memory block and the target guest physical address, and send the second correspondence to the address management module. The address management module is configured to update the first correspondence based on the second correspondence.
It can be learned from the foregoing that the server system provided in the present disclosure can perform related processing, for example, perform page fault processing, when querying a correspondence based on the target guest physical address results in a miss, to resolve the miss problem. In this way, memory pinning can be avoided before the virtual machine is started, and global memory locking can be released. In cloud scenarios, when the external device is passed through to the virtual machine, memory pinning can be avoided, so that overcommitment and reuse of the virtual machine memory can be implemented without user awareness (without imposing special requirements on the virtual machine system). This improves overall memory usage of the server and ensures that performance of the server does not deteriorate. This feature is especially obvious in scenarios with high memory pressure. In addition, because memory pinning is avoided, there is no need to configure a large amount of memory in a cloud scenario because of pre-allocation of the memory by the virtual machine, so that memory usage costs in the cloud scenario can be reduced, a problem that a memory cost of a public cloud gradually increases can be resolved, and market competitiveness of the public cloud is enhanced.
In a possible embodiment, the server is further provided with the address management module. The virtual machine manager is configured to: perform, based on a specification of the virtual machine, device emulation for the virtual machine to obtain the virtual memory, configure guest physical address space of the virtual memory, establish a correspondence between a host physical address of a memory block configured in the memory for the external device and a guest physical address in the guest physical address space, and send the correspondence to the address management module.
In a possible embodiment, configuration information of the external device indicates that the external device supports a translated request, and the access request indicates that an address carried in the access request is a host physical address. In this way, when the server is compatible with an original address translation function, it can be ensured that the access request using a capability of the external device can be processed by the external device, instead of being processed by the original address translation function of the server, that is, the original address translation function of the server is bypassed.
In a possible embodiment, the memory configured for the external device includes one or more of the following: a memory inserted into the server or a shared memory of the server.
According to a second aspect, the present disclosure provides a method for accessing a public cloud technology-based server system. The server system includes a server and an external device inserted into the server. A connection channel is established between the server and the external device. The server is provided with a virtual machine and a virtual machine manager. The virtual machine manager is configured to provide virtual hardware for the virtual machine. The virtual hardware includes a virtual external device and a virtual memory. The virtual external device is obtained by device emulation based on the external device. The virtual memory is obtained by device emulation based on a memory configured for the external device. The virtual machine is provided with a virtual device driver for the virtual external device. The method includes: The virtual device driver sends an access request to the external device when the virtual external device accesses a target guest physical address of the virtual memory, where the access request carries the target guest physical address. The external device queries, based on the access request, a first correspondence between a guest physical address and a host physical address to obtain a target host physical address corresponding to the target guest physical address, obtains target data recorded at the target host physical address, and sends the target data to the virtual device driver.
In a possible embodiment, the server is further provided with an address management module. The method further includes: When the first correspondence does not record the target host physical address corresponding to the target guest physical address, the external device sends a message indicating a matching failure to the address management module, where the message carries the target guest physical address; the address management module forwards the message to the virtual machine manager; the virtual machine manager allocates a memory block in the memory for the target guest physical address based on the message, establishes a second correspondence between a host physical address of the memory block and the target guest physical address, and sends the second correspondence to the address management module; and the address management module updates the first correspondence based on the second correspondence.
In a possible embodiment, the server is further provided with the address management module. The method further includes: The virtual machine manager performs, based on a specification of the virtual machine, device emulation for the virtual machine to obtain the virtual memory, configures guest physical address space of the virtual memory, establishes a correspondence between a host physical address of a memory block configured in the memory for the external device and a guest physical address in the guest physical address space, and sends the correspondence to the address management module.
In a possible embodiment, configuration information of the external device indicates that the external device supports a translated request, and the access request indicates that an address carried in the access request is a host physical address.
In a possible embodiment, the memory configured for the external device includes one or more of the following: a memory inserted into the server or a shared memory of the server.
According to a third aspect, the present disclosure provides a compute device, including a memory and a processor. The memory stores program instructions, and the processor runs the program instructions to perform the method provided in any one of the second aspect and the possible embodiments of the second aspect.
According to a fourth aspect, the present disclosure provides a compute device cluster, including a plurality of compute devices. The plurality of compute devices include a plurality of processors and a plurality of memories, the plurality of memories store program instructions, and the plurality of processors run the program instructions, so that the compute device cluster performs the method provided in any one of the second aspect and the possible embodiments of the second aspect.
According to a fifth aspect, the present disclosure provides a computer-readable storage medium. The computer-readable storage medium is a non-volatile computer-readable storage medium, and the computer-readable storage medium includes program instructions. When the program instructions are run on a compute device, the compute device is enabled to perform the method provided in any one of the second aspect and the possible embodiments of the second aspect.
According to a sixth aspect, the present disclosure provides a computer program product including instructions. When the computer program product runs on a computer, the computer is enabled to perform the method provided in any one of the second aspect and the possible embodiments of the second aspect.
To make the objectives, technical solutions, and advantages of the present disclosure clearer, the following further describes the embodiments of the present disclosure in detail with reference to the accompanying drawings.
For ease of understanding, the following first describes technologies and backgrounds in embodiments of the present disclosure.
Based on an internet network, a cloud data center provides operation and maintenance facilities and related service systems for devices that collect, store, process, and send data in a centralized manner. Conceptually, the cloud data center can be regarded as a public commercial internet “equipment room”, and is also a professional information technology (IT) service and an important infrastructure of an IT industry. The cloud data center is not only a service concept, but also a network concept, which forms a part of a network infrastructure. Like a backbone network and an access network, the cloud data center provides high-end data delivery services and high-speed access services.
Cloud computing is a type of distributed computing, and is a network that manages and schedules a large quantity of compute resources and storage resources in a unified manner, to provide an on-demand service for a user. Both the compute resource and the storage resource are provided by a compute device disposed in the data center. In addition, the cloud computing may provide a plurality of types of services for the user, such as infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (Saas). The infrastructure as a service is used to provide a virtual machine or another resource as a service for a tenant. The platform as a service is used to provide a development platform as a service for the tenant. The software as a service is used to provide an application (app, also referred to as an application program) as a service for a customer.
A host (PM) is a physical resource for carrying a virtualization technology. The host is also referred to as a physical machine. Generally, a host configured to deploy a virtual instance is a physical server. The physical machine has a plurality of physical devices. For example, the physical server has physical devices such as a processor and a memory. A plurality of virtual instances may be deployed on one host, and the plurality of virtual instances deployed on the same host share physical resources of the host. Based on different usage conditions, a plurality of virtual instances deployed on one host may belong to a same tenant or different tenants.
Virtualization is a resource management technology. Virtualization can abstract, convert, and present various physical resources of a host, such as compute resources, network resources, and storage resources. This eliminates an indivisible barrier between physical structures of the host, enabling the tenant to utilize these resources in manners superior to an original configuration. Resources obtained through virtualization are referred to as virtual resources. The virtual resources are not limited by a deployment mode, a setting location, or a physical configuration of existing physical resources.
The virtual resources are usually provided for the tenant in a form of virtual instances. Hardware resources of a physical server can be used by one or more tenants at a granularity of virtual instances. Different virtual instances are isolated from each other, so that tenants can use physical resources conveniently and flexibly on the premise of secure isolation. This greatly improves utilization of the physical resources. In the present disclosure, the virtual instance may be a virtual machine, a container, an independent process (for example, a function), or the like. The virtual instance may also be referred to as a cloud server (ECS) or an elastic instance (naming conventions differ across different cloud service providers).
A virtual machine (VM) is a complete computer system emulated by software, has functions of a complete hardware system, and runs in a completely isolated environment. All tasks that can be completed on a server can be implemented on a virtual machine. When the virtual machine is created in the server, a part of a hard disk drive and a part of a memory capacity in a physical machine need to be used as a hard disk drive and a memory capacity of the virtual machine. Each virtual machine has an independent hard disk drive and operating system. A tenant of the virtual machine can operate the virtual machine as the tenant uses the server. Running environments (for example, a virtual machine application, an operating system, and virtual hardware) in different virtual machines are completely isolated. If communication needs to be performed between different virtual machines, a network packet needs to be forwarded via a virtual manager.
A container provides a lightweight virtual running environment. The container may be obtained by packaging all code, libraries, dependencies, and the like of an application of a tenant into an image. When being executed, the image runs in the virtual running environment. In this case, the container is a runtime instance of the image, and is similar to a lightweight sandbox and can be enabled, started, stopped, and deleted. The image does not share resources such as a memory, a processor (for example, a central processing unit (CPU)), and a magnetic disk of a host with another image. This implements container isolation between the image and the host and between the image and the another image, and ensures that a process inside the container cannot monitor any process or resource outside the container. An infrastructure of the container may be hardware of a server or a virtual machine on a cloud (that is, the container may also be deployed in the virtual machine). An operating system uses a Linux™ kernel and supports namespace and cgroup. namespace is used to isolate processes, and cgroup is used to allocate process resources. The resources are specifically virtual processors and memory allocated to the processes. A container engine is similar to a virtual machine manager and runs in an operating system to manage a container. Unlike a virtual machine, which comes with an operating system, the container has no operating system. The container is run as a process in a host operating system. Therefore, the container is started faster than the virtual machine, and is particularly suitable for a lightweight application. In addition, one host can run thousands of containers (e.g., processes) simultaneously.
Direct memory access (DMA) may also be referred to as a direct memory operation or a group data transfer mode, and is a data interaction mode in which an external device directly accesses data from a memory of a computer without using a central processing unit (CPU) of the computer. During data transmission in the DMA mode, the CPU of the computer delivers an instruction to a DMA controller, to instruct the DMA controller to control data transmission. After completing data transmission, the DMA controller feeds back transmission complete information to the CPU. It can be learned that, in the DMA data transmission process, the CPU of the computer does not need to perform a transmission operation, and operations such as instruction fetching, data obtaining, and data sending by the CPU of the computer may be omitted, thereby reducing resource occupation of the CPU of the computer and saving system resources.
The DMA may include remote DMA (RDMA) and local DMA. The RDMA is a data transmission mode in which data is directly transmitted from a memory of a computer to another computer through a network without intervention of operating systems of the two computers. The local DMA is a data transmission mode in which a network is not required.
A peripheral component interconnect express (PCIe) bus is a high-speed serial computer expansion bus.
A memory may also be referred to as an internal memory or a main memory, and is configured to temporarily store computational data of a CPU and data exchanged with an external memory like a hard disk drive.
External devices are briefly referred to as “peripherals”, and are a general term for input and output devices (including an external memory) in a computer system. The external device functions to transmit, transfer, and store data and information, and is an important part of the computer system. The peripherals include any device other than the host. The peripherals are auxiliary or supplementary devices connected to a computer. The peripherals can expand the computer system. The external device is, for example, a network interface card, an external memory (like a hard disk drive, a magnetic disk, and a graphics card), a graphics processing unit (GPU), an intelligent processing unit (IPU), and a data flow processing unit (DPU). The network interface card may also be referred to as a network interface controller (NIC), a network adapter, or a local area network receiver, and is a type of computer hardware designed to allow a host or a compute device to communicate through a network.
A purpose of a memory virtualization technology is to provide continuous physical memory space starting from an address 0 for a virtual machine, and effectively isolate and schedule memory resources between virtual machines. The memory virtualization technology mainly relates to translation of a guest virtual address (GVA) to a guest physical address (GPA), then to a host virtual address (HVA), and finally to a host physical address (HPA).
However, in the virtualization technology, a plurality of virtual machines usually run on a physical host, and each virtual machine considers that the virtual machine exclusively occupies memory space of the physical host. Therefore, the virtual machine uses a GPA to represent the memory space owned by the virtual machine, where the memory space is considered to be continuous by the virtual machine (that is, it may be understood as that the virtual machine considers that the virtual machine possesses an entire physical memory module).
The GVA is an address formed by mapping the GPA by an operating system of the virtual machine. The operating system of the virtual machine provides the GVA for a process or application software configured in the operating system of the virtual machine to use. The operating system of the virtual machine records a correspondence between the GVA and the GPA. Conversion from the GVA to the GPA is implemented based on a page table of the operating system of the virtual machine.
The HPA is an actual physical memory address, and the HVA is an address formed by mapping the HPA by a host operating system. The host operating system provides the HVA for a process (for example, a virtual machine) in the operating system to use. The host operating system records a correspondence between the HVA and the HPA. Conversion from the HVA to the HPA is implemented based on a page table of the host operating system.
In
The GPA address range is related to the specification of the virtual machine. For example, a tenant may set, on a cloud management platform, a virtual machine specification with a memory size of 5 GB for the virtual machine 1. In this case, the virtual machine manager is notified by the cloud management platform that the virtual machine 1 whose GPA is 0 GB to 5 GB needs to be created. The tenant may set, on the cloud management platform, a virtual machine specification with a memory size of 4 GB for the virtual machine 2. In this case, the virtual machine manager is notified by the cloud management platform that the virtual machine 2 whose GPA is 0 GB to 4 GB needs to be created.
Currently, in a cloud scenario, in a case in which an external device is passed through to the virtual machine for use, the hypervisor needs to allocate memory to the virtual machine at a time, and pin a memory block allocated to the virtual machine, so that the virtual machine needs to initialize preoccupied memory before being started, to ensure that the memory block allocated to the virtual machine cannot be used by another memory user in a life cycle of the virtual machine. In addition, the hypervisor allocates GPA space to the virtual machine, and establishes correspondences between a plurality of GPAs in the GPA space and an HPA of the memory block allocated to the virtual machine. The correspondence between the GPA and HPA is maintained by the host operating system.
A pass-through technology is a virtualization technology supported by the external device (for example, a PCIe device) of the server. Pass-through refers to that the hypervisor is bypassed and the external device is directly provided for the virtual machine to use. The pass-through technology allows an external device to set a plurality of virtual functions (VF). The external device sets storage resources or network resources in one or more VFs and provides the one or more VFs for a virtual machine of a tenant. The virtual machine can directly use resources provided by the one or more VFs. For example, the external device binds, to a VF, a 40 GB logical disk obtained by dividing a storage resource, and provides the VF for the virtual machine 1. After the VF is mounted to the virtual machine 1, the virtual machine 1 may access the logical disk in the same manner as accessing a local disk. Alternatively, the external device binds a network interface card interface eth0 in the network resource to a VF, and provides the VF for the virtual machine 1. After the VF is mounted to the virtual machine 1, the virtual machine 1 may use eth0 in a same manner as using a local network interface card.
Generally, the operating system of the virtual machine running on the virtual machine does not know the HPA of the memory block allocated by the hypervisor to the virtual machine, but the operating system of the virtual machine knows the GPA space allocated to the virtual machine. When the virtual machine accesses, via the external device that is passed through to the virtual machine for use, the memory block allocated to the virtual machine, the virtual machine sends a DMA request to the host operating system, where the DMA request carries a GPA that needs to be accessed. After receiving the DMA request, the host operating system queries, based on the GPA carried in the DMA request, a correspondence between the GPA and an HPA, to obtain the HPA corresponding to the GPA that the virtual machine requests to access, reads data recorded in a memory block indicated by the HPA, and then provides the data for the virtual machine. A process in which the host operating system obtains the corresponding HPA based on the GPA is referred to as an address translation process or an address remapping process. The process is to translate the GPA in the DMA request into the host physical address (namely, the HPA) that can be used by the external device, and is a process of managing the memory. A device configured to perform the address remapping process is referred to as a remapping device. Currently, remapping devices generally include input/output memory management units (IOMMU) and system memory management units (SMMU). The IOMMU and SMMU are disposed in the host. The IOMMU and SMMU record a correspondence between the GPA and the HPA through a translation lookaside buffer (TLB). A quantity of page table entries (PTE) of the TLB is usually fixed, that is, a quantity of correspondences between GPAs and HPAs that can be recorded by the IOMMU and the SMMU is specified to be fixed. The PTE includes a valid bit and an n-bit address field, and the address field records an HPA corresponding to a GPA, that is, a start location of a memory page corresponding to the GPA.
As a quantity of external devices gradually increase, a quantity of correspondences between GPAs and HPAs that must be recorded by the IOMMU and the SMMU increases accordingly. However, because the IOMMU and the SMMU can record only a fixed quantity of correspondences between the GPAs and the HPAs, some correspondences may not be recorded. Consequently, when address translation relies on an unrecorded correspondence between the GPA and the HPA, address translation cannot be implemented, leading to degraded address translation performance of the IOMMU and the SMMU, and in turn, reduced operational performance of the external device. For example, in a current cloud scenario, the quantity of external devices of the host continuously increase, and quantities of resources and DMA operations of the external devices continuously increase. However, the IOMMU and the SMMU can record only a small quantity of correspondences between the GPAs and the HPAs, which causes deterioration of address translation performance of the IOMMU/SMMU. The IOMMU is used as an example. Currently, an x86 IOMMU TLB has only 64 page table entries. In a large-scale virtual function (VF) scenario of a cloud, the IOMMU TLB needs to record more than 64 page table entries. As a result, correspondences between a part of GPAs and HPAs are not recorded. When the HPAs corresponding to the part of GPAs need to be queried, address translation performance is affected. For example, when a quantity of VFs exceeds 64, a severe TLB page fault occurs. When the quantity of VFs is 128, address translation performance decreases by about 40%.
Currently, the address translation function does not support page fault processing. In this case, the external device passed through to the virtual machine needs to preoccupy memory. Because the memory preoccupied by the external device is in a pinned state, the preoccupied memory cannot be used by another memory user. As a result, memory usage is low. For example, in the current cloud scenario, when the external device is passed through to the virtual machine, the hypervisor needs to successfully allocate memory at a time and pin the allocated memory on the host. The allocated memory cannot be reused, resulting in low overall memory usage. In addition, the virtual machine needs to initialize the preoccupied memory before being started, which causes slow virtual machine startup.
Although, a virtual IOMMU (e.g., coIOMMU) technology is proposed. However, this technology can be implemented only after the operating system of the virtual machine is modified. As a result, it is difficult to implement the technology in the public cloud.
In view of this, the present disclosure provides a public cloud technology-based server system and an access method thereof. The server system includes a server and an external device inserted into the server. A connection channel is established between the server and the external device. The server is provided with a virtual machine and a virtual machine manager. The virtual machine manager is configured to provide virtual hardware for the virtual machine. Virtual hardware includes a virtual external device and a virtual memory. The virtual external device is obtained by device emulation based on the external device. The virtual memory is obtained by device emulation based on a memory configured for the external device. The virtual machine is provided with a virtual device driver for the virtual external device. The virtual device driver is configured to send an access request to the external device when the virtual external device accesses a target guest physical address of the virtual memory. The access request carries the target guest physical address. The external device is configured to: query, based on the access request, a first correspondence between a guest physical address and a host physical address to obtain a target host physical address corresponding to the target guest physical address; obtain target data recorded at the target host physical address; and send the target data to the virtual device driver.
It can be learned from the foregoing that, it is equivalent to that the server system offloads an address translation function to the external device, so that the external device directly manages memory allocated to the virtual machine, and shares a task of performing address translation on a target guest physical address in an access request. In this way, an address translation device like an IOMMU/SMMU in the server does not need to execute the address translation task, and a TLB of the address translation device like the IOMMU/SMMU in the server does not need to record a correspondence of a target guest physical address accessed by the virtual external device of the external device, thereby reducing a quantity of correspondences that must be recorded in the TLB, and alleviating a conflict between a small quantity of page table entries of the TLB and an excessive quantity of external devices. This reduces a probability of a TLB page fault in an address translation process, effectively improves the address translation performance of the server system, thereby improving operational performance (for example, DMA performance) of the external devices and increasing the efficiency in memory management.
It should be noted that, although an example in which the virtual machine uses the external device is used for description in the present disclosure, another type of virtual instance uses the external device. This is not specifically limited in embodiments of the present disclosure. The another type of virtual instance is, for example, a container. When another type of virtual instance uses the external device, for an embodiment in which the another type of virtual instance accesses the memory via the external device, refer to the embodiment in which the virtual machine accesses the memory via the external device in this embodiment of the present disclosure. Details are not described in this specification again.
This specification describes the technical solutions of the present disclosure in detail from a plurality of perspectives such as an embodiment scenario, a method procedure, a hardware apparatus, and a software apparatus.
The following first describes implementation scenarios of embodiments of the present disclosure by using examples.
A large quantity of infrastructures owned by a cloud service provider are deployed in the data center 1, for example, a compute resource, a storage resource, and a network resource. For example, the compute resource may be a compute device that can provide a computing capability, for example, a server and an external device that has a computing capability, like a GPU, an IPU, and a DPU. The storage resource may be a device that can provide a storage capability, for example, an external device like a hard disk drive, a magnetic disk, or a graphics card. The network resource may be a device that can provide a network transmission capability, for example, an external device like a network interface card. As shown in
The cloud management platform can be logically divided into: a tenant console, a compute management service, a network management service, a storage management service, an authentication service, and an image management service. The tenant console provides an interface or an application programming interface (API) to interact with the tenant. The compute management service is used to manage a server running a virtual instance and a bare metal server. The network management service is used to manage a network service (for example, a gateway and a firewall). The storage management service is used to manage a storage service (for example, a data bucket service). The authentication service is used to manage an account and a password of the tenant. The image management service is used to manage an image of a virtual instance.
In the implementation scenario shown in
A cloud management platform client runs in the virtual machine manager. The cloud management platform client can receive a control plane command sent by the cloud management platform, create a virtual instance on the server according to the control plane control command, and perform full life cycle management on the virtual instance. For example, the cloud management platform client can detect, in real time, a usage status of a hardware resource of a server on which the cloud management platform client is located, and report the usage status to the cloud management platform. When determining to create a virtual instance on a server, the cloud management platform sends a virtual instance creation command to a cloud management platform client on the server. After receiving the command, the cloud management platform client creates the virtual instance on the server. In this way, the tenant can create, manage, log in to, and operate the virtual instance in the data center on the cloud management platform.
Servers may be configured to run virtual machines of different specifications. Virtual machine specifications are classified into a general-purpose compute type, a memory-optimized type, an ultra-large memory type, and the like. Each type has a specific specification. After the tenant selects a virtual machine specification, the cloud management platform selects a server that supports the specification in the data center, determines that the server has sufficient idle hardware resources, and creates a virtual machine set with the specification on the server. The cloud management platform can be used to configure a server to analyze and plan a server hardware resource. Based on hardware performance of servers, compute products corresponding to physical hardware can be planned, for example, virtual machines of different specifications can be planned to meet differentiated requirements of different tenants. In addition, differentiated pricing policies can be used based on performance differences of virtual machines with different specifications. For example, a virtual instance with a high-performance specification is sold at a high price, and a virtual instance with a common-performance specification is sold at a low price, so that the tenants can purchase virtual instances on demand.
In an embodiment, as shown in
The tenant may send an instruction to the cloud management platform via the client 2 used by the tenant, to create, manage, log in to, and operate the virtual instance in the server, and use a cloud service provided by the virtual instance. For example, the cloud management platform can provide an access interface. The access interface can be provided in a form of an interface or API. The tenant can operate the client to remotely access the access interface to register a cloud account and password on the cloud management platform and use the cloud account and password to log in to the cloud management platform. The cloud management platform can also authenticate the cloud account and password. After the authentication succeeds, the tenant can select and pay for a virtual instance with a specific specification (a processor, a memory, and a magnetic disk) on the cloud management platform. After the tenant successfully purchases the virtual instance, the cloud management platform provides a remote login account and password of the virtual instance by the tenant. The tenant may remotely log in to the virtual instance on the client by using the remote login account and password, and install and run an application of the tenant in the virtual instance, to implement a service of the tenant by using the application.
The client 2 may be a computer, a personal computer, a laptop computer, a mobile phone, a smartphone, a tablet computer, a cloud host, a portable mobile terminal, a multimedia player, an e-book reader, a wearable device, a smart home appliance, an artificial intelligence device, a smart wearable device, a smart vehicle-mounted device, an internet of things device, or the like.
In an embodiment, the method for accessing the public cloud technology-based server system provided in this embodiment of the present disclosure may be implemented by running an executable program by a compute device in the data center 1. In some embodiments, the method for accessing the public cloud technology-based server system provided in this embodiment of the present disclosure may be applied to a public cloud technology-based server system access system. The public cloud technology-based server system access system is deployed in a server managed by the cloud management platform. The public cloud technology-based server system access system can implement the method for accessing the public cloud technology-based server system provided in this embodiment of the present disclosure by running the executable program of the method for accessing the public cloud technology-based server system provided in this embodiment of the present disclosure. In addition, the executable program for implementing the method for accessing the public cloud technology-based server system is, in some embodiments, presented in a form of an application installation package. After installing the application installation package, the server can implement the method for accessing the public cloud technology-based server system provided in this embodiment of the present disclosure by running an executable program in the application installation package.
It should be understood that the foregoing content is an example of an embodiment of an implementation scenario of the method for accessing the public cloud technology-based server system provided in embodiments of the present disclosure, and does not constitute a limitation on the embodiment of the implementation scenario of the method for accessing the public cloud technology-based server system. A person of ordinary skill in the art may learn that, as a service requirement changes, an embodiment of the implementation scenario of the method may be adjusted based on an application requirement, and is not enumerated in embodiments of the present disclosure.
The following describes an embodiment of a public cloud technology-based server system provided in an embodiment of the present disclosure.
The server has hardware 111. The server is provided with a virtual machine manager 112 and a virtual machine 113. The virtual machine manager is configured to provide virtual hardware 1121 for the virtual machine based on the hardware of the server and the external device of the server. The virtual hardware includes a virtual external device 1121a and a virtual memory 1121b. The virtual external device is obtained by the virtual machine manager by device emulation based on the external device. The virtual memory is obtained by the virtual machine manager by device emulation based on a memory configured for the external device. It should be understood that the virtual hardware provided by the virtual machine manager for the virtual machine includes virtual hardware of another type, for example, a virtual processor, to meet a performance requirement of the virtual machine. Examples are not provided herein. The virtual machine is provided with a virtual device driver for the virtual external device. The virtual device driver is configured to implement a process of accessing the virtual external device. The virtual device driver is configured to send an access request to the external device when the virtual external device accesses a target guest physical address of the virtual memory. The access request carries the target guest physical address. For example, an application is set in the virtual machine, and when a capability of the external device needs to be used in a running process of the application, in a case in which the external device is passed through to the virtual machine for use, the virtual external device accesses the virtual memory, to provide the capability of the external device for the application. An operation of accessing the virtual memory by the virtual external device triggers the access request. The virtual device driver can obtain the access request, and send the access request to the external device, so that the external device accesses the memory based on the access request, thereby implementing an objective of accessing the virtual memory by the virtual external device.
The memory in the present disclosure may be a memory (namely, a local memory) configured in the server, a memory of another compute device that establishes a connection channel with the server, or the like. The memory of the another compute device that establishes the connection channel with the server is, for example, a memory that is deployed on the another compute device and that is shared by the another compute device with the server, namely, a shared memory. The server can access the memory of the another compute device through remote access or a high-speed communication bus. For example, the server accesses the memory of the another compute device by using a remote direct memory access (RDMA) technology. The high-speed communication bus may be a compute express link (CXL) or a universal bus (UB).
After receiving the access request sent by the virtual device driver, the external device can query, based on the access request, a first correspondence between a guest physical address and a host physical address to obtain a target host physical address corresponding to the target guest physical address. Then, the external device obtains, from the memory, target data recorded at the target host physical address, and sends the target data to the virtual device driver. In some embodiments, the virtual device driver may send the access request to the external device based on a work queue (WQ). Correspondingly, the external device can obtain the access request from the work queue in a manner of obtaining a work queue element (WQE) from the work queue, and then obtain, from the access request, an input/output virtual address (IOVA) carried in the access request, that is, obtain the target guest physical address.
An address translation function of the external device can be implemented by using software or hardware. When the function is implemented by using the software, an executable program for implementing the function needs to be configured in the external device. When the function is implemented by using the hardware, the hardware needs to be configured in the external device. The hardware may be referred to as a device memory management unit (DMMU).
In a possible embodiment, when providing a virtual external device for a virtual machine, a virtual machine manager may, in some embodiments, provide a resource for the virtual machine in a form of a VF. Different VFs are distinguished based on VF identifiers (namely, VFIDs). In addition, the memory allocated to the external device is also distinguished based on a VF, and the first correspondence may be managed at a granularity of the VF. For example, when the first correspondence is stored in a page table manner, each page table is used to record a correspondence between a guest physical address and a host physical address that belong to one VF. The correspondence between the guest physical address and the host physical address that belong to the VF is used to record a correspondence between a guest physical address in guest physical address space allocated to the VF and a host physical address in physical memory space allocated to the VF. When the virtual machine manager provides a resource to the virtual machine in the form of the VF, if the virtual machine accesses the resource provided in the form of the VF, an access request received by the external device carries a VFID. After receiving the access request, the external device can obtain the VFID based on the access request. Then, as shown in
As shown in
A process in which the external device obtains, based on the access request, the target host physical address corresponding to the target guest physical address may be implemented by using microcode set in the external device, or may be implemented by using a hardware engine disposed in the external device. This is not specifically limited in this embodiment of the present disclosure.
In a possible embodiment, as shown in
In this case, the virtual machine manager is configured to provide the correspondence between the host physical address and the guest physical address for the address management module. The virtual machine manager can allocate a memory block to the virtual machine from the memory based on a specification of the virtual machine, perform device emulation for the virtual machine based on the memory block allocated to the virtual machine to obtain the virtual memory, configure guest physical address space of the virtual memory, then establish the correspondence between the host physical address of the memory block in the memory and the guest physical address in the guest physical address space, and provide the correspondence for the address management module. For example, as shown in
In the present disclosure, the server may be compatible with an original address translation function. For example, as shown in
In a possible embodiment, configuration is performed, so that the original remapping device of the server considers the access request as a translated request. In this way, the original remapping device of the server does not translate the target guest physical address carried in the access request, so that the access request is sent to the external device as the translated request, and the external device processes the access request. The translated request indicates that the address carried in the request is the host physical address. To achieve this objective, in one aspect, the external device supports the translated request, that is, the external device can translate the target guest physical address carried in the request that is considered by the original remapping device of the server as being translated. In another aspect, a type of the access request is a translated request.
If a current status of the external device supports the translated request, the external device does not need to be configured. If the current status of the external device does not support the translated request but the external device has a capability of supporting the translated request, the external device may be configured, so that the current status of the external device supports the translated request. In a possible embodiment, because a context entry in the configuration space of the external device usually records IOMMU page table information of the external device, the IOMMU page table information can indicate a capability of the external device for supporting a translated request, a request that is not translated, and an untranslated request. As shown in
It can be learned from the foregoing that, to bypass the original remapping device of the server, the type of the access request is ensured to be the translated request. Therefore, to cooperate with embodiment of the function, the type of the access request further is set in the present disclosure. The type of the access request may be set by setting a field in a transaction layer packet (TLP) header of the access request. A TLP header format of a PCIe request is shown in
When querying the first correspondence based on the target guest physical address, the external device may find the target host physical address corresponding to the target guest physical address (that is, hit), or may not find the target host physical address corresponding to the target guest physical address (that is, miss). For example, when the address management module does not record the correspondence between the target guest physical address and the corresponding target host physical address, when querying the first correspondence based on the target guest physical address, the external device cannot find the target host physical address corresponding to the target guest physical address. In this case, some processing needs to be performed for this case, so that the corresponding target host physical address can be found based on the target guest physical address. When the correspondence is recorded in the page table, and the external device cannot find, in the page table, the target host physical address corresponding to the target guest physical address, it may be referred to as that a page fault occurs. In this case, the foregoing processing performed on the page fault is also referred to as page fault processing.
In a possible embodiment, the external device is further configured to: when the first correspondence does not record the target host physical address corresponding to the target guest physical address, send a message indicating a matching failure to the address management module. The message carries the target guest physical address. The address management module is configured to forward the message to the virtual machine manager after receiving the message. The virtual machine manager is configured to: reallocate a memory block in the memory for the target guest physical address based on the message, establish a second correspondence between a host physical address of the reallocated memory block and the target guest physical address, and send the second correspondence to the address management module. The address management module is configured to update the first correspondence based on the second correspondence after receiving the second correspondence. In a process of obtaining the second correspondence, the virtual machine manager may perform page filling, for example, fill a correspondence between a missed guest physical address and a corresponding host physical address in a page table. For an embodiment process of determining the correspondence between the missed guest physical address and the corresponding host physical address, refer to the embodiment process of obtaining the first correspondence. Details are not described herein again. When an extended page table (extended page table, EPT) is set in the kernel of the server, when processing is performed for a miss case, a processing result may be further synchronized to the EPT.
As shown in
It should be noted that, when the second correspondence is updated based on the first correspondence, draining of tasks that use the first correspondence needs to be considered. That is, if a task that is using the first correspondence is being executed, the operation of updating the second correspondence based on the first correspondence is not performed, and after the task that is using the first correspondence is completed, the operation of updating the second correspondence based on the first correspondence is performed. In this way, it can be ensured that the task that is using the first correspondence can be correctly executed, to improve reliability of an update process.
It can be learned from the foregoing that the server system provided in the present disclosure can perform related processing, for example, perform page fault processing, when querying a correspondence based on the target guest physical address results in a miss, to resolve the miss problem. In this way, memory pinning can be avoided before the virtual machine is started, and global memory locking can be released. In cloud scenarios, when the external device is passed through to the virtual machine, memory pinning can be avoided, so that overcommitment and reuse of the virtual machine memory can be implemented without user awareness (without imposing special requirements on the virtual machine system). This improves overall memory usage of the server and ensures that performance of the server does not deteriorate. This feature is especially obvious in scenarios with high memory pressure. In addition, because memory pinning is avoided, there is no need to configure a large amount of memory in a cloud scenario because of pre-allocation of the memory by the virtual machine, so that memory usage costs in the cloud scenario can be reduced, a problem that a memory cost of a public cloud gradually increases can be resolved, and market competitiveness of the public cloud is enhanced.
In the present disclosure, interaction between the user mode and the kernel mode may be implemented according to a command. The kernel mode can interact with the external device by running the command. As shown in
In the present disclosure, a stream concurrency manner may be used to improve efficiency of interaction between the kernel mode and the external device. As shown in
In the present disclosure, one or more external devices may be inserted into one server, that is, a plurality of external devices can coexist. It should be noted that the plurality of external devices are isolated from each other.
In addition, a granularity of a page table used in the present disclosure may be configured based on an application requirement. In addition, in the present disclosure, multi-level page table mapping lookup and hash mapping lookup may be used for page table lookup. For example, for a memory page with a granularity of 4 kilobytes (KB)/8 KB, multi-level page table lookup may be used to save memory space, and for a large page with a large granularity, hash mapping is used to perform lookup, to reduce a lookup latency.
The present disclosure is equivalent to a system layer that collaborates with a virtual function input/output (VFIO) device driver and a memory management unit (like a DMMU) on an external device to jointly resolve a problem existing in current address translation. When swapping in or out the virtual machine memory, the hypervisor performs an operation on a VFIO driver through a system API, sends feedback to the DMMU of the device to ensure correctness of a DMA of the external device, and updates an EPT table to ensure correctness of a virtual machine address. The external device uses an address translation capability to offload memory address management of the external device to a specific device, so that translation pressure of an IOMMU/SMMU can be alleviated, and virtual address management performance can be improved.
It can be learned from the foregoing that improvements of the present disclosure mainly have values in the following two aspects.
1. As a quantity of VFs of a host device gradually increases, the memory management function in the present disclosure can prevent operational performance (for example, DMA performance) of an external device from deteriorating. In comparison with the address translation function of the IOMMU/SMMU, in the present disclosure, the external device is enabled to directly manage the memory, so that a performance bottleneck of the IOMMU/SMMU can be alleviated, device address translation efficiency can be improved, and address translation can be accelerated.
2. The present disclosure can improve public cloud memory utilization, reduce cloud memory costs, resolve a key technology bottleneck of memory overcommitment, and enhance public cloud market competitiveness.
The present disclosure can be initially applied to an external device (like a network interface card) of a public cloud, and can be gradually promoted to product lines such as a cloud core and storage in the future. After the standard is formed, the present disclosure can be gradually pushed to the community to form a core standard for an IPU/DPU.
The following describes an embodiment process of a method for accessing a public cloud technology-based server system according to an embodiment of the present disclosure.
Operation 1601: A cloud management platform obtains a virtual machine creation request input by a tenant, where the virtual machine creation request carries a target specification of a to-be-created virtual machine, selects, from a plurality of servers managed by the cloud management platform, a server that can provide the target specification, and creates the virtual machine in the selected server.
The cloud management platform is configured to manage an infrastructure, and the infrastructure includes the plurality of servers. When the tenant needs to create the virtual machine based on the infrastructure managed by the cloud management platform, the tenant may perform a specified operation on a client used by the tenant, to trigger the virtual machine creation request, so that the cloud management platform creates the virtual machine for the tenant under an indication of the virtual machine creation request. After the tenant triggers the virtual machine creation request, the cloud management platform can obtain the virtual machine creation request, and obtain the target specification from the virtual machine creation request. After obtaining the target specification set by the tenant, the cloud management platform may select, in the infrastructure, the server that can provide the target specification, and create, in the selected server, the virtual machine that meets the target specification. In a process of creating the virtual machine, a virtual machine manager in the server needs to provide virtual hardware for the virtual machine based on the target specification. For example, the target specification indicates that the virtual machine needs to use a capability of the external device of the server and a capability of a memory of the server. In this case, the virtual machine manager needs to perform device emulation based on the external device to obtain a virtual external device and a virtual device driver of the virtual external device, so that the virtual machine can use the capability of the external device. In addition, the virtual machine manager needs to perform device emulation based on the memory of the server to obtain a virtual memory, so that the virtual machine can use the capability of the memory. The server includes one or more of the following: a memory inserted into the server or a shared memory of the server. In a process of obtaining the virtual memory, the virtual machine manager needs to configure guest physical address space of the virtual memory, and establish a correspondence between a host physical address of a memory block configured in the memory for the external device and a guest physical address in the guest physical address space. In addition, the virtual machine manager needs to send the correspondence to an address management module in a kernel mode of the server.
Operation 1602: The virtual device driver sends an access request to the external device when the virtual external device accesses a target guest physical address of the virtual memory, where the access request carries the target guest physical address.
For an embodiment of an implementation process of operation 1602, refer to related descriptions in the foregoing server system. It should be noted that, when the server is compatible with an original address translation function, some modifications may be made in the server, so that the access request using the capability of the external device can be processed by the external device, instead of being processed by the original address translation function of the server, that is, the original address translation function of the server is bypassed. In a possible embodiment, the function may be implemented by setting configuration space of the external device and/or setting the access request. For example, it may be set that configuration information of the external device indicates that the access request is sent to the external device in a straight-through manner, and the access request indicates that an address carried in the access request is a host physical address obtained through translation. For example, the configuration information of the external device indicates that the external device supports a translated request, and the access request indicates that an address carried in the access request is a host physical address. For an embodiment of an implementation principle thereof, refer to related descriptions in the foregoing server system. Details are not described herein again.
Operation 1603: The external device queries, based on the access request, a first correspondence between a guest physical address and a host physical address.
For an embodiment of an implementation process of operation 1603, refer to related descriptions in the foregoing server system. Details are not described herein again.
Operation 1604: After finding, based on the access request, a target host physical address corresponding to the target guest physical address, the external device obtains target data recorded at the target host physical address, and sends the target data to the virtual device driver.
For an embodiment of an implementation process of operation 1604, refer to related descriptions in the foregoing server system. Details are not described herein again.
When querying the first correspondence based on the target guest physical address, the external device may find the target host physical address corresponding to the target guest physical address (that is, hit), or may not find the target host physical address corresponding to the target guest physical address (that is, miss). For example, when the address management module does not record the correspondence between the target guest physical address and the corresponding target host physical address, when querying the first correspondence based on the target guest physical address, the external device cannot find the target host physical address corresponding to the target guest physical address. In this case, some processing may be performed for this case, so that the corresponding target host physical address can be found based on the target guest physical address. Therefore, as shown in
Operation 1605: When the first correspondence does not record the target host physical address corresponding to the target guest physical address, the external device sends a message indicating a matching failure to the address management module, where the message carries the target guest physical address.
For an embodiment of an implementation process of operation 1605, refer to related descriptions in the foregoing server system. Details are not described herein again.
Operation 1606: The address management module forwards the message to the virtual machine manager.
For an embodiment of an implementation process of operation 1606, refer to related descriptions in the foregoing server system. Details are not described herein again.
Operation 1607: The virtual machine manager allocates a memory block in the memory for the target guest physical address based on the message, establishes a second correspondence between a host physical address of the memory block and the target guest physical address, and sends the second correspondence to the address management module.
For an embodiment of an implementation process of operation 1607, refer to related descriptions in the foregoing server system. Details are not described herein again.
Operation 1608: The address management module updates the first correspondence based on the second correspondence.
For an embodiment of an implementation process of operation 1608, refer to related descriptions in the foregoing server system. Details are not described herein again.
It can be learned from the foregoing that, it is equivalent to that the server system offloads an address translation function to the external device, so that the external device directly manages memory allocated to the virtual machine, and shares a task of performing address translation on a target guest physical address in an access request. In this way, an address translation device like an IOMMU/SMMU in the server does not need to execute the address translation task, and a TLB of the address translation device like the IOMMU/SMMU in the server does not need to record a correspondence of a target guest physical address accessed by the virtual external device of the external device, thereby reducing a quantity of correspondences that must be recorded in the TLB, and alleviating a conflict between a small quantity of page table entries of the TLB and an excessive quantity of external devices. This reduces a probability of a TLB page fault in an address translation process, effectively improves the address translation performance of the server system, thereby improving operational performance (for example, DMA performance) of the external devices and increasing the efficiency in memory management.
It should be noted that a sequence of operations of the method for accessing the public cloud technology-based server system provided in this embodiment of the present disclosure may be properly adjusted, or operations may be correspondingly added or deleted based on a situation. Any variation method readily figured out by a person skilled in the art within the technical scope disclosed in the present disclosure shall fall within the protection scope of the present disclosure. Therefore, details are not described herein.
The following describes a basic hardware structure in embodiments of the present disclosure by using an example.
The present disclosure further provides a compute device. As shown in
The bus 1802 may be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. Buses may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, the bus is indicated by using only one line in
The processor 1804 may include any one or more of processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
The memory 1806 is configured to store a computer program, and the computer program includes an operating system and executable code (namely, program instructions). The memory 1806 may include a volatile memory, for example, a random access memory (RAM). The processor 1804 may further include a non-volatile memory, for example, a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD).
The memory 1806 stores executable program code, and the processor 1804 executes the executable program code to implement the method for accessing the public cloud technology-based server system provided in embodiments of the present disclosure. In other words, the memory 1806 stores instructions used to perform the method for accessing the public cloud technology-based server system.
The communication interface 1808 implements communication between the compute device 1800 and another device or a communication network via a transceiver module, for example, but not limited to a network interface card or a transceiver.
An embodiment of the present disclosure further provides a compute device cluster. The compute device cluster includes at least one compute device. The compute device may be a server, for example, a central server, an edge server, or a local server in a local data center. In some embodiments, the compute device may alternatively be a terminal device, for example, a desktop computer, a notebook computer, or a smartphone.
As shown in
In some possible implementations, the memories 1806 of the one or more compute devices 1800 in the compute device cluster may also separately store a part of instructions used to perform the method for accessing the public cloud technology-based server system. In other words, a combination of one or more compute devices 1800 may jointly execute the instructions used to perform the method for accessing the public cloud technology-based server system.
It should be noted that the memories 1806 of different compute devices 1800 in the compute device cluster may store different instructions, which are respectively used to perform a part of functions of the method for accessing the public cloud technology-based server system. In other words, instructions stored in the memories 1806 of different compute devices 1800 may implement a part of functions of the method for accessing the public cloud technology-based server system.
In some possible implementations, the one or more compute devices in the compute device cluster may be connected through a network. The network may be a wide area network, a local area network, or the like.
It should be understood that functions of the compute device 1800A shown in
An embodiment of the present disclosure further provides another compute device cluster. For a connection relationship between compute devices in the compute device cluster, refer to the connection manners in the compute device cluster in
In some possible implementations, the memories 1806 of the one or more compute devices 1800 in the compute device cluster may also separately store a part of instructions used to perform a public cloud technology-based memory management method. In other words, a combination of one or more compute devices 1800 may jointly execute the instructions used to perform the method for accessing the public cloud technology-based server system.
An embodiment of the present disclosure further provides a server. The server is configured to implement a function of a server in the server system provided in the present disclosure. For a working principle and an embodiment of an implementation of the server, refer to related descriptions in the foregoing server system.
An embodiment of the present disclosure further provides a method for accessing a public cloud technology-based server system performed by a server provided in the present disclosure. The server performs the method, to implement a function of the server in the method for accessing the public cloud technology-based server system provided in the present disclosure. For a working principle and an embodiment of the server, refer to related descriptions in the foregoing server system.
An embodiment of the present disclosure further provides an external device. The external device is configured to implement a function of the external device in the server system provided in the present disclosure. For a working principle and an embodiment of the external device, refer to the related description in the foregoing server system.
An embodiment of the present disclosure further provides a method for accessing a public cloud technology-based server and performed by an external device provided in the present disclosure. The external device performs the method, to implement a function of the external device in the method for accessing the public cloud technology-based server system provided in the present disclosure. For a working principle and an embodiment of the external device, refer to related descriptions in the foregoing server system.
An embodiment of the present disclosure further provides a computer program product including instructions. The computer program product may be software or a program product that includes instructions and that can be run on a compute device or stored in any usable medium. When the computer program product runs on at least one compute device, the at least one compute device is enabled to perform the method for accessing the public cloud technology-based server system provided in the present disclosure.
An embodiment of the present disclosure further provides a computer-readable storage medium. The computer-readable storage medium may be any usable medium that can be stored by a compute device, or a data storage device like a data center including one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk drive, or a magnetic tape), an optical medium (for example, a digital video disk (DVD)), a semiconductor medium (for example, a solid-state drive), or the like. The computer-readable storage medium includes instructions, and the instructions instruct a compute device to perform a method for accessing a public cloud technology-based server system, or instruct a compute device to perform a method for accessing a public cloud technology-based server system.
A person of ordinary skill in the art may understand that all or a part of the operations of embodiments may be implemented by hardware or a program instructing related hardware. The program may be stored in a computer-readable storage medium. The storage medium may include: a read-only memory, a magnetic disk, or an optical disc.
It should be noted that information (including but not limited to user equipment information, user personal information, and the like), data (including but not limited to data for analysis, data for storage, data for display, and the like), and signals in the present disclosure are all authorized by users or fully authorized by all parties, and collection, use, and processing of related data comply with related laws, regulations, and standards of related countries and regions. For example, original data, executable code, and the like in the present disclosure are obtained under full authorization.
In embodiments of the present disclosure, the terms “first”, “second”, and “third” are merely used for description, but cannot be understood as an indication or implication of relative importance. The term “at least one” means one or more, and the term “a plurality of” means two or more, unless otherwise expressly limited.
The term “and/or” in the present disclosure describes only an association relationship for describing associated objects and represents that three relationships may exist. For example, A and/or B may represent the following three cases: Only A exists, both A and B exist, and only B exists. In addition, the character “/” in this specification generally indicates an “or” relationship between the associated objects.
It should be noted that, the foregoing embodiments are merely intended to describe the technical solutions of the present disclosure, and are not intended to limit the present disclosure. Although the present disclosure is described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that modifications may still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions may be made to a part of the technical features. However, these modifications or substitutions do not make the essence of the corresponding technical solution depart from the scope of the technical solutions of embodiments of the present disclosure.
Claims
1. A public cloud technology-based server system, wherein the server system comprises a server and an external device inserted into the server, and a connection channel is established between the server and the external device;
- the server is provided with a virtual machine and a virtual machine manager, the virtual machine manager is configured to provide virtual hardware for the virtual machine, the virtual hardware comprises a virtual external device and a virtual memory, the virtual external device is obtained by device emulation based on the external device, the virtual memory is obtained by device emulation based on a memory configured for the external device, the virtual machine is provided with a virtual device driver for the virtual external device, and the virtual device driver is configured to send an access request to the external device when the virtual external device accesses a target guest physical address of the virtual memory, wherein the access request carries the target guest physical address; and
- the external device is configured to: query, based on the access request, a first correspondence between a guest physical address and a host physical address to obtain a target host physical address corresponding to the target guest physical address; obtain target data recorded at the target host physical address; and send the target data to the virtual device driver.
2. The server system according to claim 1, wherein the server is further provided with an address management module;
- the external device is further configured to: when the first correspondence does not record the target host physical address corresponding to the target guest physical address, send a message indicating a matching failure to the address management module, wherein the message carries the target guest physical address;
- the address management module is configured to forward the message to the virtual machine manager;
- the virtual machine manager is configured to: allocate a memory block in the memory for the target guest physical address based on the message, establish a second correspondence between a host physical address of the memory block and the target guest physical address, and send the second correspondence to the address management module; and
- the address management module is configured to update the first correspondence based on the second correspondence.
3. The server system according to claim 1, wherein the server is further provided with the address management module; and
- the virtual machine manager is configured to: perform, based on a specification of the virtual machine, device emulation for the virtual machine to obtain the virtual memory; configure guest physical address space of the virtual memory; establish a correspondence between a host physical address of a memory block configured in the memory for the external device and a guest physical address in the guest physical address space; and send the correspondence to the address management module.
4. The server system according to claim 1, wherein configuration information of the external device indicates that the external device supports a translated request, and the access request indicates that an address carried in the access request is a host physical address.
5. The server system according to claim 1, wherein the memory configured for the external device comprises one or more of the following: a memory inserted into the server or a shared memory of the server.
6. A method for accessing a public cloud technology-based server system, wherein the server system comprises a server and an external device inserted into the server, a connection channel is established between the server and the external device, the server is provided with a virtual machine and a virtual machine manager, the virtual machine manager is configured to provide virtual hardware for the virtual machine, the virtual hardware comprises a virtual external device and a virtual memory, the virtual external device is obtained by device emulation based on the external device, the virtual memory is obtained by device emulation based on a memory configured for the external device, and the virtual machine is provided with a virtual device driver for the virtual external device; and the method comprises:
- sending, by the virtual device driver, an access request to the external device when the virtual external device accesses a target guest physical address of the virtual memory, wherein the access request carries the target guest physical address; and
- querying, by the external device based on the access request, a first correspondence between a guest physical address and a host physical address to obtain a target host physical address corresponding to the target guest physical address; obtaining target data recorded at the target host physical address; and sending the target data to the virtual device driver.
7. The method according to claim 6, wherein the server is further provided with an address management module, and the method further comprises:
- when the first correspondence does not record the target host physical address corresponding to the target guest physical address, sending, by the external device, a message indicating a matching failure to the address management module, wherein the message carries the target guest physical address;
- forwarding, by the address management module, the message to the virtual machine manager;
- allocating, by the virtual machine manager, a memory block in the memory for the target guest physical address based on the message, establishing a second correspondence between a host physical address of the memory block and the target guest physical address, and sending the second correspondence to the address management module; and
- updating, by the address management module, the first correspondence based on the second correspondence.
8. The method according to claim 6, wherein the server is further provided with the address management module, and the method further comprises:
- performing, by the virtual machine manager based on a specification of the virtual machine, device emulation for the virtual machine to obtain the virtual memory, configuring guest physical address space of the virtual memory, establishing a correspondence between a host physical address of a memory block configured in the memory for the external device and a guest physical address in the guest physical address space, and sending the correspondence to the address management module.
9. The method according to claim 6, wherein configuration information of the external device indicates that the external device supports a translated request, and the access request indicates that an address carried in the access request is a host physical address.
10. The method according to claim 6, wherein the memory configured for the external device comprises one or more of the following: a memory inserted into the server or a shared memory of the server.
Type: Application
Filed: Jul 9, 2026
Publication Date: Nov 26, 2026
Applicant: Huawei Cloud Computing Technologies Co., Ltd. (Guizhou)
Inventors: Mohua Li (Beijing), Xiubin Mao (Hangzhou), Jianhai Luan (Beijing), Lei Gong (Hangzhou), Huaguo Xie (Shenzhen)
Application Number: 19/736,527