CN110990110A - Virtual machine creation method and device based on Sriov network card - Google Patents
Virtual machine creation method and device based on Sriov network card Download PDFInfo
- Publication number
- CN110990110A CN110990110A CN201911047935.4A CN201911047935A CN110990110A CN 110990110 A CN110990110 A CN 110990110A CN 201911047935 A CN201911047935 A CN 201911047935A CN 110990110 A CN110990110 A CN 110990110A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- network card
- creating
- port
- sriov
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 238000004590 computer program Methods 0.000 claims description 7
- 230000006870 function Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention relates to a virtual machine creating method and device based on an Sriov network card, electronic equipment and a storage medium. The method comprises the following steps: receiving a command for creating a virtual machine at a specified port; creating a virtual machine and creating an Sriov network card for the virtual machine; and acquiring the MAC address and the pci-slot parameter of the port, acquiring the port number of the port according to the MAC address and the pci-slot parameter, and configuring the Sriov network card according to the port number. When the MAC addresses of the two ports are the same, the virtual machine can still be established and normal service is provided, and multiplexing of the MAC addresses is realized.
Description
Technical Field
The invention relates to the technical field of cloud computing, in particular to a virtual machine creating method and device based on an Sriov network card, electronic equipment and a storage medium.
Background
The OpenStack is an open source cloud computing management platform, is one of the open source cloud computing management platforms, is widely applied to public cloud, private cloud and telecommunication cloud, can flexibly provide resources such as virtual machines and the like, and can provide different types of network cards for the virtual machines, common network cards include Virtio type network cards and Sriov type network cards, the Virtio type network cards are virtualized in a virtualization mode, and the Sriov type network cards are realized through SR-IOV technology and can enable the virtual machine environment to directly access hardware. When providing a network card for a virtual machine, the MAC address of the network card may be specified, and different network cards may specify the same MAC address.
For the Virtio type network card, when the specified MAC and IP are completely the same as other network cards, the network can work normally by using 2 virtual machines created by the two network cards. However, for Sriov type network cards, when the designated MAC and IP are completely the same as those of other network cards, in the process of creating a virtual machine, as shown in fig. 1, information of a port (port) is queried, and if the information is determined not to be in accordance with the information of the designated port, an error may be reported, and a normal network service cannot be provided, resulting in failure in creating the virtual machine.
Disclosure of Invention
Aiming at the defects or improvement requirements in the prior art, the invention provides a virtual machine creation method, a virtual machine creation device, electronic equipment and a storage medium based on an Sriov network card, and can solve the problem that the virtual machine creation may fail when the MAC addresses of the Sirov network card are the same in the prior art.
According to a first aspect of the present invention, the present invention provides a virtual machine creation method based on Sriov network card address multiplexing, including the steps of:
receiving a command for creating a virtual machine at a specified port;
creating a virtual machine and creating an Sriov network card for the virtual machine;
and acquiring the MAC address and the pci-slot parameter of the port, acquiring the port number of the port according to the MAC address and the pci-slot parameter, and configuring the Sriov network card according to the port number.
Preferably, when the port number is uniquely determined by the MAC address and the pci-slot parameter.
Preferably, the physical network card of the Sriov network card generates a VLAN tag when supporting internal exchange of data packets.
According to a second aspect of the present invention, the present invention provides a virtual machine creating apparatus based on Sriov network card address multiplexing, including:
the receiving module is used for receiving a command of creating a virtual machine at a specified port;
the system comprises a creating module, a receiving module and a transmitting module, wherein the creating module is used for creating a virtual machine and creating an Sriov network card for the virtual machine;
and the configuration module is used for acquiring the MAC address and the pci-slot parameter of the port, acquiring the port number of the port according to the MAC address and the pci-slot parameter, and configuring the Sriov network card according to the port number.
According to a third aspect of the present invention, the present invention provides an electronic device comprising a processor and a memory, wherein the processor runs a program corresponding to an executable program code stored in the memory by reading the executable program code, so as to implement the method of any one of the above.
According to a fourth aspect of the invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the above.
In summary, compared with the prior art, according to the technical solutions contemplated by the present invention, when the Sriov network card is configured for the virtual machine, the port number of the port is obtained according to the MAC address and the pci-slot parameter, and the Sriov network card is configured according to the port number, so that when the MAC addresses of the two ports are the same, the virtual machine can still be created to provide normal services, and the multiplexing of the MAC addresses is realized.
Drawings
FIG. 1 is a schematic flow chart of creating a virtual machine provided by the prior art;
fig. 2 is an information interaction diagram of a virtual machine creation method provided by an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are intended to be illustrative only and are not intended to be limiting. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
English and term interpretation:
sriov: a hardware-based virtualization solution allows PCIe devices, such as network cards, to be shared between virtual machines.
PCIe: high-speed serial computer expansion bus standard (Peripheral Component interconnect express)
VF (virtual function): virtual function, a lightweight PCIe function.
Virtio: the virtualization solution is an I/O para-virtualization solution, is a set of programs for virtualization of general I/O equipment, and is an abstraction of a group of general I/O equipment in the para-virtualization Hypervisor.
Mac (media Access Control address) address: a MAC address.
The invention provides a method, a device, electronic equipment and a storage medium for creating a virtual machine based on address multiplexing of a Sriov network card. Specifically, the device details can be obtained from a neutron-server by using the MAC address and the pci-slot parameter at the neutron-sriov-nic-agent, so that the searched port address is unique and correct.
With reference to fig. 2, a virtual machine creation method based on Sriov network card address multiplexing according to an embodiment of the present invention is described, including the steps of:
s1, a command to create a virtual machine at a specified port is received.
nova specifies that a port creates a virtual machine, and the nova requests the neutron-server to acquire port related information, such as vif _ type, vif _ details and other information. Neutron-server returns the requested information to nova. And entering the next step after the information verification is successful.
And S2, creating a virtual machine, and creating an Sriov network card for the created virtual machine.
nova starts to create a virtual machine and creates a Sriov network card.
S3, obtaining the MAC address and the pci-slot parameter of the appointed port, obtaining the port number of the appointed port according to the MAC address and the pci-slot parameter, and configuring the Sriov network card according to the port number.
The port number is uniquely determined by the MAC address and the pci-slot parameter.
After detecting that the VF changes, the neutron-sriov-nic-agent acquires the device details from the neutron-server through the detected mac address and the pci-slot parameter to configure the VF.
And after the network card is updated locally by the neutron-sriov-nic-agent, informing the neutron server port to be online, and after receiving the message, the neutron-server sends updated port information to the nova.
Preferably, a physical network card of the Sriov network card generates a VLAN tag when supporting the inter-VF data packet exchange. To implement the real data exchange between 2 virtual machines with the same MAC address, it is necessary to make a vlan tag, such as an X710 network card, when the physical network card supports the internal vf exchange packet.
Thus, when a Neutron REST API is called to create 2 pci-sriov type ports, and the MAC addresses of the two ports are completely the same, the prior art can cause that after a virtual machine is created, if the network card information inquired by the Neutron-server is incorrect, the virtual machine returns an error. The invention can successfully create the virtual machine, and the MAC address is multiplexed.
The embodiment of the invention provides a virtual machine creating device based on Sriov network card address multiplexing, which comprises:
the receiving module is used for receiving a command of creating a virtual machine at a specified port;
the system comprises a creating module, a transmitting module and a receiving module, wherein the creating module is used for creating a virtual machine and creating an Sriov network card for the created virtual machine;
and the configuration module is used for acquiring the MAC address and the pci-slot parameter of the specified port, acquiring the port number of the specified port according to the MAC address and the pci-slot parameter, and configuring the Sriov network card according to the specified port number.
The implementation principle and technical effect of the virtual machine creation apparatus are similar to those of the virtual machine creation method, and are not described herein again.
In order to implement the foregoing embodiment, an embodiment of the present invention further provides an electronic device, including: a processor and a memory. Wherein the memory and the processor are electrically connected, directly or indirectly, to enable transmission or interaction of data.
The memory stores a computer program, and the computer program can implement the technical solution of any of the above method embodiments when executed by the processor. The memory stores a computer program of the virtual machine creation method, which includes at least one software functional module that can be stored in the memory in the form of software or firmware, and the processor executes various functional applications and data processing by running the software program and the module stored in the memory.
The processor may be an integrated circuit chip having signal processing capabilities. And the processor executes the program after receiving the execution instruction. Optionally, the software programs and modules within the above-described memory may also include an operating system, which may include various software components and/or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components.
The electronic device provided in this embodiment may be configured to execute the technical solution of any one of the above embodiments of the virtual machine creating method, and the implementation principle and the technical effect of the electronic device are similar to each other, which are not described herein again.
The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the technical solution of any of the above embodiments of the virtual machine creation method.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (8)
1. A virtual machine creating method based on Sriov network card address multiplexing is characterized by comprising the following steps:
receiving a command for creating a virtual machine at a specified port;
creating a virtual machine and creating an Sriov network card for the virtual machine;
and acquiring the MAC address and the pci-slot parameter of the port, acquiring the port number of the port according to the MAC address and the pci-slot parameter, and configuring the Sriov network card according to the port number.
2. The Sriov network card address multiplexing-based virtual machine creation method of claim 1, wherein when the port number is uniquely determined by the MAC address and a pci-slot parameter.
3. The method for creating the virtual machine based on Sriov network card address multiplexing of claim 1 or 2, wherein a VLAN tag is generated when a physical network card of the Sriov network card supports internal exchange of data packets.
4. A virtual machine creating device based on Sriov network card address multiplexing is characterized by comprising the following components:
the receiving module is used for receiving a command of creating a virtual machine at a specified port;
the system comprises a creating module, a receiving module and a transmitting module, wherein the creating module is used for creating a virtual machine and creating an Sriov network card for the virtual machine;
and the configuration module is used for acquiring the MAC address and the pci-slot parameter of the port, acquiring the port number of the port according to the MAC address and the pci-slot parameter, and configuring the Sriov network card according to the port number.
5. The Sriov network card address multiplexing-based virtual machine creation apparatus according to claim 4, wherein when the port number is uniquely determined by the MAC address and a pci-slot parameter.
6. The device for creating the virtual machine based on Sriov network card address multiplexing of claim 4 or 5, wherein a physical network card of the Sriov network card generates a VLAN tag when supporting internal exchange of data packets.
7. An electronic device comprising a processor and a memory, wherein the processor runs a program corresponding to an executable program code stored in the memory by reading the executable program code for implementing the method according to any one of claims 1 to 3.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911047935.4A CN110990110A (en) | 2019-10-30 | 2019-10-30 | Virtual machine creation method and device based on Sriov network card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911047935.4A CN110990110A (en) | 2019-10-30 | 2019-10-30 | Virtual machine creation method and device based on Sriov network card |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110990110A true CN110990110A (en) | 2020-04-10 |
Family
ID=70082715
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911047935.4A Pending CN110990110A (en) | 2019-10-30 | 2019-10-30 | Virtual machine creation method and device based on Sriov network card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110990110A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112003754A (en) * | 2020-08-25 | 2020-11-27 | 北京浪潮数据技术有限公司 | Visual node registration method for OpenStack cluster |
CN113645057A (en) * | 2021-06-25 | 2021-11-12 | 济南浪潮数据技术有限公司 | Method and device for supporting addition of network card model by cloud platform |
CN113835829A (en) * | 2021-08-30 | 2021-12-24 | 广东浪潮智慧计算技术有限公司 | Virtual machine creation method and system for specifying network port type and related components |
CN115314380A (en) * | 2022-06-30 | 2022-11-08 | 山东浪潮科学研究院有限公司 | VF configuration method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060195715A1 (en) * | 2005-02-28 | 2006-08-31 | Herington Daniel E | System and method for migrating virtual machines on cluster systems |
CN103621026A (en) * | 2013-04-01 | 2014-03-05 | 华为技术有限公司 | Virtual machine data exchange method, apparatus and system |
US20140181810A1 (en) * | 2012-12-21 | 2014-06-26 | Red Hat Israel, Ltd. | Automatic discovery of externally added devices |
CN104657305A (en) * | 2013-11-22 | 2015-05-27 | 国际商业机器公司 | Method and system for implementing dynamic virtualization of an SRIOV capable SAS adapter |
CN106250211A (en) * | 2016-08-05 | 2016-12-21 | 浪潮(北京)电子信息产业有限公司 | A kind of virtualization implementation method based on SR_IOV |
-
2019
- 2019-10-30 CN CN201911047935.4A patent/CN110990110A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060195715A1 (en) * | 2005-02-28 | 2006-08-31 | Herington Daniel E | System and method for migrating virtual machines on cluster systems |
US20140181810A1 (en) * | 2012-12-21 | 2014-06-26 | Red Hat Israel, Ltd. | Automatic discovery of externally added devices |
CN103621026A (en) * | 2013-04-01 | 2014-03-05 | 华为技术有限公司 | Virtual machine data exchange method, apparatus and system |
CN104657305A (en) * | 2013-11-22 | 2015-05-27 | 国际商业机器公司 | Method and system for implementing dynamic virtualization of an SRIOV capable SAS adapter |
CN106250211A (en) * | 2016-08-05 | 2016-12-21 | 浪潮(北京)电子信息产业有限公司 | A kind of virtualization implementation method based on SR_IOV |
Non-Patent Citations (1)
Title |
---|
云物互联: "启用SR-IOV解决Neutron网络I/O性能瓶颈", 《HTTPS://WWW.CNBLOGS.COM/JMILKFAN-FANGUIJU/P/10589724.HTML》, 20 February 2019 (2019-02-20), pages 12 - 36 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112003754A (en) * | 2020-08-25 | 2020-11-27 | 北京浪潮数据技术有限公司 | Visual node registration method for OpenStack cluster |
CN113645057A (en) * | 2021-06-25 | 2021-11-12 | 济南浪潮数据技术有限公司 | Method and device for supporting addition of network card model by cloud platform |
CN113835829A (en) * | 2021-08-30 | 2021-12-24 | 广东浪潮智慧计算技术有限公司 | Virtual machine creation method and system for specifying network port type and related components |
CN115314380A (en) * | 2022-06-30 | 2022-11-08 | 山东浪潮科学研究院有限公司 | VF configuration method and device |
CN115314380B (en) * | 2022-06-30 | 2024-03-01 | 山东浪潮科学研究院有限公司 | VF configuration method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110990110A (en) | Virtual machine creation method and device based on Sriov network card | |
US10419550B2 (en) | Automatic service function validation in a virtual network environment | |
US10169178B2 (en) | Implementing shared adapter configuration updates concurrent with maintenance actions in a virtualized system | |
US9854036B2 (en) | Method for migrating memory data of virtual machine, and related apparatus and cluster system | |
CN108768730B (en) | Method and device for operating intelligent network card | |
US20240045824A1 (en) | Remote Mapping Method, Apparatus and Device for Computing Resources, and Storage Medium | |
CN101980490B (en) | Link establishment method for virtual switch and physical switch and device thereof | |
EP3418932A1 (en) | Method, system, and device for securely handling virtual function driver communications with a physical function driver | |
US10657095B2 (en) | Virtualizing connection management for virtual remote direct memory access (RDMA) devices | |
CN111988230B (en) | Virtual machine communication method, device and system and electronic equipment | |
EP3232333A1 (en) | Virtualized rack management modules | |
CN110532208B (en) | Data processing method, interface conversion structure and data processing equipment | |
WO2017032112A1 (en) | Method for communicating with board having no central processing unit and communication device | |
CN103685608A (en) | Method and device for automatically configuring IP (Internet Protocol) address of security virtual machine | |
US10289424B2 (en) | System and method for loading and populating system inventory data in an event driven model | |
US10621124B2 (en) | Method, device and computer program product for enabling SR-IOV functions in endpoint device | |
US20150365357A1 (en) | Mtu management in a virtualized computer system | |
US8640127B2 (en) | Relocating guest machine using proxy tool having multiple virtual machines where one virtual machines provides host route for relocation | |
US11785054B2 (en) | Deriving system architecture from security group relationships | |
US9032063B2 (en) | Dynamic port naming in a chassis | |
CN116560803B (en) | Resource management method and related device based on SR-IOV | |
CN112099916B (en) | Virtual machine data migration method and device, computer equipment and storage medium | |
CN110795209B (en) | Control method and device | |
CN109656674B (en) | Computer equipment, virtualization chip and data transmission method | |
CN116643848A (en) | Method, device, equipment and medium for integrating intelligent network card data processor in OpenStack |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200410 |
|
RJ01 | Rejection of invention patent application after publication |