Background
OVS (Open Virtualized Switch) is a common virtualization technology for network resources, and is intended to virtualize hardware network resources in a virtualization management layer for unified use by an application layer through a software means in compliance with an Open Flow protocol. Wherein the overhead of computing and deploying network resources is mainly embodied in the virtualization management layer.
SRIOV (Single Root I/O Virtualization) is used to solve the problem of virtual sharing, that is, multiple virtual machines can share the same PCI (Peripheral Component interface) hardware at the same time, so that VF (Virtualized Function) of an application layer directly uses a corresponding PF (Physical Function) in the PCI hardware to improve efficiency. The computing and deploying cost of the network resources is mainly on hardware equipment, and the hardware equipment needs an and gate to support the hardware network card of the SRIOV.
SRIOV is divided into two modes: a PCI Passthrough mode and a Macvtap Passthrough mode. The Macvtap Passtthrough mode is forwarded through the intermediate simulation layer, the efficiency is not as high as that of the PCI Passtthrough mode, but the virtual machine hot migration is supported, and the PCI Passtthrough mode is not supported.
In terms of application performance, although the SRIOV network card has various performances better than those of the OVS network card, the SRIOV network card needs specific hardware resources, is higher in manufacturing cost, and is lower in cost performance for the environment with better network conditions. For a virtualization environment, the SRIOV network card is to be deployed on a virtual machine with a high network load in the environment, but the SRIOV network card is statically deployed on a specific virtual machine in the current network planning, and cannot be reasonably and dynamically deployed.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method, an apparatus, a controller and a core network device for network resource deployment, which solve the technical problem that the SRIOV network card cannot be reasonably and dynamically deployed in the prior art.
To solve the foregoing technical problem, an embodiment of the present invention provides a method for deploying network resources, including:
after a single input/output virtual SRIOV network card resource in a network resource pool is deployed to a network virtual machine, acquiring real-time service state data of all the network virtual machines, and evaluating the current service operation condition of each virtual machine according to the real-time service state data acquired in a first preset period;
acquiring virtual machines to be migrated from all the virtual machines according to the current service operation state of each virtual machine, and taking the virtual machines with the deployed SRIOV network card resources as virtual machines to be migrated, wherein the current service operation state of the virtual machines to be migrated is not superior to that of the virtual machines to be migrated;
and when the virtual machine to be migrated and the virtual machine to be migrated are different virtual machines, migrating the SRIOV network card resource of the virtual machine to be migrated to the virtual machine to be migrated.
The step of deploying the single input/output virtualized SRIOV network card resource in the network resource pool to the network virtual machine includes:
and deploying the SRIOV network card resources in the network resource pool to the virtual machine with higher load counted in advance.
After the single input/output virtualized SRIOV network card resource in the network resource pool is deployed to the network virtual machine, the method further includes:
respectively deploying open source virtual switching OVS network card resources for each virtual machine of the network;
before the SRIOV network card resource of the virtual machine to be migrated is migrated to the virtual machine to be migrated, the method further includes:
after the service data of the SRIOV network card resource of the virtual machine to be migrated and the OVS network card resource of the virtual machine to be migrated are synchronized, deactivating the SRIOV network card resource of the virtual machine to be migrated; and
after the SRIOV network card resource of the virtual machine to be migrated is migrated to the virtual machine to be migrated, the method further includes:
and synchronizing the service data of the OVS network card resource of the virtual machine to be migrated to the SRIOV network card resource of the virtual machine to be migrated, and activating the SRIOV network card resource of the virtual machine to be migrated.
The step of deploying the single input/output virtualized SRIOV network card resource in the network resource pool to the network virtual machine includes:
deploying SRIOV network card resources in a network resource pool to a network virtual machine according to a PCI direct mode;
before the SRIOV network card resource of the virtual machine to be migrated is migrated to the virtual machine to be migrated, the method further includes:
and switching the SRIOV network card resource of the virtual machine to be migrated from a PCI direct connection mode to a Macvtap direct connection mode.
After the SRIOV network card resource of the virtual machine to be migrated is migrated to the virtual machine to be migrated, the method further includes:
and switching the SRIOV network card resource to be migrated into the virtual machine from a Macvtap direct connection mode to a PCI direct connection mode.
The step of collecting real-time service state data of all the virtual machines of the network comprises the following steps:
and acquiring the number of real-time transport protocol (Rtp) messages, the number of lost packets and the jitter time of all the network virtual machines according to a second preset period, wherein the second preset period is less than the first preset period.
The step of evaluating the current service operation status of each virtual machine according to the real-time service state data collected in the first preset period includes:
obtaining a current service operation condition evaluation parameter Si of each virtual machine through the following formula:
traf (i), lost (i), jett (i) are respectively the number of Rtp messages, the number of lost packets, and the jitter time length of the virtual machine i acquired in the first preset period, traf (avg), lost (avg), jett (avg) are respectively the average value of the number of Rtp messages, the average value of the number of lost packets, and the average value of the jitter time length of all the virtual machines acquired in the first preset period, Wt, Wl, and Wj are respectively preset Rtp message number evaluation weight, lost packet number evaluation weight, and jitter time length evaluation weight, and Wt + Wl + Wj is 1;
the step of acquiring virtual machines to be migrated from all the virtual machines according to the current service operation state of each virtual machine comprises:
and acquiring virtual machines to be migrated from all the virtual machines according to the current service operation condition evaluation parameter Si of each virtual machine, wherein the Si of the virtual machines to be migrated is not less than the Si of the virtual machines to be migrated.
The step of acquiring virtual machines to be migrated from all the virtual machines according to the current service operation state of each virtual machine comprises the following steps:
according to the current service operation state of each virtual machine, acquiring virtual machines to be migrated which are equal in number to the virtual machines to be migrated from all the virtual machines, and enabling each virtual machine to be migrated to correspond to one virtual machine to be migrated, wherein the current service operation state of the virtual machines to be migrated is not superior to the current service operation states of other virtual machines except the virtual machines to be migrated.
To solve the foregoing technical problem, an embodiment of the present invention further provides a device for network resource deployment, including:
the acquisition module is used for acquiring real-time service state data of all the network virtual machines after a single input/output virtualized SRIOV network card resource in a network resource pool is deployed to the network virtual machines, and evaluating the current service operation condition of each virtual machine according to the real-time service state data acquired in a first preset period;
the acquisition module is used for acquiring virtual machines to be migrated from all the virtual machines according to the current service operation condition of each virtual machine, and taking the virtual machines with the deployed SRIOV network card resources as the virtual machines to be migrated, wherein the current service operation condition of the virtual machines to be migrated is not superior to that of the virtual machines to be migrated;
and the migration module is used for migrating the SRIOV network card resource of the virtual machine to be migrated to the virtual machine to be migrated when the virtual machine to be migrated and the virtual machine to be migrated are different virtual machines.
Wherein the apparatus further comprises:
the deployment module is used for respectively deploying open source virtual switching (OVS) network card resources for each virtual machine of the network;
the deactivation module is used for deactivating the SRIOV network card resource of the virtual machine to be migrated after the service data of the SRIOV network card resource of the virtual machine to be migrated and the service data of the OVS network card resource of the virtual machine to be migrated are synchronized; and
and the activation module is used for synchronizing the service data of the OVS network card resource of the virtual machine to be migrated to the SRIOV network card resource of the virtual machine to be migrated, and activating the SRIOV network card resource of the virtual machine to be migrated.
Wherein, the collection module includes:
the deployment unit is used for deploying the SRIOV network card resources in the network resource pool to the network virtual machine according to the PCI direct mode;
the device further comprises:
and the first switching module is used for switching the SRIOV network card resource of the virtual machine to be migrated from the PCI express mode to the Macvtap express mode.
To solve the above technical problem, an embodiment of the present invention further provides a controller, including: an apparatus for network resource deployment as claimed in any preceding claim.
To solve the above technical problem, an embodiment of the present invention further provides a core network device, including: such as the above.
The technical scheme of the invention has the following beneficial effects:
the method for deploying the network resources comprises the steps that after a single input/output virtual SRIOV network card resource in a network resource pool is deployed to a network virtual machine, real-time service state data of all the virtual machines of a network are collected, and the current service running condition of each virtual machine is evaluated according to the real-time service state data collected in a first preset period; then acquiring virtual machines to be migrated from all the virtual machines according to the current service operation state of each virtual machine, and taking the virtual machines with the SRIOV network card resources as virtual machines to be migrated, wherein the current service operation state of the virtual machines to be migrated is not superior to that of the virtual machines to be migrated; and finally, when the virtual machine to be migrated and the virtual machine to be migrated are different virtual machines, migrating the SRIOV network card resource of the virtual machine to be migrated to the virtual machine to be migrated. The method dynamically and reasonably deploys the SRIOV network card resources according to the real-time service condition of the virtual machine, thereby achieving the purpose of load balancing and improving the utilization efficiency of the SRIOV network card resources. The technical problem that the SRIOV network card cannot be reasonably and dynamically deployed in the prior art is solved.
Detailed Description
In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments.
As shown in fig. 1, a method for deploying network resources according to an embodiment of the present invention includes:
step 101, after a single input/output virtualized SRIOV network card resource in a network resource pool is deployed to a network virtual machine, acquiring real-time service state data of all the network virtual machines, and evaluating a current service operation status of each virtual machine according to the real-time service state data acquired in a first preset period.
The current service running state of each virtual machine can be effectively evaluated by collecting the real-time service state data of the virtual machines, so that the SRIOV network card resources are reasonably and dynamically adjusted according to the service running state of the virtual machines.
The current service operation status of the virtual machine also represents the load condition of the virtual machine, and generally, the higher the load of the virtual machine is, the worse the current service operation status is.
Step 102, acquiring virtual machines to be migrated in all the virtual machines according to the current service operation state of each virtual machine, and taking the virtual machines with the deployed SRIOV network card resources as virtual machines to be migrated out, wherein the current service operation state of the virtual machines to be migrated in is not superior to that of the virtual machines to be migrated out.
Here, the virtual machine to be migrated of the SRIOV network card resource is selected based on the current service operating condition of the virtual machine, so that the SRIOV network card resource is dynamically adjusted based on the service operating condition of the virtual machine.
Specifically, the current service operation status of the virtual machine to be migrated is not better than the current service operation status of the virtual machine to be migrated. Further, the current service operation status of the virtual machine to be migrated is not better than the current service operation status of other virtual machines except the virtual machine to be migrated. Namely, the virtual machine with the worst operation condition is selected as the virtual machine to be migrated.
Step 103, when the virtual machine to be migrated and the virtual machine to be migrated are different virtual machines, migrating the SRIOV network card resource of the virtual machine to be migrated to the virtual machine to be migrated.
Here, by migrating the SRIOV network card resources to the virtual machines with poor service operation conditions, the service operation conditions of the virtual machines can be improved, the stable operation of each virtual machine is ensured, and load balancing is achieved.
The method for deploying the network resources dynamically and reasonably deploys the SRIOV network card resources according to the real-time service condition of the virtual machine, achieves the purpose of load balancing, and improves the utilization efficiency of the SRIOV network card resources. The technical problem that the SRIOV network card cannot be reasonably and dynamically deployed in the prior art is solved.
Preferably, in step 101, the step of deploying the single-root input-output virtualized SRIOV network card resource in the network resource pool to the network virtual machine may include:
step 1011, deploying the SRIOV network card resources in the network resource pool to the virtual machine with higher load counted in advance.
Here, the SRIOV network card resources may be deployed in the virtual machine with a higher historical load according to historical experience, so as to optimize initial deployment, reduce the number of times of dynamic adjustment of the subsequent SRIOV network card resources, and save the dynamically adjusted resources.
Preferably, in step 101, after the single input/output virtualized SRIOV network card resource in the network resource pool is deployed to the network virtual machine, the method may further include:
and 104, respectively deploying open source virtual switching (OVS) network card resources for each virtual machine of the network.
Here, OVS network card resources are respectively deployed for each virtual machine. For a virtual machine with both SRIOV network card resources and OVS network card resources, the SRIOV network card is enabled prior to the OVS network card, so the SRIOV network card is enabled on the virtual machine, and in addition, the capacity of the OVS network card is not limited by hardware, so that any performance and service of the virtual machine are not influenced by configuring an OVS network card which is not enabled. And for the virtual machine only deploying the OVS network card resources, starting an OVS common network card to work.
Before thestep 103, the method may further include:
and 105, after the service data of the SRIOV network card resource of the virtual machine to be migrated and the OVS network card resource of the virtual machine to be migrated are synchronized, deactivating the SRIOV network card resource of the virtual machine to be migrated.
Here, if it is detected that the service operation status of the other virtual machines is worse than the service operation status of the virtual machine in which the SRIOV network card resource is deployed, the SRIOV network card resource needs to be migrated. Before migration, it is necessary to ensure that service data of the SRIOV network card and the OVS network card on the virtual machine to be migrated are synchronized, that is, configured IP routing information is completely the same, and then, the SRIOV network card resource is deactivated, so that the OVS network card on the virtual machine to be migrated takes over services.
Specifically, the SRIOV network card and the OVS network card of the virtual machine to be migrated can be synchronized in real time. The SRIOV network card resources can be deactivated through the cloud platform script.
And
after thestep 103, the method may further include:
and step 106, synchronizing the service data of the OVS network card resource of the virtual machine to be migrated to the SRIOV network card resource of the virtual machine to be migrated, and activating the SRIOV network card resource of the virtual machine to be migrated.
Here, after the SRIOV network card resource is migrated to the virtual machine to be migrated, the service routing data of the OVS network card to be migrated to the virtual machine needs to be synchronized to the SRIOV network card, so that the SRIOV network card can take over the service. Specifically, the SRIOV network card can be activated through the cloud platform script, so that the SRIOV network card takes over the service.
At this time, by respectively deploying OVS network card resources for each virtual machine, normal operation of services of the virtual machines after the SRIOV network cards are not deployed and the SRIOV network cards are migrated is ensured.
Preferably, in step 101, the step of deploying the single-root input-output virtualized SRIOV network card resource in the network resource pool to the network virtual machine may include:
step 1012, the SRIOV network card resources in the network resource pool are deployed to the network virtual machine according to the PCI express mode.
Here, SRIOV network card resources are deployed according to the PCI express mode, which ensures the operating efficiency of the network virtual machine.
Before thestep 103, the method may further include:
and 107, switching the SRIOV network card resource of the virtual machine to be migrated from the PCI direct connection mode to the Macvtap direct connection mode.
Here, since the SRIOV network card does not support virtual machine live migration in the PCI Passthrough mode, the SRIOV network card needs to be switched from the PCI Passthrough mode to the macrotap direct through macrotap pass through mode to live migration of SRIOV network card resources.
Preferably, after thestep 103, the method may further include:
and 108, switching the SRIOV network card resource to be migrated into the virtual machine from a Macvtap direct mode to a PCI direct mode.
At this time, after the SRIOV network card is migrated to the virtual machine to be migrated in the Macvtap Passtthroughput mode, the SRIOV network card is switched to the high-efficiency PCI Passtthroughput mode, so that the running efficiency of the virtual machine is ensured.
Preferably, in step 101, the step of collecting real-time service state data of all virtual machines of the network may include:
and 1013, acquiring the real-time transport protocol (Rtp) message number, packet loss number and jitter duration of all the network virtual machines according to a second preset period, wherein the second preset period is smaller than the first preset period.
Here, the service data of the virtual machine is periodically collected according to a second preset period, and the deployment of the SRIOV network card resource is periodically decided according to the first preset period. The second preset period is smaller than the first preset period, so that at least one group of sampling data is collected in the decision period to judge the service operation condition of each virtual machine, and thus whether the SRIOV network card resource is migrated is decided.
In order to ensure real-time performance of the sampled data, the second preset period as the sampling period may be set to be not less than 30 s. In order to ensure that ping-pong migration is not avoided, the first predetermined period as the decision period may be set to be not less than 90 s.
Further, in step 101, the step of evaluating the current service operating condition of each virtual machine according to the real-time service state data collected in the first preset period may include:
step 1014, obtaining the current service operation state evaluation parameter Si of each virtual machine by the following formula:
traf (i), lost (i), jett (i) are respectively the number of Rtp messages, the number of lost packets, and the jitter time length of the virtual machine i acquired in the first preset period, traf (avg), lost (avg), jett (avg) are respectively the average value of the number of Rtp messages, the average value of the number of lost packets, and the average value of the jitter time length of all the virtual machines acquired in the first preset period, Wt, Wl, and Wj are respectively preset Rtp message number evaluation weight, lost packet number evaluation weight, and jitter time length evaluation weight, and Wt + Wl + Wj is 1.
Here, the number of Rtp messages, the number of lost packets, and the jitter duration of the virtual machines are weighed by the above formula to obtain the service operation condition evaluation parameter Si of the virtual machine, so that the service operation conditions of the virtual machines can be effectively averaged. Wherein, the larger the value of Si is, the worse the service running condition on the virtual machine is.
Specifically, when the equipment is busy, in view of ensuring the transmission quality of the network, Wl and Wj can be set to be equal and both are greater than Wt; when the device is not busy, Wt, Wl, and Wj may be set equal to 1/3.
In step 102, the step of acquiring the virtual machines to be migrated from all the virtual machines according to the current service operating condition of each virtual machine may include:
step 1021, according to the current service operation condition evaluation parameter Si of each virtual machine, acquiring the virtual machines to be migrated from all the virtual machines, wherein the Si of the virtual machines to be migrated is not less than the Si of the virtual machines to be migrated.
Here, since the larger the value of Si, the worse the service operating condition on the virtual machine, the value of Si to be migrated into the virtual machine is selected to be not less than the value of Si to be migrated out of the virtual machine. Further, the value of Si to be migrated into the virtual machine may be selected to be not less than the values of Si of other virtual machines except the virtual machine to be migrated.
Specifically, for the case of multiple SRIOV network card resources, the step 102 may include:
step 1021, according to the current service operation status of each virtual machine, acquiring virtual machines to be migrated in the number equal to that of the virtual machines to be migrated from all the virtual machines, and enabling each virtual machine to be migrated to correspond to one virtual machine to be migrated, wherein the current service operation status of the virtual machines to be migrated is not superior to the current service operation statuses of other virtual machines except the virtual machines to be migrated.
After distributing the plurality of SRIOV network card resources to the plurality of virtual machines to be migrated, selecting the virtual machines to be migrated with the number equal to that of the virtual machines to be migrated, and enabling each virtual machine to be migrated to correspond to one virtual machine to be migrated, so that the SRIOV network card resources of each virtual machine to be migrated are migrated to the corresponding virtual machine to be migrated, and each SRIOV network card resource is guaranteed to be effectively dynamically adjusted in real time.
The current service operation status of the virtual machine to be migrated is not superior to the current service operation status of other virtual machines except the virtual machine to be migrated, so that the SRIOV network card resource is applied to the virtual machine with the worst service operation status, the operation status of the virtual machine is effectively improved, and the load balance is ensured.
The following illustrates a specific implementation flow of the embodiment of the present invention as follows:
the method for deploying the network resources is applied to a Controller and comprises the following steps:
step 201, as shown in fig. 2, first deploy VFA corresponding to SRIOV network card PFA in the network resource pool to VM1 (denoted as PVFA) according to PCI Passthrough mode, deploy VFB corresponding to SRIOV network card PFB to VM2 (denoted as PVFB) according to PCI Passthrough mode, and deploy ordinary network card resources of OVS network card for each virtual machine VM1-VM5 respectively.
And the virtual machines (VM1 and VM2) which are simultaneously provided with the SRIOV network card and the OVS network card start the SRIOV network card according to a PCI Passtough mode, the OVS network card is not started, and the SRIOV network card and the OVS network card are configured with the same IP routing information and are synchronized in real time.
Step 202, collecting the number of Rtp messages, the number of lost packets and the jitter duration of all the virtual machines according to a second preset period, wherein the second preset period is not less than 30 s.
Step 203, obtaining the current service operation state evaluation parameter Si of each virtual machine according to the following formula according to the number of Rtp messages, the number of lost packets and the jitter duration collected in the first preset period:
traf (i), lost (i), jett (i) are respectively the number of Rtp messages, the number of lost packets, and the jitter time length of the virtual machine i acquired in the first preset period, traf (avg), lost (avg), jett (avg) are respectively the average value of the number of Rtp messages, the average value of the number of lost packets, and the average value of the jitter time length of all the virtual machines acquired in the first preset period, Wt, Wl, and Wj are respectively the preset number of Rtp messages evaluation weight, number of lost packets evaluation weight, and jitter time length evaluation weight, and Wt + Wl + Wj is 1.
Wherein the first preset period is not less than 90 s. When the equipment runs busy, Wl and Wj are equal and are both larger than Wt; when the device is not busy, Wt, Wl, and Wj are equal, equal to 1/3 respectively.
And 204, acquiring two virtual machines to be migrated from all the virtual machines according to the current service operation condition evaluation parameter Si of each virtual machine, wherein the Si of the virtual machine to be migrated is not less than the Si of other virtual machines, namely the service operation condition of the virtual machine to be migrated is worst. Assuming that the service operating conditions of VM4 and VM5 are the worst, VM1 and VM2 are regarded as virtual machines to be migrated, VM1 corresponds to VM5, and VM2 corresponds to VM 4.
Step 205, as shown in fig. 3, deactivating the SRIOV network cards on VM1 and VM2 through the cloud platform script, enabling the OVS network card to take over services automatically, and switching the SRIOV network cards on VM1 and VM2 into a macro platform permission mode, which is recorded as MVFA and MVFB.
Step 206, as shown in fig. 4, the SRIOV network card MVFB of the VM1 is migrated to the VM5, and the SRIOV network card MVFA of the VM2 is migrated to the VM 4.
Step 207, as shown in fig. 5 and 6, synchronizing the service data of the OVS network card of the VM4 to the SRIOV network card MVFA, synchronizing the service data of the OVS network card of the VM5 to the SRIOV network card MVFB, and respectively switching the MVFA and the MVFB into PCI Passthrough modes, which are denoted as PVFA and PVFB. And activating the PVFA and the PVFB to enable the SRIOV network card on the VM4 and the VM5 to automatically take over the service.
To sum up, the method for deploying network resources according to the embodiment of the present invention deploys the SRIOV network card in the virtual machine with higher historical load according to historical experience, deploys the OVS network card for each virtual machine at the same time, evaluates the current service operation status of each virtual machine, finds that the OVS network card is used by the virtual machine with poor service operation status, and migrates the SRIOV network card to the virtual machine with poor service operation status. The method dynamically and reasonably deploys the SRIOV network card resources according to the real-time service condition of the virtual machine, thereby achieving the purpose of load balancing and improving the utilization efficiency of the SRIOV network card resources. The technical problem that the SRIOV network card cannot be reasonably and dynamically deployed in the prior art is solved.
As shown in fig. 7, an embodiment of the present invention further provides an apparatus for network resource deployment, including:
the acquisition module is used for acquiring real-time service state data of all the network virtual machines after a single input/output virtualized SRIOV network card resource in a network resource pool is deployed to the network virtual machines, and evaluating the current service operation condition of each virtual machine according to the real-time service state data acquired in a first preset period;
the acquisition module is used for acquiring virtual machines to be migrated from all the virtual machines according to the current service operation condition of each virtual machine, and taking the virtual machines with the deployed SRIOV network card resources as the virtual machines to be migrated, wherein the current service operation condition of the virtual machines to be migrated is not superior to that of the virtual machines to be migrated;
and the migration module is used for migrating the SRIOV network card resource of the virtual machine to be migrated to the virtual machine to be migrated when the virtual machine to be migrated and the virtual machine to be migrated are different virtual machines.
The network resource deployment device dynamically and reasonably deploys the SRIOV network card resources according to the real-time service condition of the virtual machine, achieves the purpose of load balancing, and improves the utilization efficiency of the SRIOV network card resources. The technical problem that the SRIOV network card cannot be reasonably and dynamically deployed in the prior art is solved.
Preferably, the acquisition module may include:
and the first acquisition unit is used for deploying the SRIOV network card resources in the network resource pool to the virtual machine with higher load counted in advance.
Preferably, the apparatus may further include:
the deployment module is used for respectively deploying open source virtual switching (OVS) network card resources for each virtual machine of the network;
the deactivation module is used for deactivating the SRIOV network card resource of the virtual machine to be migrated after the service data of the SRIOV network card resource of the virtual machine to be migrated and the service data of the OVS network card resource of the virtual machine to be migrated are synchronized; and
and the activation module is used for synchronizing the service data of the OVS network card resource of the virtual machine to be migrated to the SRIOV network card resource of the virtual machine to be migrated, and activating the SRIOV network card resource of the virtual machine to be migrated.
Preferably, the acquisition module may include:
the deployment unit is used for deploying the SRIOV network card resources in the network resource pool to the network virtual machine according to the PCI direct mode;
the apparatus may further include:
and the first switching module is used for switching the SRIOV network card resource of the virtual machine to be migrated from the PCI express mode to the Macvtap express mode.
Further, the apparatus may further include:
and the second switching module is used for switching the SRIOV network card resource to be migrated into the virtual machine from a Macvtap direct mode to a PCI direct mode.
Preferably, the acquisition module may include:
and the second acquisition unit is used for acquiring the real-time transmission protocol Rtp message number, the packet loss number and the jitter duration of all the network virtual machines according to a second preset period, wherein the second preset period is less than the first preset period.
Further, the acquisition module may further include:
a first obtaining unit, configured to obtain a current service operating condition evaluation parameter Si of each virtual machine according to the following formula:
traf (i), lost (i), jett (i) are respectively the number of Rtp messages, the number of lost packets, and the jitter time length of the virtual machine i acquired in the first preset period, traf (avg), lost (avg), jett (avg) are respectively the average value of the number of Rtp messages, the average value of the number of lost packets, and the average value of the jitter time length of all the virtual machines acquired in the first preset period, Wt, Wl, and Wj are respectively preset Rtp message number evaluation weight, lost packet number evaluation weight, and jitter time length evaluation weight, and Wt + Wl + Wj is 1;
the acquisition module may include:
and the second obtaining module is used for obtaining the virtual machines to be migrated from all the virtual machines according to the current service operation condition evaluation parameter Si of each virtual machine, wherein the Si of the virtual machines to be migrated is not less than the Si of the virtual machines to be migrated.
Preferably, the obtaining module may include:
and a third obtaining unit, configured to obtain, from all the virtual machines, virtual machines to be migrated in an amount equal to that of the virtual machines to be migrated according to a current service operation status of each virtual machine, and enable each virtual machine to be migrated to correspond to one virtual machine to be migrated, where a current service operation status of the virtual machine to be migrated is not better than current service operation statuses of other virtual machines except the virtual machine to be migrated.
The network resource deployment device dynamically and reasonably deploys the SRIOV network card resources according to the real-time service condition of the virtual machine, achieves the purpose of load balancing, and improves the utilization efficiency of the SRIOV network card resources. The technical problem that the SRIOV network card cannot be reasonably and dynamically deployed in the prior art is solved.
It should be noted that the apparatus for deploying network resources is an apparatus corresponding to the method for deploying network resources, where all implementation manners in the embodiment of the method are applicable to the embodiment of the apparatus, and the same technical effect can be achieved.
Since the apparatus for network resource deployment in the embodiment of the present invention is applied to a controller, an embodiment of the present invention further provides a controller, including: an apparatus for network resource deployment as described in the above embodiments. The implementation embodiments of the device for network resource deployment are all applicable to the embodiment of the controller, and the same technical effect can be achieved.
Since the controller according to the embodiment of the present invention is applied to a core network device, an embodiment of the present invention further provides a core network device, including: such as the controllers described in the above embodiments. The implementation embodiments of the controller are all applicable to the embodiment of the core network device, and the same technical effect can be achieved.
In various embodiments of the present invention, it should be understood that the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.