Method, system and related components for creating a virtual machine with a specified network port type
By receiving the virtual machine creation instruction carrying the network ID and virtual network card type, the request ID of the virtual network device is generated and assigned to the virtual machine, which solves the problem of needing to create a direct type port in advance when creating the virtual machine, and achieves efficient and accurate Network port type specification.
Patent Information
- Application Number
- CN202111004485.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-08-30
AI Technical Summary
In large-scale cloud platforms, the network port type needs to be specified when creating a virtual machine. The existing technology requires a two-step operation: creating a direct network port in advance and mounting it to the virtual machine, which can easily lead to operational errors and mapping errors.
By receiving the virtual machine creation instruction carrying the network ID and virtual network card type, the request ID of the virtual network device is generated, and the virtual network device is allocated to the virtual machine based on the ID and directly mounted to the virtual machine for use, avoiding the need to create a direct type in advance. port.
It simplifies the virtual machine creation process, reduces the possibility of operational errors, improves the efficiency of specifying network port types, and avoids mapping errors.
Smart Images

Figure CN113835829B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, system and related components for creating a virtual machine of a specified network port type. Background Art
[0002] When using cloud platform products, users often need to create some virtual machines with specific needs. If a normal type network port is required, the operation is very simple. You only need to specify a network ID when creating it, and the computing service will call the network service interface to create a normal type port and mount it to the virtual machine for use.
[0003] However, some services running on virtual machines require high-speed virtual networks to support them. When creating a virtual machine, the mounted network devices usually need to support hardware virtualization to achieve acceleration, namely SR-IOV (Single Root I / O Virtualization) technology. The network devices on the host can be virtualized into several virtual network devices, namely VF-devices, through hardware virtualization technology, and then the virtual network devices are mounted to the virtual machine through direct connection to achieve the effect of network acceleration.
[0004] In the current OpenStack cloud platform, if a virtual machine wants to use such a directly connected virtual network device, it is necessary to create a direct-connection port of the virtual network card type through the network service in advance, that is, create a port with vnic_type as direct through the neutron service, and specify vnic_type as direct in the creation parameters. After that, when creating a virtual machine, mount the direct-connection port for the virtual machine to use, so that after the virtual machine is created, it can achieve network acceleration through the mounted direct port.
[0005] It can be seen that if a virtual machine wants to mount a direct type port, the direct type port needs to be created in advance. When the cloud platform is large in scale, the number of ports that need to be created in advance will be very large. This two-step operation method can easily lead to staff errors. For example, staff may create a virtual machine in the conventional way of creating a normal type network port, that is, forgetting to create a direct type network port in advance. For another example, due to the large number of direct type network ports created in advance, the corresponding relationship errors often occur when mounting to the virtual machine.
[0006] In summary, how to conveniently and effectively create a virtual machine of a specified network port type is a technical problem that those skilled in the art urgently need to solve. Summary of the invention
[0007] The object of the present invention is to provide a method, system and related components for creating a virtual machine of a specified network port type, so as to conveniently and effectively create a virtual machine of a specified network port type.
[0008] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0009] A method for creating a virtual machine with a specified network port type, comprising:
[0010] Receive a virtual machine creation instruction carrying a network ID and a virtual network card type;
[0011] When the virtual network card type is a direct connection type, generating a request ID for a virtual network device;
[0012] A virtual machine with a direct connection type virtual network card is created based on the virtual machine creation instruction, and a virtual network device is allocated to the virtual machine according to the request ID, and the communication bus address of the allocated virtual network device is saved so that the virtual network device is mounted to the virtual machine for use.
[0013] Preferably, it also includes:
[0014] When the virtual network card type is a standard type, creating a virtual machine with a standard type of virtual network card based on the virtual machine creation instruction;
[0015] When the virtual network card type is a macvtap type, a virtual machine whose virtual network card type is a macvtap is created based on the virtual machine creation instruction.
[0016] Preferably, the virtual machine creation instruction also carries the virtual machine IP address;
[0017] Correspondingly, the IP address of the virtual machine created based on the virtual machine creation instruction is the virtual machine IP address carried in the virtual machine creation instruction.
[0018] Preferably, it also includes:
[0019] Receive a virtual machine creation instruction that only carries a network ID;
[0020] Based on the virtual machine creation instruction that carries only the network ID, a virtual machine with a standard virtual network card type is created.
[0021] Preferably, it also includes:
[0022] After receiving a virtual machine creation instruction carrying a network ID and a virtual network card type, when it is verified that the virtual machine creation instruction does not comply with a preset rule, the creation of the virtual machine is stopped.
[0023] Preferably, it also includes:
[0024] After the creation of the virtual machine is stopped, the first prompt information is output.
[0025] Preferably, it also includes:
[0026] Receive a virtual machine creation instruction carrying a port ID, wherein the virtual network card type specified in the parameter of the port ID is a direct connection type;
[0027] Based on the virtual machine creation instruction carrying the port ID, a virtual machine with a direct connection type of virtual network card is created according to a default process.
[0028] A virtual machine creation system for specifying a network port type, comprising:
[0029] An instruction receiving unit, used for receiving a virtual machine creation instruction carrying a network ID and a virtual network card type;
[0030] A virtual network device request ID generating unit, used to generate a request ID for a virtual network device when the virtual network card type is a direct connection type;
[0031] A virtual machine creation unit is used to create a virtual machine with a virtual network card type of a direct connection type based on the virtual machine creation instruction, and allocate a virtual network device to the virtual machine according to the request ID, and save the communication bus address of the allocated virtual network device so that the virtual network device can be mounted to the virtual machine for use.
[0032] A virtual machine creation device for specifying a network port type, comprising:
[0033] Memory for storing computer programs;
[0034] A processor is used to execute the computer program to implement the steps of the method for creating a virtual machine with a specified network port type as described in any one of the above.
[0035] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for creating a virtual machine with a specified network port type as described in any one of the above are implemented.
[0036] The technical solution provided by the embodiment of the present invention is applied to allow the network ID and the virtual network card type to be carried in the virtual machine creation instruction, that is, the solution of the present application does not need to pre-create a direct type port, but can create a virtual machine with a virtual network card type of a direct connection type by using a one-step operation. Specifically, after receiving the virtual machine creation instruction carrying the network ID and the virtual network card type, for the port with a virtual network card type of a direct connection type, since it is necessary to access the virtual machine through a communication bus, when it is determined that the virtual network card type is a direct connection type, it is necessary to generate a request ID for the virtual network device, so that the virtual network device can be subsequently allocated to the virtual machine according to the request ID, and the communication bus address of the allocated virtual network device can be saved so that the virtual network device can be mounted to the virtual machine for use. Since the virtual machine creation instruction carries the network ID and the virtual network card type, the present application can create a virtual machine with a virtual network card type of a direct connection type based on the virtual machine creation instruction.
[0037] To sum up, when it is necessary to create a virtual machine with a direct connection type of virtual network card, this application does not need to create a direct type port in advance, but carries the network ID and virtual network card type in the virtual machine creation instruction, so that a virtual machine with a direct connection type of virtual network card can be created, which simplifies the operation of the staff and is less prone to mistakes. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A flowchart of a method for creating a virtual machine of a specified network port type in the present invention;
[0040] Figure 2 A schematic diagram of the structure of a virtual machine creation system for specifying a network port type in the present invention. DETAILED DESCRIPTION
[0041] The core of the present invention is to provide a method for creating a virtual machine of a specified network port type, which can conveniently and effectively create a virtual machine of the specified network port type and is not prone to errors.
[0042] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0043] Please refer to Figure 1 , Figure 1 This is an implementation flow chart of a method for creating a virtual machine of a specified network port type in the present invention. The method for creating a virtual machine of a specified network port type may include the following steps:
[0044] Step S101: receiving a virtual machine creation instruction carrying a network ID and a virtual network card type.
[0045] Specifically, the computing service, that is, the nova_api component of the nova service, may receive the virtual machine creation instruction carrying the network ID and the virtual network card type.
[0046] It should be noted that since the traditional OpenStack cloud platform does not support the virtual network card type in the virtual machine creation instruction, the Network Request class can be extended in advance within the nova service to add the vnic_type field to the fields field of the class, that is, to add the virtual network card type field to indicate the port type of the requested network, so that different logical processing can be performed according to the network port type represented by this field.
[0047] In addition, since the virtual machine creation instruction carrying the network ID and virtual network card type is usually received through the nova_api component of the nova service, the nova_api service can be extended in advance to add new parameters to support networks.vnic_type in the new virtual machine interface, that is, the nova_api component is adjusted in advance so that it can complete the operation of step S101 of this application.
[0048] Step S102: When the virtual network card type is a direct connection type, a request ID of a virtual network device is generated.
[0049] If the virtual network card type carried in the virtual machine creation instruction is a direct connection type, that is, the vnic_type carried in the virtual machine creation instruction is direct, for the direct type network port, since it is necessary to access the virtual machine through the virtual machine's communication bus, the communication bus is usually a PCI bus. Therefore, when it is determined that the virtual network card type carried in the virtual machine creation instruction is a direct connection type, a PCI device request_id needs to be generated, that is, a virtual network device request ID needs to be generated.
[0050] Step S103: Create a virtual machine with a direct connection virtual network card type based on the virtual machine creation instruction, allocate a virtual network device to the virtual machine according to the request ID, and save the communication bus address of the allocated virtual network device so that the virtual network device is mounted to the virtual machine for use.
[0051] After the request ID of the virtual network device is generated, the virtual network device can be allocated to the virtual machine according to the request ID, that is, a specific VF-device is allocated to the virtual machine for use. In addition, the communication bus address of the allocated virtual network device needs to be saved. Since the communication bus is currently usually a PCI bus, this step is to save the PCI bus address of the allocated VF-device to the virtual machine information, so that in the constructed xml file for defining the virtual machine, the PCI bus address is used to identify the VF-device to be mounted. This allows the libvirt service to mount the VF-device corresponding to the PCI bus address to the virtual machine for use after receiving the request to create a virtual machine.
[0052] Since the virtual machine creation instruction carries the network ID and the virtual network card type, when executing step S103, a virtual machine with a virtual network card type of a direct connection type is created based on the virtual machine creation instruction. It should be noted that when creating a virtual machine based on the virtual machine creation instruction, the creation can be completed by the nova service and the neutron service. During the creation process, the calling process between the components within the specific nova service and the calling process between the nova service and the neutron service can adopt the traditional calling process, but it is necessary to carry the parameter of the virtual network card type when calling, so that a virtual machine with a virtual network card type of a direct connection type can be created. Of course, the corresponding components need to be expanded in advance so that they can support the solution of this application.
[0053] In a specific embodiment of the present invention, it also includes:
[0054] When the virtual network card type is a standard type, a virtual machine with a virtual network card type of a standard type is created based on the virtual machine creation instruction;
[0055] When the virtual network card type is macvtap type, a virtual machine whose virtual network card type is macvtap is created based on the virtual machine creation instruction.
[0056] In the aforementioned implementation, when the virtual machine creation instruction carries a network ID and a virtual network card type, and the virtual network card type is a direct type, a virtual machine with a direct connection type of virtual network card can be created. In this implementation, the virtual network card type carried in the virtual machine creation instruction can be supported to be a macvtap type or a standard type.
[0057] When the virtual network card type carried in the virtual machine creation instruction is a standard type, that is, a normal type, a virtual machine with a standard virtual network card type can be created directly based on the virtual machine creation instruction. Similarly, when the virtual network card type is a macvtap type, a virtual machine with a macvtap virtual network card type can be created based on the virtual machine creation instruction. The macvtap type indicates the user space virtual network adapter type.
[0058] In this implementation, when it is necessary to create direct type, normal type and macvtap type virtual machines, the staff can use the same input method, only the virtual network card type carried in the virtual machine creation instruction is different. This is conducive to improving the staff's operational convenience and is not prone to errors.
[0059] In a specific implementation of the present invention, the virtual machine creation instruction also carries the virtual machine IP address;
[0060] Correspondingly, the IP address of the virtual machine created based on the virtual machine creation instruction is the virtual machine IP address carried in the virtual machine creation instruction.
[0061] In this implementation, it is supported that the virtual machine creation instruction also carries the virtual machine IP address, so that the IP address of the virtual machine created by the virtual machine creation instruction is the virtual machine IP address carried in the virtual machine creation instruction, thereby improving the flexibility of the solution and enabling the IP address of the created virtual machine to meet user needs without the need for subsequent modification.
[0062] In addition, in one scenario, it is also supported that the virtual machine creation instruction does not carry the virtual machine IP address. If it does not carry the virtual machine IP address, the virtual machine IP address can be allocated according to the preset default rule.
[0063] In a specific embodiment of the present invention, it may also include:
[0064] Receive a virtual machine creation instruction that only carries a network ID;
[0065] Based on the virtual machine creation instruction that carries only the network ID, a virtual machine with a standard virtual network card type is created.
[0066] In this implementation, the virtual machine creation instruction only carries a network ID. This is in consideration of the staff's operating habits. That is, if the virtual network card type is not specifically specified, it can usually be considered that a virtual machine with a standard network port is needed at this time. In this implementation, a virtual machine with a standard virtual network card type will be created based on the virtual machine creation instruction that only carries a network ID, thereby improving the flexibility of the present application solution.
[0067] Of course, as described above, since the virtual machine creation instruction in this implementation mode only carries the network ID, the virtual machine IP address can be allocated according to the preset default rule.
[0068] In a specific embodiment of the present invention, it may also include:
[0069] After receiving a virtual machine creation instruction carrying a network ID and a virtual network card type, when it is verified that the virtual machine creation instruction does not comply with a preset rule, the creation of the virtual machine is stopped.
[0070] In this implementation, after receiving a virtual machine creation instruction carrying a network ID and a virtual network card type, the virtual machine creation instruction will be verified. If it is verified that the virtual machine creation instruction does not conform to the preset rules, for example, the format of the virtual machine creation instruction is incorrect, resulting in the inability to parse the content carried therein, it means that there is an abnormality in the virtual machine creation instruction, so that the creation of the virtual machine can be stopped immediately, that is, the abnormality can be discovered in time and the creation process can be stopped. In addition, in actual applications, when it is found that there is an abnormality in the virtual machine creation instruction, the first prompt information can usually be output immediately so that the staff can notice the situation in time.
[0071] In a specific embodiment of the present invention, it may also include:
[0072] Receive a virtual machine creation instruction carrying a port ID, and the virtual network card type specified in the parameter of the port ID is a direct connection type;
[0073] Based on the virtual machine creation instruction carrying the port ID, a virtual machine with a direct connection type of virtual network card type is created according to the default process.
[0074] In this implementation, if a direct connection type virtual machine needs to be created, in addition to the above-mentioned implementation method in which the virtual machine creation instruction carries the virtual network card type, it also supports the virtual machine creation instruction carrying the port ID, further improving the flexibility of the present application solution.
[0075] Of course, for this implementation, the virtual network card type specified in the parameter of the port ID needs to be a direct connection type, and the port needs to be created in advance.
[0076] The technical solution provided by the embodiment of the present invention is applied to allow the network ID and the virtual network card type to be carried in the virtual machine creation instruction, that is, the solution of the present application does not need to pre-create a direct type port, but can create a virtual machine with a virtual network card type of a direct connection type by using a one-step operation. Specifically, after receiving the virtual machine creation instruction carrying the network ID and the virtual network card type, for the port with a virtual network card type of a direct connection type, since it is necessary to access the virtual machine through a communication bus, when it is determined that the virtual network card type is a direct connection type, it is necessary to generate a request ID for the virtual network device, so that the virtual network device can be subsequently allocated to the virtual machine according to the request ID, and the communication bus address of the allocated virtual network device can be saved so that the virtual network device can be mounted to the virtual machine for use. Since the virtual machine creation instruction carries the network ID and the virtual network card type, the present application can create a virtual machine with a virtual network card type of a direct connection type based on the virtual machine creation instruction.
[0077] To sum up, when it is necessary to create a virtual machine with a direct connection type of virtual network card, this application does not need to create a direct type port in advance, but carries the network ID and virtual network card type in the virtual machine creation instruction, so that a virtual machine with a direct connection type of virtual network card can be created, which simplifies the operation of the staff and is less prone to mistakes.
[0078] Corresponding to the above method embodiment, an embodiment of the present invention further provides a virtual machine creation system for specifying a network port type, which can be referred to in correspondence with the above.
[0079] See also Figure 2 , is a schematic diagram of the structure of a virtual machine creation system of a specified network port type in the present invention, and the virtual machine creation system of the specified network port type may include:
[0080] The instruction receiving unit 201 is used to receive a virtual machine creation instruction carrying a network ID and a virtual network card type;
[0081] A virtual network device request ID generating unit 202, configured to generate a request ID for a virtual network device when the virtual network card type is a direct connection type;
[0082] The virtual machine creation unit 203 is used to create a virtual machine with a virtual network card type of direct connection type based on the virtual machine creation instruction, allocate a virtual network device to the virtual machine according to the request ID, and save the communication bus address of the allocated virtual network device so that the virtual network device can be mounted to the virtual machine for use.
[0083] In a specific implementation of the present invention, the virtual machine creation unit 203 is further configured to:
[0084] When the virtual network card type is a standard type, a virtual machine with a virtual network card type of a standard type is created based on the virtual machine creation instruction;
[0085] When the virtual network card type is macvtap type, a virtual machine whose virtual network card type is macvtap is created based on the virtual machine creation instruction.
[0086] In a specific implementation of the present invention, the virtual machine creation instruction also carries the virtual machine IP address;
[0087] Correspondingly, the IP address of the virtual machine created based on the virtual machine creation instruction is the virtual machine IP address carried in the virtual machine creation instruction.
[0088] In a specific implementation of the present invention, the instruction receiving unit 201 is further used to: receive a virtual machine creation instruction that carries only a network ID;
[0089] The virtual machine creation unit 203 is further used for:
[0090] Based on the virtual machine creation instruction that carries only the network ID, a virtual machine with a standard virtual network card type is created.
[0091] In a specific embodiment of the present invention, it also includes:
[0092] The verification unit is used to stop creating the virtual machine after receiving the virtual machine creation instruction carrying the network ID and the virtual network card type, when it is verified that the virtual machine creation instruction does not meet the preset rules.
[0093] In a specific embodiment of the present invention, it also includes:
[0094] The prompt information output unit is used to output first prompt information after stopping the creation of the virtual machine.
[0095] In a specific implementation of the present invention, the instruction receiving unit 201 is further configured to:
[0096] Receive a virtual machine creation instruction carrying a port ID, and the virtual network card type specified in the parameter of the port ID is a direct connection type;
[0097] The virtual machine creation unit 203 is further used for:
[0098] Based on the virtual machine creation instruction carrying the port ID, a virtual machine with a direct connection type of virtual network card type is created according to the default process.
[0099] Corresponding to the above method and system embodiments, the embodiments of the present invention also provide a virtual machine creation device for specifying a network port type and a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the virtual machine creation method for specifying a network port type in any of the above embodiments are implemented. The computer-readable storage medium mentioned here includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0100] The virtual machine creation device of the specified network port type may include:
[0101] Memory for storing computer programs;
[0102] A processor is used to execute a computer program to implement the steps of the method for creating a virtual machine of a specified network port type in any of the above embodiments.
[0103] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0104] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0105] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the technical solution and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, the present invention can also be improved and modified without departing from the principles of the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for creating a virtual machine with a specified network port type, characterized in that: include: Receive a virtual machine creation instruction carrying a network ID and a virtual network card type; When the virtual network card type is a direct connection type, generating a request ID for a virtual network device; Based on the virtual machine creation instruction, a virtual machine with a virtual network card type of a direct connection type is created, and a virtual network device is allocated to the virtual machine according to the request ID, and a communication bus address of the allocated virtual network device is saved, so that the virtual network device is mounted to the virtual machine for use; Also includes: Receive a virtual machine creation instruction that only carries a network ID; Based on the virtual machine creation instruction that only carries the network ID, a virtual machine with a standard virtual network card type is created; Also includes: Receive a virtual machine creation instruction carrying a port ID, wherein the virtual network card type specified in the parameter of the port ID is a direct connection type; Based on the virtual machine creation instruction carrying the port ID, a virtual machine with a virtual network card type of direct connection type is created according to a default process; The Network Request class is pre-extended within the nova service and the vnic_type field is added to the fields field of the class; and the nova_api component of the nova service is pre-extended so that the nova_api component supports the operation of receiving a virtual machine creation instruction carrying a network ID and a virtual network card type.
2. The method for creating a virtual machine of a specified network port type according to claim 1, characterized in that: Also includes: When the virtual network card type is a standard type, creating a virtual machine with a standard type of virtual network card based on the virtual machine creation instruction; When the virtual network card type is a macvtap type, a virtual machine whose virtual network card type is a macvtap is created based on the virtual machine creation instruction.
3. The method for creating a virtual machine of a specified network port type according to claim 1, characterized in that: The virtual machine creation instruction also carries the virtual machine IP address; Correspondingly, the IP address of the virtual machine created based on the virtual machine creation instruction is the virtual machine IP address carried in the virtual machine creation instruction.
4. The method for creating a virtual machine of a specified network port type according to claim 1, characterized in that: Also includes: After receiving a virtual machine creation instruction carrying a network ID and a virtual network card type, when it is verified that the virtual machine creation instruction does not comply with a preset rule, the creation of the virtual machine is stopped.
5. The method for creating a virtual machine of a specified network port type according to claim 4, characterized in that: Also includes: After the creation of the virtual machine is stopped, the first prompt information is output.
6. A virtual machine creation system for specifying a network port type, characterized in that: include: An instruction receiving unit, used for receiving a virtual machine creation instruction carrying a network ID and a virtual network card type; A virtual network device request ID generating unit, used for generating a request ID for a virtual network device when the virtual network card type is a direct connection type; A virtual machine creation unit, configured to create a virtual machine whose virtual network card type is a direct connection type based on the virtual machine creation instruction, allocate a virtual network device to the virtual machine according to the request ID, and save the allocated communication bus address of the virtual network device so that the virtual network device is mounted to the virtual machine for use; The instruction receiving unit is also used to: receive a virtual machine creation instruction carrying only a network ID; The virtual machine creation unit is further used to: create a virtual machine with a standard virtual network card type based on a virtual machine creation instruction that only carries a network ID; The instruction receiving unit is further used to: receive a virtual machine creation instruction carrying a port ID, and the virtual network card type specified in the parameter of the port ID is a direct connection type; The virtual machine creation unit is further used to: create a virtual machine with a direct connection type of virtual network card type according to a default process based on the virtual machine creation instruction carrying the port ID; The Network Request class is pre-extended within the nova service and the vnic_type field is added to the fields field of the class; and the nova_api component of the nova service is pre-extended so that the nova_api component supports the operation of receiving a virtual machine creation instruction carrying a network ID and a virtual network card type.
7. A virtual machine creation device for specifying a network port type, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program to implement the steps of the method for creating a virtual machine with a specified network port type according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for creating a virtual machine with a specified network port type according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Resource payment method
CN103703724A
OpenStack based software defined network simulation system and method
CN105227344A
Method and device for establishing a network through virtual switch
CN107332791A
Network access method, device and equipment of virtual machine, and storage medium
CN107733889A
Method and device for creating virtual router interface, storage medium and equipment
CN110581800A
