CN108667750B - Virtual resource management method and device - Google Patents

Virtual resource management method and device Download PDF

Info

Publication number
CN108667750B
CN108667750B CN201710209180.8A CN201710209180A CN108667750B CN 108667750 B CN108667750 B CN 108667750B CN 201710209180 A CN201710209180 A CN 201710209180A CN 108667750 B CN108667750 B CN 108667750B
Authority
CN
China
Prior art keywords
network card
target
virtual
virtual network
target virtual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710209180.8A
Other languages
Chinese (zh)
Other versions
CN108667750A (en
Inventor
林霖
赵永良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710209180.8A priority Critical patent/CN108667750B/en
Publication of CN108667750A publication Critical patent/CN108667750A/en
Application granted granted Critical
Publication of CN108667750B publication Critical patent/CN108667750B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/78Architectures of resource allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Abstract

The disclosure provides a virtual resource management method and device, and belongs to the technical field of virtualization. The method comprises the following steps: determining a target virtual network card from a plurality of virtual network cards corresponding to the target network card, wherein the target network card is a network card with the residual bandwidth larger than the target bandwidth, and the target virtual network card is a virtual network card which is not bound with any virtual machine currently; binding the target virtual machine with the target virtual network card, and mapping the target virtual network card to the target virtual machine; and acquiring port information for indicating the target network card and the target virtual network card, and returning the port information to the VMS. According to the method and the device, the network card with the residual bandwidth larger than the target bandwidth is used as the target network card according to the target bandwidth required by message transmission, the target virtual network card is distributed to the target virtual machine in the target network card, the virtual network card capable of being mapped is actively provided for a user, the requirement of the user on the bandwidth during message transmission is guaranteed, and the intelligence is high.

Description

Virtual resource management method and device
Technical Field
The present disclosure relates to the field of virtualization technologies, and in particular, to a method and an apparatus for managing virtual resources.
Background
With the continuous development of the virtualization technology field, more and more applications are built on cloud computing such as cloud infrastructure or cloud service, and the cloud computing can enjoy the advantages of low cost investment, quick online, improved deployment, operation and maintenance efficiency, flexible service expansion and the like. Cloud computing is a computing model for providing dynamically scalable virtualized resources in a service manner through the internet, and thus virtualization is one of core technologies in the field of cloud computing. In cloud computing, a virtual machine can be created by means of a virtualization technology, and abstraction and isolation of bottom hardware facilities are completed based on the virtual machine, so that multiple cloud computing users can share the same hardware environment without mutual interference. The virtual machine enables each cloud computing user to think that the cloud computing user has an independent hardware environment, and provides a foundation for constructing Infrastructure as a Service (IaaS). The virtual machine needs to run Hypervisor (virtual machine monitor) on the physical machine, and the Hypervisor is responsible for managing and allocating system resources to the virtual machine. When creating a virtual machine in a virtualized Network, a general solution is to construct a virtual Network layer in Hypervisor, which is responsible for allocating resources to the virtual machine and communicating the virtual machine with the outside, for example, referring to fig. 1A, a switch of Open virtual switch standard (OVS) may be constructed in Hypervisor, a Network Interface Controller (NIC) of a physical machine is connected to a virtual port of the OVS, the OVS allocates virtual resources to the virtual port, and completes forwarding a message between different virtual ports. Referring to fig. 1B, based on the SR-IOV technology, the Virtual resources of the NIC may be distributed, a plurality of Virtual Function (VF) network cards are configured, each VF network card may be directly mapped to one Virtual machine, and the messages may be directly handed over to the physical network card by the VF network card without being processed by Hypervisor, thereby reducing the time delay.
In the course of implementing the present disclosure, the inventors found that the prior art has at least the following problems:
when the VF network card is mapped to the virtual machine by the SR-IOV technology, in order to ensure that the message transmission between the VF network card and the physical network card is normal, a cloud computing user needs to select the VF network card to be mapped, and perform message transmission using the virtual resource provided by the VF network card, and when performing message transmission, the cloud computing user needs to perform transmission according to the bandwidth of the currently mapped VF network card, so that the service provided by cloud computing has limitation on the bandwidth, and the intelligence is low, and therefore a method for performing integrated management on the virtual resource is urgently needed.
Disclosure of Invention
In order to solve the problems in the prior art, the embodiments of the present disclosure provide a virtual resource management method and apparatus. The technical scheme is as follows:
in a first aspect, a virtual resource management method is provided, where the method includes:
receiving a virtual resource allocation request sent by a VMS (virtual machine management system), wherein the virtual resource allocation request carries a target bandwidth and a target virtual machine identifier;
acquiring the residual bandwidth of each network card from a network card list, and taking the network card with the residual bandwidth larger than the target bandwidth as the target network card, wherein the network card list is used for recording network card information of the network card which is already brought into management in the current resource pool, and the network card information comprises a network card identifier and the residual bandwidth;
determining a target virtual network card from a plurality of virtual network cards corresponding to the target network card, wherein the target virtual network card is a virtual network card which is not bound with any virtual machine currently;
binding the target virtual machine with the target virtual network card, and mapping the target virtual network card to the target virtual machine;
and obtaining port information used for indicating the target network card and the target virtual network card, and returning the port information to a virtualization management system VMS, wherein the port information comprises a target virtual network card identifier of the target virtual network card and a target network card identifier of the target network card to which the target virtual network card belongs, and is used for indicating a binding relationship existing between the target virtual network card and a virtual machine.
According to the method provided by the embodiment of the invention, the network card with the residual bandwidth larger than the target bandwidth is used as the target network card according to the target bandwidth required by the transmission message, and the virtual network card which is not bound with any virtual machine is distributed in the target network card to be used as the target virtual network card, so that the virtual network card capable of being mapped can be actively provided for the user, the requirement of the user on the bandwidth during the message transmission is ensured, and the intelligence is higher. In addition, according to the target bandwidth carried in the virtual resource allocation request, the network card with the residual bandwidth larger than the target bandwidth is determined in the network card list as the virtual network card, so that the requirement of a user on the bandwidth during message transmission is ensured, and the limitation on message transmission is low.
In one possible implementation manner, the determining a target virtual network card from among a plurality of virtual network cards corresponding to the target network card includes:
inquiring a virtual network card list of the target network card, wherein the virtual network card list comprises at least one item of virtual network card information, and each item of virtual network card information is used for indicating the binding state of the virtual network card;
and taking one virtual network card which is not bound in the binding state as the target virtual network card, and adding a target virtual machine identifier in the virtual network card information of the target virtual network card.
According to the method provided by the embodiment of the invention, the virtual network card which is not bound in the binding state in the virtual network card list of the target network card is used as the target virtual network card, and the target virtual machine identifier is added into the virtual network card information of the target virtual network card, so that the target virtual machine and the target virtual network card are bound, the user does not need to execute operation, and the intelligence is high.
In one possible implementation, the method further includes:
receiving a virtual resource release request sent by the VMS, wherein the virtual resource release request carries the port information;
and unbinding the target virtual network card and the target virtual machine according to the port information, and removing the mapping from the target virtual network card to the target virtual machine.
According to the method provided by the embodiment of the invention, when the virtual resource release request is received, the binding between the target virtual network card and the target virtual machine can be released according to the port information carried in the virtual resource release request, and the mapping from the target virtual network card to the target virtual machine can be released, so that the target virtual network card can be continuously used in the subsequent process, the high utilization rate of the virtual resources is ensured, and the intelligence is high.
In one possible implementation manner, the unbinding the target virtual network card and the target virtual machine according to the port information includes:
and clearing the virtual machine identifier of the target virtual network card in the virtual network card information in the virtual network card list of the target network card.
According to the method provided by the embodiment of the invention, the virtual machine identifier of the target virtual network card in the virtual network card information in the virtual network card list of the target network card is eliminated, so that the target virtual network card can be continuously used in the subsequent process, and the intelligence is higher.
In a second aspect, a virtual resource management apparatus is provided, where the apparatus includes a plurality of functional modules, and the functional modules are configured to execute the virtual resource management method provided in the first aspect and any possible implementation manner thereof.
In a third aspect, a virtual resource management device is provided, which includes a processing component, at least one network card, and at least one memory. At least one virtual machine runs on the device, and each virtual machine in the at least one virtual machine occupies a part of resources of the virtual resource management device; the processing component includes at least one processor for executing instructions, the memory for storing executable instructions executable by the processing component for performing: receiving a virtual resource allocation request sent by a VMS (virtual machine management system), wherein the virtual resource allocation request carries a target bandwidth and a target virtual machine identifier; acquiring the residual bandwidth of each network card from a network card list, and taking the network card with the residual bandwidth larger than the target bandwidth as the target network card, wherein the network card list is used for recording network card information of the network card which is already brought into management in the current resource pool, and the network card information comprises a network card identifier and the residual bandwidth; determining a target virtual network card from a plurality of virtual network cards corresponding to the target network card, wherein the target network card is a network card with residual bandwidth larger than the target bandwidth, and the target virtual network card is a virtual network card which is not bound with any virtual machine currently; binding the target virtual machine with the target virtual network card, and mapping the target virtual network card to the target virtual machine; and acquiring port information used for indicating the target network card and the target virtual network card, wherein the port information comprises a target virtual network card identifier of the target virtual network card and a target network card identifier of the target network card to which the target virtual network card belongs, and is used for indicating a binding relationship existing between the target virtual network card and a virtual machine, and returning the port information to a virtual management system VMS.
In one possible implementation manner, before determining the target virtual network card from the plurality of virtual network cards corresponding to the target network card, the method further includes:
receiving a virtual resource allocation request sent by the VMS, wherein the virtual resource allocation request carries a target bandwidth and a target virtual machine identifier;
and acquiring the residual bandwidth of each network card from the network card list, and taking the network card with the residual bandwidth larger than the target bandwidth as the target network card.
In one possible implementation manner, the determining a target virtual network card from among a plurality of virtual network cards corresponding to the target network card includes:
inquiring a virtual network card list of the target network card, wherein the virtual network card list comprises at least one item of virtual network card information, and each item of virtual network card information is used for indicating the binding state of the virtual network card;
and taking one virtual network card which is not bound in the binding state as the target virtual network card, and adding a target virtual machine identifier in the virtual network card information of the target virtual network card.
In one possible implementation, the method further includes:
receiving a virtual resource release request sent by the VMS, wherein the virtual resource release request carries the port information;
and unbinding the target virtual network card and the target virtual machine according to the port information, and removing the mapping from the target virtual network card to the target virtual machine.
In one possible implementation manner, the unbinding the target virtual network card and the target virtual machine according to the port information includes:
and clearing the virtual machine identifier of the target virtual network card in the virtual network card information in the virtual network card list of the target network card.
Drawings
Fig. 1A is a schematic diagram of a virtual resource management method provided in an embodiment of the present disclosure;
fig. 1B is a schematic diagram of a virtual resource management method provided by an embodiment of the present disclosure;
fig. 2A is a block diagram of a virtual resource management apparatus provided by an embodiment of the present disclosure;
fig. 2B is a schematic diagram of a virtual resource management method provided by an embodiment of the present disclosure;
fig. 2C is a schematic diagram of a virtual resource management method provided by an embodiment of the present disclosure;
fig. 2D is a schematic diagram of a virtual resource management method provided by an embodiment of the present disclosure;
FIG. 3A is a flowchart of a virtual resource management method provided by an embodiment of the present disclosure;
fig. 3B is a flowchart of a virtual resource management method provided by an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a virtual resource management device according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more apparent, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
Fig. 2A is a block diagram illustrating a virtual resource management apparatus 200 in accordance with an example embodiment. For example, the apparatus 200 may be provided as an electronic device. Referring to fig. 2A, the device 200 includes a processing component 222 thereon, which further includes one or more processors and storage resources, represented by memory 232, for storing instructions, such as applications, executable by the processing component 222, the device 200 also includes at least one network card 250 and at least one memory 232.
At least one virtual machine VM runs on the apparatus 200, and each virtual machine VM occupies a part of resources of the virtual resource management apparatus 200, such as memory resources or bandwidth resources provided by a network card, so as to implement isolated running between virtual machines, so that a virtual machine user can enjoy an independent running environment.
The application program stored in the memory 232 of the virtual resource management device may include one or more modules each corresponding to a set of instructions. Further, the processing component 222 is configured to execute instructions to perform the virtual resource management methods described above.
The apparatus 200 may also include a power component 226 configured to perform power management of the apparatus 200, and a wired or wireless network interface configured to connect the apparatus 200 to a network. The apparatus 200 may operate based on an operating system, such as Windows Server, stored in the memory 232TM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTMOr the like.
Referring to fig. 2B, a network card connection method according to an embodiment of the disclosure is briefly described. An SR-IOV Federation Switch (SFS) is defined in the Hypervisor layer, and the SFS is essentially a logical Switch and can access all network cards in the Hypervisor layer. The network cards and the virtual network cards in the network cards are accessed to the SFS, and the network cards and the virtual network cards in the network cards are presented outwards as ports of the SFS, so that the SFS can manage the resources of the network cards and the virtual network cards in the network cards. The SFS forms a resource pool with all the network cards brought into management and the virtual network cards in the network cards, and can specify a target bandwidth required for message transmission after a user creates a virtual machine, and the SFS can select a suitable virtual network card from the resource pool according to the remaining bandwidth of each network card and allocate the virtual network card to the virtual machine created by the user.
Referring to fig. 2C, the SFS may be software deployed on the Hypervisor, and may provide an operation interface for a Virtual Manager System (VMS). Among the operation interfaces provided by the SFS may be CreatInstance, AllocPort, and FreePort. The creatInstance is used for creating the SFS instance and accessing the specified network card in the NICList into the SFS. The NICLIst comprises the currently available network cards which are connected to the same physical network and have SR-IOV functions. The AllocPort is used for allocating a port for the target virtual machine identifier, the SFS can select a target network card with the residual bandwidth larger than the target bandwidth from the resource pool based on the AllocPort, determine the target virtual network card from the plurality of virtual network cards corresponding to the target network card, map the target virtual network card to the target virtual machine indicated by the target virtual machine identifier, and return the port information to the VMS. The Freeport is used for releasing a port bound with the target virtual machine, the SFS can determine a target virtual network card bound with the target virtual machine according to the port information, and the mapping between the target virtual network card and the target virtual machine is relieved based on the Freeport.
Referring to fig. 2D, a network card list NICTable and a virtual network card list VFTable are stored in the SFS. The NICTABLE is used for recording network card information of the network cards which are already brought into management in the current resource pool, and the network card information comprises network card identification, residual bandwidth, the number of virtual network cards available for each network card and the like. The VFTable is used for recording virtual network card information of all virtual network cards on one network card, including virtual network card identifiers and target virtual machine identifiers of target virtual machines mapped by the virtual network cards. Wherein, each network card corresponds to a VFTable.
FIG. 3A is a flow diagram illustrating a method of virtual resource management in accordance with an exemplary embodiment. As shown in fig. 3A, the method includes the following steps.
In step 301, the VMS sends a virtual resource allocation request to the SFS, where the virtual resource allocation request carries a target bandwidth and a target virtual machine identifier.
In the embodiment of the present disclosure, in order to ensure that a user has a requirement for a bandwidth when performing message transmission based on a target virtual machine, the user may set the target bandwidth, so that the SFS may allocate a target virtual network card to the target virtual machine created by the user based on the target bandwidth, and ensure that the bandwidth of the target virtual network card may meet the bandwidth required by the user when performing message transmission based on the target virtual machine. The user client of the user may provide a virtual machine creation portal, and when the user client detects that the user clicks on the virtual machine creation portal, a target bandwidth setting interface may be displayed. And displaying a target bandwidth input box on the target bandwidth setting interface, and taking the numerical value input by the user in the target bandwidth input box as the target bandwidth, so that after the target bandwidth is set, when the operation that the user confirms to establish the virtual machine is detected, the user client generates a virtual machine establishing instruction carrying the target bandwidth, and sends the virtual machine establishing instruction to the VMS. After receiving a virtual machine creation instruction of a user, the VMS acquires a target bandwidth from the virtual machine creation instruction, creates a target virtual machine for the user, generates a virtual resource allocation request based on a target virtual machine identifier of the created target virtual machine and the target bandwidth, and sends the virtual resource allocation request to the SFS, so that the SFS allocates a target virtual network card for the virtual machine according to the target bandwidth and the target virtual machine identifier carried in the virtual resource allocation request after receiving the virtual resource allocation request. The user client mentioned in the embodiments of the present disclosure may refer to a client that a user uses to log in a virtual machine service, or may refer to a terminal that the user uses to log in the virtual machine service at a cloud.
In step 302, when the SFS receives the virtual resource allocation request sent by the VMS, the SFS obtains the remaining bandwidth of each network card from the network card list, and takes the network card whose remaining bandwidth is greater than the target bandwidth as the target network card.
In the embodiment of the present disclosure, the target network card is a network card whose remaining bandwidth is greater than the target bandwidth, and in order to ensure that the user is not limited by the bandwidth when performing message transmission based on the target virtual machine, it is necessary to select the target network card whose remaining bandwidth is greater than the target bandwidth set by the user, and allocate the target virtual network card to the target virtual machine created by the user in the target network card. The network card list, that is, the aforementioned nic table, stores the network card information of the network cards that have been brought into management in the current resource pool, including the network card identifier, the remaining bandwidth, and the number of virtual network cards available to each network card. In this way, the SFS may obtain the remaining bandwidth of each network card in the network card list, compare the remaining bandwidth of each network card with the target bandwidth, and select the network card with the remaining bandwidth greater than the target bandwidth as the target network card.
It should be noted that, if there are multiple network cards whose remaining bandwidths are greater than the target bandwidth in the network card list, and in order to avoid wasting virtual resources, the remaining bandwidths of the multiple network cards are reasonably utilized, the remaining bandwidths of the multiple network cards may be sequentially compared with each other, and the network card with the smallest remaining bandwidth is selected from the multiple network cards whose remaining bandwidths are greater than the target bandwidth as the target network card. For example, if the target bandwidth is 1.5G, there are four network cards with remaining bandwidths greater than the target bandwidth, i.e., NIC1, NIC2, NIC3, and NIC4, the remaining bandwidth of NIC1 is 4.5G, the remaining bandwidth of NIC2 is 3G, the remaining bandwidth of NIC3 is 2G, and the remaining bandwidth of NIC4 is 1.7G, then compare the remaining bandwidth of NIC1 with the remaining bandwidth of NIC2, and the remaining bandwidth of NIC1 is 4.5 greater than the remaining bandwidth of NIC2, so that NIC1 is excluded, and the remaining bandwidth of NIC2 is compared with the remaining bandwidth of NIC 3; the remaining bandwidth 3G of NIC2 is greater than the remaining bandwidth 2G of NIC3, thus, NIC2 is excluded and NIC3 is compared to NIC 4; the remaining bandwidth 2G of the NIC3 is greater than the remaining bandwidth 1.7G of the NIC4, and therefore, the NIC3 is excluded and the NIC4 is used as the target network card.
In step 303, the SFS queries a virtual network card list of the target network card, and uses one virtual network card with an unbound binding state as the target virtual network card, where the virtual network card list includes at least one item of virtual network card information, and each item of virtual network card information is used to indicate the binding state of the virtual network card.
In the embodiment of the present disclosure, the target virtual network card is a virtual network card that is not currently bound to any virtual machine. In order to avoid a binding relationship between a target virtual network card allocated to a target virtual machine and other virtual machines, which may cause a message transmission error, it is necessary to determine a virtual network card that is not bound to any virtual machine among the virtual network cards of the target network card as the target virtual network card. The virtual network card list, that is, the above mentioned VFTable, is used to record the virtual network card information of all the virtual network cards on one network card, including the virtual network card identifier and the target virtual machine identifier of the target virtual machine mapped by the virtual network card. In this way, after the target network card is determined, since the SFS stores the virtual network card list corresponding to each network card, the SFS can acquire the virtual network card list corresponding to the target network card and acquire the virtual network card information of a plurality of virtual network cards in the target network card in the virtual network card list.
The virtual network card information is used for indicating the binding state of the virtual network card, that is, for indicating whether a mapping relationship exists between the virtual network card and the virtual machine currently. In order to indicate whether a mapping relationship exists between the virtual network card and the virtual machines currently, the virtual network card information may include a binding identifier, and the binding identifier of the virtual network card which does not have a mapping relationship with any virtual machine is set as an empty identifier, so that when the SFS selects the virtual network card which does not have a mapping relationship with any virtual machine in the virtual network card list as the target virtual network card, the binding identifier in the virtual network card information may be obtained in the virtual network card list, and the virtual network card corresponding to the virtual network card information of which the binding identifier is the empty identifier is set as the target virtual network card.
The process shown in the above step 301 to step 303 is substantially a process of determining a target virtual network card from a plurality of virtual network cards corresponding to the target network card.
In step 304, the SFS adds the target virtual machine identifier to the virtual network card information of the target virtual network card.
In the embodiment of the present disclosure, in order to avoid that, when the virtual network card is continuously allocated to another virtual machine in the following, the target virtual network card having the binding relationship with the target virtual machine is allocated to another virtual machine, which causes an error when a user performs message transmission based on the virtual machine, a target virtual machine identifier needs to be added to the virtual network card information of the target virtual network card, so as to indicate that the binding relationship exists between the target virtual network card and the target virtual machine currently. Therefore, when the target virtual network card is determined, the SFS can determine the virtual network card information corresponding to the target virtual network card in the virtual network card list, and add the target virtual machine identifier in the virtual network card information, so as to identify that the binding relationship exists between the target virtual network card and the target virtual machine, thereby avoiding allocating the target virtual network card again by mistake when allocating the virtual network card to the virtual machine next time, and ensuring the success rate of allocating the virtual network card to the virtual machine.
If the binding identifier for identifying whether the binding relationship exists between the target virtual network card and the virtual machine mentioned in the above step 303 is stored in the virtual network card information of the target virtual network card, the empty identifier of the binding identifier may be modified to the identifier of the target virtual machine.
In step 305, the SFS binds the target virtual machine with the target virtual network card and maps the target virtual network card to the target virtual machine.
In the embodiment of the present disclosure, after the SFS adds the target virtual machine identifier of the target virtual machine to the virtual network card information of the target virtual network card, the binding between the target virtual machine and the target virtual network card is completed. In order to enable a user to know that a binding relationship between a current target virtual network card and a target virtual machine is successfully established, after the target virtual machine and the target virtual network card are bound, the SFS can map the target virtual network card to the target virtual machine, that is, can display the target virtual network card on a user client of the user, and display that the binding relationship exists between the target virtual network card and the target virtual machine, so that the user can know that the connection between the current target virtual network card and the target virtual machine is successful, that is, normal message transmission can be performed currently.
The processes shown in step 304 and step 305 are substantially processes of binding the target virtual machine and the target virtual network card, and mapping the target virtual network card to the target virtual machine.
In step 306, the SFS acquires port information indicating the target network card and the target virtual network card, and returns the port information to the VMS.
In the embodiment of the present disclosure, the port information includes a target virtual network card identifier of the target virtual network card and a target network card identifier of a target network card to which the target virtual network card belongs, and is used to indicate a binding relationship existing between the current target virtual network card and the virtual machine. In order to ensure that the binding relationship between the target virtual machine and the target virtual network card is released subsequently, port information portID needs to be generated based on the target virtual network card identifier of the target virtual network card and the target network card identifier of the target network card to which the target virtual network card belongs, and the port information portID is returned to the VMS, so that the VMS stores the target virtual machine identifier of the target virtual machine and the port information portID correspondingly.
According to the method provided by the embodiment of the invention, the network card with the residual bandwidth larger than the target bandwidth is used as the target network card according to the target bandwidth required by the transmission message, and the virtual network card which is not bound with any virtual machine is distributed in the target network card to be used as the target virtual network card, so that the virtual network card capable of being mapped can be actively provided for the user, the requirement of the user on the bandwidth during the message transmission is ensured, and the intelligence is higher.
It should be noted that, after the user completes the message transmission based on the virtual machine, the target virtual machine may be destroyed, and after the target virtual machine is destroyed, the binding between the target virtual network card and the target virtual machine needs to be released. When the binding between the target virtual network card and the target virtual machine is released, referring to fig. 3B, the following steps 307 to 308 may be performed.
In step 307, the VMS sends a virtual resource release request to the SFS, where the virtual resource release request carries port information.
In the embodiment of the present disclosure, in order to ensure that when a user destroys a target virtual machine, the binding between the target virtual network card and the target virtual machine can be released, so that the target virtual network card can be continuously allocated to other virtual machines for use, so as to save virtual resources, and therefore, the binding relationship between the target virtual network card and the target virtual machine can be released. The user client of the user can provide a virtual machine release entrance, when the user client detects that the user clicks the virtual machine release entrance, a virtual machine release instruction carrying a target virtual machine identifier can be generated, and the virtual machine release instruction is sent to the VMS by the user client. When the VMS receives a virtual machine release instruction, determining port information PortID according to a target virtual machine identifier in the virtual machine release instruction, generating a virtual resource release request carrying the port information, and sending the virtual resource release request to the SFS so that the SFS releases the binding between a target virtual network card and a target virtual machine according to the port information.
In step 308, when the SFS receives the virtual resource release request sent by the VMS, the SFS clears the virtual machine identifier of the target virtual network card in the virtual network card information in the virtual network card list of the target network card, so that the target virtual network card is unbound from the target virtual machine.
In the embodiment of the present disclosure, in order to ensure that after the binding between the target virtual network card and the target virtual machine is successfully released, the target virtual network card may be bound with other virtual machines in the following sequence, and the transmission of the message is completed, therefore, the virtual machine identifier of the target virtual network card in the virtual network card information in the virtual network card list of the target network card may be removed, so that when the target virtual network card is bound with other virtual machines in the following sequence, the virtual machine identifier of other virtual machines may be added to the virtual network card information of the target virtual network card in the virtual network card list of the target network card. After receiving the virtual resource release request, the SFS determines a target virtual network card identifier of the target virtual network card and a target network card identifier of a target network card to which the target virtual network card belongs according to port information in the virtual resource release request. Determining a virtual network card list corresponding to the target network card according to the target network card identifier, determining virtual network card information corresponding to the target virtual network card identifier in the virtual network card list, and clearing the virtual machine identifier in the virtual network card information so as to remove the binding relationship between the target virtual network card and the target virtual machine.
If the binding identifier for identifying whether the binding relationship exists between the target virtual network card and the virtual machine mentioned in the above step 303 is stored in the virtual network card information of the target virtual network card, the target virtual machine identifier of the binding identifier may be modified to be a null identifier.
In step 309, the SFS unmaps the target virtual network card to the target virtual machine.
In the embodiment of the present disclosure, in order to enable a user to know that the binding relationship between the target virtual machine and the target virtual network card is successfully released and the target virtual machine is successfully destroyed, the mapping from the target virtual network card to the target virtual machine needs to be released. After the virtual machine identifier of the target virtual network card in the virtual network card information in the virtual network card list of the target network card is cleared, the binding between the target virtual network card and the target virtual machine can be released, so that the target virtual network card can be used again when the virtual network card needs to be allocated to the virtual machine in the following process. After the binding between the target virtual network card and the target virtual machine is released, the SFS may release the mapping from the target virtual network card to the target virtual machine, that is, may display that the current binding is released at the user client of the user, and prohibit the transmission of the message.
According to the method provided by the embodiment of the invention, when the virtual resource release request is received, the binding between the target virtual network card and the target virtual machine can be released according to the port information carried in the virtual resource release request, and the mapping from the target virtual network card to the target virtual machine can be released, so that the target virtual network card can be continuously used in the subsequent process, the high utilization rate of the virtual resources is ensured, and the intelligence is high.
Fig. 4 is a block diagram of a virtual resource management apparatus provided according to an embodiment of the present disclosure. Referring to fig. 4, the apparatus includes:
a determining module 401, configured to determine a target virtual network card from multiple virtual network cards corresponding to the target network card, where the target network card is a network card with a remaining bandwidth greater than a target bandwidth, and the target virtual network card is a virtual network card that is not currently bound to any virtual machine;
a binding module 402, configured to bind the target virtual machine and the target virtual network card, and map the target virtual network card to the target virtual machine;
the information obtaining module 403 is configured to obtain port information used for indicating the target network card and the target virtual network card, and return the port information to the VMS.
In another possible embodiment, the apparatus further comprises:
a first receiving module, configured to perform step 301;
a network card obtaining module, configured to perform step 302.
In another possible embodiment, the determining module 401 includes:
a query submodule for executing the step 303;
a determination submodule for performing the step 304.
In another possible embodiment, the apparatus further comprises:
a second receiving module, configured to perform step 307;
and a release module for executing the steps 308 and 309.
In another possible embodiment, the release module includes:
a purge submodule for performing step 308 above.
It should be noted that: the virtual resource management apparatus provided in the foregoing embodiment is only illustrated by dividing the functional modules when triggering virtual resource management, and in practical applications, the function allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the virtual resource management apparatus provided in the foregoing embodiment and the virtual resource management method embodiment belong to the same concept, and specific implementation processes thereof are described in the method embodiment and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is intended to be exemplary only and not to limit the present disclosure, and any modification, equivalent replacement, or improvement made without departing from the spirit and scope of the present disclosure is to be considered as the same as the present disclosure.

Claims (8)

1. A method for virtual resource management, the method comprising:
receiving a virtual resource allocation request sent by a VMS (virtual machine management system), wherein the virtual resource allocation request carries a target bandwidth and a target virtual machine identifier;
acquiring the residual bandwidth of each network card from a network card list, and taking the network card with the residual bandwidth larger than the target bandwidth as a target network card, wherein the network card list is used for recording network card information of the network card which is already brought into management in the current resource pool, and the network card information comprises a network card identifier and the residual bandwidth;
determining a target virtual network card from a plurality of virtual network cards corresponding to the target network card, wherein the target virtual network card is a virtual network card which is not bound with any virtual machine currently;
binding the target virtual machine with the target virtual network card, and mapping the target virtual network card to the target virtual machine;
and acquiring port information used for indicating the target network card and the target virtual network card, and returning the port information to the VMS, wherein the port information comprises a target virtual network card identifier of the target virtual network card and a target network card identifier of the target network card to which the target virtual network card belongs, and is used for indicating the binding relationship between the target virtual network card and the virtual machine.
2. The method of claim 1, wherein the determining a target virtual network card from among the plurality of virtual network cards corresponding to the target network card comprises:
inquiring a virtual network card list of the target network card, wherein the virtual network card list comprises at least one item of virtual network card information, and each item of virtual network card information is used for indicating the binding state of the virtual network card;
and taking one virtual network card which is not bound in the binding state as the target virtual network card, and adding a target virtual machine identifier in the virtual network card information of the target virtual network card.
3. The method of claim 1, further comprising:
receiving a virtual resource release request sent by the VMS, wherein the virtual resource release request carries the port information;
and unbinding the target virtual network card and the target virtual machine according to the port information, and removing the mapping from the target virtual network card to the target virtual machine.
4. The method of claim 3, wherein the unbinding the target virtual network card from the target virtual machine according to the port information comprises:
and clearing the virtual machine identifier of the target virtual network card in the virtual network card information in the virtual network card list of the target network card.
5. An apparatus for virtual resource management, the apparatus comprising:
the virtual resource allocation system comprises a first receiving module, a second receiving module and a third receiving module, wherein the first receiving module is used for receiving a virtual resource allocation request sent by a VMS (virtual machine server), and the virtual resource allocation request carries a target bandwidth and a target virtual machine identifier;
the network card acquisition module is used for acquiring the residual bandwidth of each network card from a network card list and taking the network card with the residual bandwidth larger than the target bandwidth as a target network card, wherein the network card list is used for recording network card information of the network card which is already brought into management in the current resource pool, and the network card information comprises a network card identifier and the residual bandwidth;
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a target virtual network card from a plurality of virtual network cards corresponding to the target network card, and the target virtual network card is a virtual network card which is not bound with any virtual machine currently;
the binding module is used for binding the target virtual machine with the target virtual network card and mapping the target virtual network card to the target virtual machine;
and the information acquisition module is used for acquiring port information used for indicating the target network card and the target virtual network card and returning the port information to the VMS, wherein the port information comprises a target virtual network card identifier of the target virtual network card and a target network card identifier of the target network card to which the target virtual network card belongs and is used for indicating the binding relationship existing between the target virtual network card and the virtual machine.
6. The apparatus of claim 5, wherein the determining module comprises:
the query submodule is used for querying a virtual network card list of the target network card, the virtual network card list comprises at least one item of virtual network card information, and each item of virtual network card information is used for indicating the binding state of the virtual network card;
and the determining submodule is used for taking one virtual network card which is not bound in the binding state as the target virtual network card and adding a target virtual machine identifier in the virtual network card information of the target virtual network card.
7. The apparatus of claim 5, further comprising:
a second receiving module, configured to receive a virtual resource release request sent by the VMS, where the virtual resource release request carries the port information;
and the releasing module is used for releasing the binding between the target virtual network card and the target virtual machine according to the port information and releasing the mapping from the target virtual network card to the target virtual machine.
8. The apparatus of claim 7, wherein the deactivation module comprises:
and the clearing submodule is used for clearing the virtual machine identifier of the target virtual network card in the virtual network card information in the virtual network card list of the target network card.
CN201710209180.8A 2017-03-31 2017-03-31 Virtual resource management method and device Active CN108667750B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710209180.8A CN108667750B (en) 2017-03-31 2017-03-31 Virtual resource management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710209180.8A CN108667750B (en) 2017-03-31 2017-03-31 Virtual resource management method and device

Publications (2)

Publication Number Publication Date
CN108667750A CN108667750A (en) 2018-10-16
CN108667750B true CN108667750B (en) 2021-01-29

Family

ID=63784006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710209180.8A Active CN108667750B (en) 2017-03-31 2017-03-31 Virtual resource management method and device

Country Status (1)

Country Link
CN (1) CN108667750B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634723B (en) * 2018-12-20 2023-04-18 国网新疆电力有限公司信息通信公司 Communication method of fusion load module and fusion load module
CN113132200B (en) * 2019-12-30 2024-01-19 中兴通讯股份有限公司 Data forwarding method, repeater, system, server and storage medium
CN114584423B (en) * 2022-03-15 2023-07-21 联想(北京)有限公司 Communication method and device based on virtual binding network card

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103731514A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Virtual network management method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102457512B (en) * 2010-11-08 2016-03-16 中标软件有限公司 A kind of thin client server virtual method and virtual thin client server
TW201336264A (en) * 2012-02-16 2013-09-01 Hon Hai Prec Ind Co Ltd Method for increasing virtual machines
CN102932174B (en) * 2012-10-25 2015-07-29 华为技术有限公司 A kind of physical network card management method, device and physical host
CN103885833B (en) * 2012-12-20 2017-06-20 中国移动通信集团公司 A kind of method for managing resource and system
CN104168135B (en) * 2014-08-06 2018-11-02 中国船舶重工集团公司第七0九研究所 Network interface card resource pool management method and system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103731514A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Virtual network management method

Also Published As

Publication number Publication date
CN108667750A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
US11960915B2 (en) Method and apparatus for creating virtual machine based on parameter information of a virtual network interface card
US10701139B2 (en) Life cycle management method and apparatus
US10700947B2 (en) Life cycle management method and device for network service
CN111641515B (en) VNF life cycle management method and device
CN108322325B (en) Virtual machine management method and device
US11221866B2 (en) Accelerator loading method, system, and apparatus
CN108279979B (en) Method and device for binding CPU for application program container
KR20140049064A (en) Method and apparatus for providing isolated virtual space
CN109995814B (en) Cloud host resource migration method and device, communication equipment and storage medium
CN109995552B (en) VNF service instantiation method and device
CN106886429B (en) Method for loading driver and server
US11416267B2 (en) Dynamic hardware accelerator selection and loading based on acceleration requirements
CN108667750B (en) Virtual resource management method and device
CN108540408B (en) Openstack-based distributed virtual switch management method and system
EP4006725A1 (en) Virtual machine migration processing and strategy generation method, apparatus and device, and storage medium
CN111294220A (en) Network isolation configuration method and device based on nginx
CN112889247B (en) VNF service instantiation method and device
CN114979286A (en) Access control method, device and equipment for container service and computer storage medium
CN109739615B (en) Mapping method and device of virtual hard disk and cloud computing platform
US11924336B1 (en) Cryptographic artifact generation using virtualized security modules
CN110795201B (en) Management method and device for servers in cloud platform
CN114416287A (en) Network card configuration method, device, equipment and storage medium
CN117632350A (en) Container deployment method and device
CN117278527A (en) Bare metal server online system, method and device
CN117692359A (en) Port monitoring method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant