CN109768871B - Method for configuring multiple virtual network cards, host machine and storage medium - Google Patents

Method for configuring multiple virtual network cards, host machine and storage medium Download PDF

Info

Publication number
CN109768871B
CN109768871B CN201711096692.4A CN201711096692A CN109768871B CN 109768871 B CN109768871 B CN 109768871B CN 201711096692 A CN201711096692 A CN 201711096692A CN 109768871 B CN109768871 B CN 109768871B
Authority
CN
China
Prior art keywords
virtual
network card
virtual network
service component
network service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711096692.4A
Other languages
Chinese (zh)
Other versions
CN109768871A (en
Inventor
余焕军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201711096692.4A priority Critical patent/CN109768871B/en
Publication of CN109768871A publication Critical patent/CN109768871A/en
Application granted granted Critical
Publication of CN109768871B publication Critical patent/CN109768871B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method for configuring a plurality of virtual network cards, a host machine and a storage medium. The host machine comprises: the virtual switch, the virtual machine and the network service assembly, wherein the virtual switch and the virtual machine are respectively connected with the network service assembly, and the method comprises the following steps: the network service component sets a plurality of virtual switch ports on the virtual switch; the network service component creates a plurality of virtual network cards in the virtual machine; the network service component establishes a first mapping relation between a plurality of virtual network cards and a plurality of virtual switch ports; when the virtual network card is started, the network service component establishes a network channel between the started virtual network card and a virtual switch port having a first mapping relation with the started virtual network card. The embodiment of the invention can be applied to configuring a plurality of virtual network cards for the virtual machine on the host machine, and can ensure that the host machine can accurately control the data flow passing through the virtual network cards.

Description

Method for configuring multiple virtual network cards, host machine and storage medium
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a method for configuring multiple virtual network cards, a host, and a storage medium.
Background
With the rapid development of internet services, a single Virtual interface (Vif) is difficult to meet the requirement of rapid development, and a Virtual Machine (VM) on a host NC (physical Machine where a Virtual Machine is located) needs to be configured with a plurality of Virtual network cards. For example, some applications require multiple virtual network cards to meet these application requirements; real-time application clusters (Oracle RAC) require an Interconnection Protocol (IP) between networks of multiple intranets, and these IPs are respectively used for client connection, service processing, browsing (scan), heartbeat synchronization, and the like. For another example, for a video-class site, a game-class site, etc., multiple virtual network cards are needed to process control commands and user data stream commands. In addition, F5 devices (load balancing devices, flow control devices, etc.) also require multiple virtual network cards. One of the virtual network cards can be used for management configuration, such as basic configuration information and license acquisition (license) information for connecting with the internet of a super administrator (admin web), and the other virtual network cards can be used for services.
In order to meet the requirement that a single server supports multiple virtual network cards, most current cloud manufacturers only configure one virtual network card, and achieve the requirement of user distribution by binding multiple IPs. And some cloud manufacturers also adopt a public and private network to bind 2 virtual network cards to realize the requirement of user distribution.
However, the applicant found through research that: the existing single virtual network card multi-IP scheme cannot accurately control data flow. For example, when the flow of the data stream is too large, it may be affected by network congestion, the server may not receive the instruction sent by the control node, and all data may not be actually shunted. In addition, the conventional technical scheme cannot control the data flow, for example, which IP address the data flow to, and the bandwidth of each IP cannot be set.
How to configure a plurality of virtual network cards for a VM on a host computer so that the host computer can accurately control data flow becomes a technical problem to be solved urgently in the industry.
Disclosure of Invention
In order to solve the problem that the existing single-virtual-network-card multi-IP scheme cannot accurately control data flow, embodiments of the present invention provide a method for configuring multiple virtual network cards, a host, and a storage medium.
In a first aspect, a method for configuring a plurality of network cards for a virtual machine on a host machine is provided.
The host machine comprises: the virtual Switch (vSwitch ), virtual machine and network service assembly, virtual Switch and virtual machine are connected with network service assembly respectively, the method includes the following steps:
the network service component sets a plurality of virtual switch ports (vport) on the virtual switch;
the network service component creates a plurality of virtual network cards in the virtual machine;
the network service component establishes a first mapping relation between a plurality of virtual network cards and a plurality of virtual switch ports;
when the virtual network card is started, the network service component establishes a network channel between the started virtual network card and a virtual switch port having a first mapping relation with the started virtual network card.
In a second aspect, a host is provided. The host machine comprises:
virtual switch, virtual machine and network service assembly, virtual switch and virtual machine are connected with network service assembly respectively, and network service assembly includes:
the port setting module is used for setting a plurality of virtual switch ports on the virtual switch;
the network card creating module is used for creating a plurality of virtual network cards in the virtual machine;
the first establishing module is used for establishing a first mapping relation between a plurality of virtual network cards and a plurality of virtual switch ports;
the channel establishing module is used for establishing a network channel between the started virtual network card and a virtual switch port which has a first mapping relation with the started virtual network card when the virtual network card is started.
In a third aspect, a host is provided. The host machine comprises:
a memory for storing a program;
a processor for executing a program stored in the memory, the program causing the processor to perform the method of the first aspect described above.
In a fourth aspect, a computer-readable storage medium is provided. The computer readable storage medium has stored therein instructions that, when executed on a computer, cause the computer to perform the method of the first aspect described above.
In a fifth aspect, a computer program product containing instructions is provided. When the product is run on a computer, it causes the computer to perform the method of the first aspect described above.
In a sixth aspect, a computer program is provided. When the computer program is run on a computer, it causes the computer to perform the method of the first aspect described above.
In the embodiment of the invention, a plurality of vports are arranged on the vSwitch through the network service component, a plurality of virtual network cards are created in the VM, and the mapping relation between each virtual network card and each vport is established. Therefore, the embodiment of the invention can be applied to configuring a plurality of virtual network cards for the VM on the host machine, and can ensure that the host machine can accurately control the data flow passing through the virtual network cards.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments of the present invention will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a system architecture for configuring multiple virtual network cards for a virtual machine on a host according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for configuring multiple virtual network cards for a virtual machine on a host according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a relevant state of a virtual network card in a process of configuring multiple virtual network cards for a virtual machine on a host according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a process of configuring multiple virtual network cards for a virtual machine on a host according to an embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating a process of using multiple virtual network cards of a virtual machine on a host according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a host according to an embodiment of the present invention;
FIG. 7 is a block diagram of a network service component according to an embodiment of the invention;
fig. 8 is a schematic diagram of a framework structure of a host according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a schematic diagram of a system architecture for configuring multiple virtual network cards for a virtual machine on a host according to an embodiment of the present invention.
As shown in fig. 1, the system architecture may include: client group 100, network 200, and host (NC) 300. Among them, the client group 100 may include: client 101, client 102, client 103, and so on. The host 300 may include: vSwitch310, VM320, and Web services component 330. The vSwitch310 and VM320 are connected to a Web Service330, respectively.
In the present embodiment, the client 101, the client 102, and the client 103 may be various electronic devices of the user. These electronic devices include, but are not limited to, personal computers, smart phones, tablet computers, personal digital assistants, servers, and the like. These electronic devices may be installed with various communication client applications, such as instant messaging tools, mailbox clients, social platform software, audio video software, and the like. These electronic devices have memories, logical operation processors, control elements, and the like. The electronic devices can send data requests or receive data requests, and can analyze, verify, store and the like the data.
In the present embodiment, network 200 is used to provide a medium for communication links between various communication devices (e.g., client group 100 and host 300). In particular, the network may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
In this embodiment, there are 8 vports within vSwitch310, respectively vport311, vport312, vport313, vport314, vport315, vport316, vport317, and vport 318. Wherein, 5 ports vport311, vport312, vport313, vport314, vport315 constitute a group vport group 31. Port316, vport317, and vport318 are each independent ports disposed outside of port group 31.
In this embodiment, 4 vifs are created in the VM320, which are respectively: vif321, Vif322, Vif323, and Vif 324.
In this embodiment, the network cards configured through the network may be virtual network cards. For example, Vif is a virtual Network card, main Vif is a virtual Network card, and an Elastic Network Interface (ENI) is also a virtual Network card. The virtual network card can be mapped to the physical network card through network equipment such as a network bridge and the like, so that the function of the physical network card is realized, and network communication is further carried out.
In this embodiment, the Web Service330 may be configured to create the vport in the vSwitch310, create the vifs in the VM, and establish a first mapping relationship between each Vif and each vport. For example, Web Service330 may establish a first mapping relationship between Vif321 and vport311, Vif322 and vport313, Vif323 and vport315, and Vif324 and vport 318. When Vif321 starts up, a network channel between Vif321 and vport311 is established. Similarly, when Vif322 is enabled, Vif322 communicates with the channel between vport 313.
The number of devices in fig. 1 is merely illustrative. In other embodiments, the system architecture may have any number of clients 100, networks 200, and hosts 300, as desired for implementation. Multiple hosts 300 may constitute a cloud service cluster. The number of vport groups 31 may vary, the number of vports within vport group31 may vary, and the number of Vif may increase or decrease. In addition, the architecture may also include auxiliary devices for communication, such as routers and power supplies.
In the following embodiments, the present system architecture may be applied to configure operations such as one or more virtual network cards, and for simplicity of description, the contents of the embodiments may be mutually referred to and referred to.
The following is a brief description of an implementation manner for configuring multiple virtual network cards for a VM on a host.
First, the host 300 may receive a request for ordering one Vif for the client 101, the client 102, and the client 103, respectively.
Then, Web Service330 of host 300 may set 8 vport (vport 311, vport312, vport313, vport314, vport315, vport316, vport317, and vport318, respectively) in vSwitch310 in response to the subscription request.
Next, the Web Service330 can create 4 Vifs (Vif 321, Vif322, Vif323, and Vif324, respectively) in the VM.
Then, Web Service330 may establish a mapping relationship between Vif321 and vport311, a mapping relationship between Vif322 and vport313, a mapping relationship between Vif323 and vport315, and a mapping relationship between Vif324 and vport 318.
Then, the Web Service330 may assign Vif321 to the client 101, Vif322 to the client 102, and Vif323 to the client 103.
So far, Vif configuration is successful. The client 101 can perform information interaction through a network channel between the Vif321 and the vport 311; the client 102 can perform information interaction through a network channel between the Vif322 and the vport 313; the client 103 can perform information interaction through a network channel between the Vif323 and the vport 315.
Fig. 2 is a flowchart illustrating a method for configuring multiple virtual network cards for a virtual machine on a host according to an embodiment of the present invention.
The embodiment of the invention can be applied to configuring a plurality of Vifs for one VM on a host (such as an x86 server and the like), and can ensure that the host can accurately control the data flow passing through the Vifs. The embodiment of the invention can also be applied to configuring a plurality of Vifs for a plurality of VMs (cloud servers) on the host machine, so that the cloud server can support the plurality of Vifs. In addition, the cloud server can mount the Vif in an operating state, and the effect is equivalent to inserting a physical network card into a physical machine. The Vif can also be unloaded by the cloud server in the running state, and the effect is equivalent to the removal of a physical network card on a physical machine. Thus, the cloud server can support hot plug of Vif.
Specifically, the method for implementing the Vif hot plug supported by the cloud server may include: creating a vport on the vSwitch; increasing Vif through a virtualization instruction; triggering a device manager (such as UDEV) change event of a user cloud computing platform (such as OS), enabling the client OS to identify a new device (such as a Vif to be mounted), connecting a Dynamic Host Configuration Protocol (DHCP) client of a user, and configuring an IP address of the client; the network is then checked for patency. This part of the content will be described further below.
The embodiment of the invention can realize that a plurality of Vifs are connected with different networks (different networks are configured through a vXlan protocol) by accessing a plurality of ports corresponding to the plurality of Vifs to the vSwitch.
These vifs can be configured for production at any time. For example, after the host computer receives the order of Vif from the user (e.g., client 101 in fig. 1), the host computer then produces the Vif (e.g., Vif321, Vif322, Vif323, Vif324, etc. in fig. 1) in the order quantity configuration. As another example, the host may be pre-configured to produce some of the Vifs, which are then sold.
As shown in fig. 2, the method for configuring multiple virtual network cards for a VM on a host includes the following steps: s210, the network service component sets a plurality of virtual switch ports on the virtual switch; s220, the network service component creates a plurality of virtual network cards in the virtual machine S230, and the network service component creates a first mapping relation between the virtual network cards and the virtual switch ports; s240, when the virtual network card is started, the network service assembly establishes a network channel between the started virtual network card and a virtual switch port having a first mapping relation with the started virtual network card.
In step S210, the network service component may include components of elements such as a central processing unit CPU, a read only memory ROM, and a random access memory RAM, and may run program software therein. The host machine can perform management control and other operations through the network service component. The network service component may set up vSwitch default non-vport information, and may create multiple vports when a user needs to create Vif on a specified NC. The number of Vif and the number of vport may be the same or different. Vport may exist alone when a VM is not started.
In this embodiment, the network service component may set a plurality of vports on the vSwitch first, and then set a bandwidth parameter of the vport. For example, the web services component makes a speed limit definition for vport to limit the capacity of bandwidth. Specifically, the network service component may limit 5Mb bandwidth for each vport, and support speed limit settings such as Bps and Pps.
In some other embodiments, the network service component may be a network service platform or a network control component, among others.
In step S220, the network service component may first create a VM by virtualizing libvirt (function library), and then add binding information of vport to a description file of Vif in the VM, where the binding information is used for finding a forwarded vport interface when the VM performs network interaction at a client. The network service component may also set the speed parameter for Vif. For example, the web services component may define the rate limit for Vif as a capability value for the hardware specification. Specifically, the network service component may define the virtual network card as a gigabit virtual network card, a tera virtual network card, or the like.
In step S230, the network service component may bind each Vif and the corresponding vport by establishing a first mapping relationship between the vifs and the vports. By the design, network channels between each Vif and the corresponding vport can be planned in advance, so that data traffic flows according to a preset path.
In step S240, when the Vif boots, the network service component may first obtain an IP address dynamically allocated to the started Vif by the VM. For example, the network service component may obtain the IP address that the VM dynamically assigns to the started Vif based on the DHCP protocol. The web service component may then establish a network channel between the launched Vif and a vport having a first mapping relationship with the launched Vif based on the IP address.
Therefore, the embodiment of the invention can set a plurality of vports on the vSwitch through the network service component, create a plurality of vifs in the VM, and establish the mapping relationship between each Vif and each vport, when the Vif is started, the network channel between the started Vif and the vport having the mapping relationship with the started Vif can enable the data stream to flow according to the network channel between the pre-designed Vif and the vport corresponding to the Vif. By the method, multiple vifs can be configured and produced for the VM on the host machine, and the host machine can be ensured to accurately control data flow passing through the vifs.
In some embodiments, before the network service component sets N vports on the vSwitch, the method for configuring multiple virtual network cards for a VM on a host may further include: a network service component acquires a Media Access Control (MAC) address of a VM; the network service component configures the IP address of the VM based on the MAC address; the network service component establishes a second mapping relationship of the IP address and the MAC address. Therefore, the embodiment of the invention can associate the client and the VM according to the second mapping relation, and can configure the virtual network card according to the actual network resources (resources such as MAC addresses, IP addresses and the like) so as to reasonably utilize the resources.
The embodiment of the invention can abandon the existing static definition IP mode and adopt the DHCP mode to obtain the IP address. For example, when creating a virtual network card, a DHCP server (client) user configures a mapping relationship between MAC and IP, and when starting up multiple virtual network cards, a VM may obtain an IP address through a DHCP client.
In some embodiments, the method for configuring multiple virtual network cards for a VM on a host machine may further include: the network service component sets part of the vports in the multiple vports as a vport group of the same virtual switch port group; and the network service component sets the Vif having the first mapping relation with 1 vport except the vport group as the main Vif. In this embodiment, the piece of Vif brought by VM creation may be defined as the master Vif by default. The main Vif cannot be unplugged during network communication, and can be used by a user to control important network entries of the VM, and subsequently plugged vifs can be unplugged.
The virtual network cards (such as the main Vif and the Vif) configured in the embodiment of the invention can support hot plug, and the public network IP corresponding to the Vif can be unique in the whole network range. Therefore, the embodiment of the invention can realize that the Vif can drift randomly in the cloud service provided by the same cloud manufacturer, realize no domain name, and seamlessly and rapidly migrate the service in a large range and a long distance.
In some embodiments, the method for configuring multiple virtual network cards for a VM on a host may further include: the network service component configures the vport group as a user traffic port; the web service component configures the vport corresponding to the master Vif as the management port. Specifically, the number of vport groups may be multiple. For example, vport group1(VG1), vport group2(VG2), and the like. A user who defaults to a certain group may set the group for different purposes. For example, the user may set the traffic corresponding to vport group1 as the user traffic, and set the port (e.g., P8) corresponding to one Vif (e.g., the main Vif) outside the VG1 as the management port. The design can realize that: when the user traffic is too large and the bandwidth of all the ports in VG1 is occupied, the user can still easily send a control instruction to the VM, and the failure of the management and control system due to network congestion is avoided.
In addition, based on the above mechanism, the embodiment of the invention can also realize network security isolation. Since the VGs 1 and the ps 8 are set with different user services and bind different services in the form of binding virtual network cards on the application, different service network isolations can be realized by the same VM.
Specifically, when creating a vport on an NC, a network service component may specify a group where the vport is located, and if the group does not exist, the network service component may directly create the vport; if the group already exists, the corresponding vport can be directly added to the previously existing speed limit group. By adopting the design, bandwidth information can be shared without using the speed limit value of a single vport by the VMs in the group.
For example, a web service component may define a vport group as the merging speed limiting capability of multiple vports, which may be packed externally as multiple vports, and designed as one vport group at the bottom layer. At this time, each Vif may be mapped to a corresponding vport.
When setting the speed limit, the network service component can set 4 indexes of the speed limit range. For example, the network service component may specify tx _ bps, rx _ bps for defining ingress and egress bandwidth rate limits, and may also specify tx _ pps, rx _ pps for defining ingress and egress network packet rate limits. The vport corresponding to each virtual network card can be set with the 4 values, each group can also limit the corresponding 4 index values, but the value on the vport corresponding to the virtual network card added into the group will not take effect any more, and then the overall index of the group will be used as the standard.
The configuration of the virtual network card is not only short in time and convenient compared with the production of a physical network card, but also saves resources. Therefore, the embodiment of the invention can simply configure a plurality of virtual network cards and realize the low price of a single virtual network card. Because the price of the single virtual network card is low, the reserved occupation of the IP can be realized by purchasing the virtual network card for the application of the mobile terminal (client).
Compared with the prior art, the method for simply configuring the plurality of virtual network cards in the embodiment of the invention can greatly save the cost. In the prior art, for example, in a domestic train ticket grabbing Application (APP), a plurality of individual users purchase a server and a public network IP, but do not purchase a domain name, so that the individual users statically write an IP address into the APP. However, in such applications, the flow rate is very high only in spring festival or important festival, and the flow rate is very low in normal times. As another example, purchasing VMs annually, the cost paid by the user is high; but if the user releases the IP once, the IP may be seized by others when it is needed. In the embodiment of the invention, a user can firstly purchase a free virtual network card, and then purchase a VM when the VM is needed, and insert the virtual network card into the VM for use, so that the virtual network card is reserved and the VM is released when the VM is not needed, thereby greatly reducing the cost.
Fig. 3 is a schematic diagram of a relevant state of a virtual network card in a process of configuring multiple virtual network cards for a VM on a host according to an embodiment of the present invention.
In this embodiment, the configured virtual network card may be an elastic network card ENI. Network service component the network service component may define the state of the ENI as creating, free, attaching, attached, detaching, deleting, deleted, etc. Free can be in a free state, and the virtual network card cannot be used without any VM. The attach may be a plug-in VM state indicating that the user may use the virtual network card through the VM. However, in practice, the IP is not configured due to DHCP abnormality inside the VM. Due to the lack of the IP, the virtual network card is not configured successfully, and further the network is not accessible, and at the moment, the user can repair the network through the patch. Attached may indicate that a hardware device has been installed on a VM and is available.
As shown in fig. 3, a process of configuring a plurality of virtual network cards for a VM on a host and a corresponding virtual network card state thereof may be as follows:
s301, starting a state, and preparing a virtual machine (Vif) configuration for a Virtual Machine (VM) on a host machine by a network service component.
S302, the network service component receives the Vif creating request, and executes the operation of Create _ eni (creating an elastic virtual network card) in response to the Vif creating request. At this time, the state of Vif may be a creating state. Wherein a request to create a Vif may be input by a user, the request specifying a VM. When a Vif is created, the Vif may automatically bind to the specified VM.
S303, the state of Vif after successful creation may be a free state. The network service component receives the mount Vif request, and executes the operation of Attach _ eni (mount Vif in free state onto VM, both in allowed shutdown and running state) in response to the mount Vif request.
S304, the state of Vif can be an associating state.
S305, when the Vif mount succeeds in Auto attach success, the state of the Vif can be an attached state.
S306, after the mount is successful, if the Vif is not needed to be used, a Detach _ eni (the Vif for unloading the attached state is in a free state, and two states of shutdown and running state are allowed) operation can be executed.
On one hand, after the unloading is successful (Auto miss), the status of Vif may be free (status of S303). On the other hand, when the detach _ eni operation is performed, the state of Vif may be as the deleting state of S307.
S307, after the mount is successful, if the Vif does not need to be used, the operation of Deltate _ eni (deleting the Vif, normally only allowing the user to delete the Vif in free state, and forcibly designating the Vif to be released together with the VM when the VM is released) can be executed. At this time, the state of Vif may be a deleting state.
S308, after the Vif is successfully deleted (Auto delete success), the state of the Vif can be a deleted state.
S309, the operation ends.
The operations in the embodiment in fig. 3 may be executed in whole or in part according to actual needs, the order of operations in each step may be changed, some steps may be added or subtracted, and a specific implementation manner may be as shown in each of the following embodiments.
In some embodiments, the network service component defines one or more of the following status parameters of the virtual network card: creating state parameters, freeing state parameters, mounting state parameters, mounted state parameters, unmounting state parameters, deleting state parameters, and deleted state parameters.
In some embodiments, after the network service component creates N virtual network cards in the VM, the method may further include: the network service component receives a request for mounting the virtual network card; the network service component responds to the request for mounting the virtual network card and judges whether the state parameter of the created virtual network card is a free state parameter; when the state parameter is a free state parameter, the network service component mounts the created virtual network card to the VM; and when the mounting is successful, the network service component changes the state parameter of the mounted virtual network card into the attached state parameter.
In some embodiments, the method may further comprise: the network service component receives a request for unloading the virtual network card; the network service component responds to the request for unloading the virtual network card and judges whether the state parameter of the created virtual network card is an attached state parameter; when the state parameter is an attached state parameter, the network service component uninstalls the attached virtual network card from the VM; and when the uninstalling is successful, the network service component changes the state parameter of the uninstalled virtual network card into a free state parameter.
In some embodiments, the method may further comprise: the network service component receives a request for deleting the virtual network card; the network service component responds to the request for deleting the virtual network card and judges whether the state parameter of the created virtual network card is an atteched state parameter or not; when the state parameter is an atteched state parameter, the network service component deletes the mounted virtual network card from the VM; and when the deletion is successful, the network service component changes the state parameter of the deleted virtual network card into the deleted state parameter.
Therefore, the embodiment of the invention can simply and conveniently create and delete the virtual network card and the like, so that the design can meet the flexible operation requirement of the user, and the user experience is improved.
Fig. 4 is a schematic diagram of a process of configuring multiple virtual network cards for a virtual machine on a host according to an embodiment of the present invention.
In this embodiment, a description will be given of an application scenario in which a user purchases a separate virtual network card. As shown in fig. 4, the method comprises the steps of:
s401, start.
S402, the network service component receives a request of ordering and purchasing Vif from a user.
S403, the network service component determines whether the MAC address of the VM is sufficient in response to the request to purchase Vif. If the MAC address resource is insufficient, go to S411.
S404, if the MAC address resource is sufficient, the network service component judges whether the IP address of the VM is sufficient. If the IP address resource is insufficient, go to S411.
S411, the Vif purchase fails.
S405, and S404, if the IP address resource is sufficient, the user can pay.
S406, after receiving the payment paid by the user, the network service component may generate Vif resource. And adding records in the DB database after the produced Vif resources, and indicating that the produced Vif resources occupy the MAC resources and the IP resources occupied by the produced network cards. If the MAC and IP resources are exhausted, the network service component will no longer produce a new Vif.
S407, the web service component determines whether to mount the Vif on the VM when purchased by the user. The judgment can be made according to the requirements of the client.
S408, if the Vif needs to be mounted to the VM at the time of purchase by the user, the Vif may be mounted to the VM.
S409, if it is not necessary to mount the Vif to the VM when the user purchases the Vif, the DHCP server may be notified to store the mapping relationship between the MAC and the IP, and mount the Vif to the VM when the user needs the Vif (this process will be further described below).
S410, Vif production is successful.
The operations in the embodiment in fig. 4 may be selected to be executed in whole or in part according to actual requirements, the order of the operations may also be changed, some steps may also be added or subtracted, and a specific implementation manner may be as shown in each of the following embodiments.
In some embodiments, before the network service component sets N vports on the vSwitch, the method may further include: the network service component receives a request for purchasing the virtual network card; the network service component responds to the request for purchasing the virtual network card and judges whether the MAC address of the VM is enough or not; when the MAC address is enough, the network service component judges whether the IP address is enough; when the IP address is enough, the network service component sends a virtual network card producing instruction to the VM.
In some embodiments, the method may further comprise: after the virtual network card is produced, the network service component records the MAC address and the IP address occupied by the produced virtual network card; after the produced virtual network card is mounted to the VM, the network service assembly stores a second mapping relation between the MAC address and the IP address; alternatively, the network service component directly stores the second mapping relationship between the MAC address and the IP address.
Therefore, the embodiment of the invention can simply and conveniently create and mount the virtual network card and the like, can be used for network sales, can meet the flexible operation requirements of users by the design, and improves the user experience.
In some embodiments, the network service component may first produce some virtual network cards and then sell them to the user over the network.
Fig. 5 is a schematic diagram of a process of using multiple virtual network cards of a virtual machine on a host according to an embodiment of the present invention.
In this embodiment, a description will be given of an application scenario in which a user inserts a virtual network card and uses the virtual network card. The network service component may perform corresponding operations according to the user input instruction, and the action execution subject of this embodiment may be the network service component. As shown in fig. 5, the method comprises the steps of:
s501, start.
S502, the network service component checks whether the VM is in running state or stopped state.
S503, when the checking result shows that the ENI state is correct to be the anchoring state, the network service component modifies the ENI state to be the anchoring state.
S504, the network service component creates a vport on the NC.
S505, the web service component determines whether vport is successfully created.
S506, when the vport is judged to be successfully created, the network service component issues routing information corresponding to the vport.
S507, the network service component judges whether the routing information is successfully issued.
S508, when judging that the routing information is successfully distributed, the network service component updates the ENI state to be atteched.
S509, the network service component checks whether the VM is in running state.
And S510, when the VM is not in running state, connecting the network service component with the client through an attach Vif interface.
S511, the network service component judges whether the client operates normally.
S512, when the client is judged to run, the network service assembly receives the request of the client from the server and configures the IP address.
S513, the network service component determines whether the client configures an IP address normally.
S514, if the client normally configures the IP address, the network service component indicates that the operation is successful.
S515, if the client does not normally configure the IP address, the network service component notifies the client to patch (patch) and triggers to configure the IP address again, and then goes to S514.
And S516, connecting S507, and when the routing information is judged to be unsuccessfully issued, the network service component judges whether the maximum retry number is exceeded or not. If the network service component determines that the maximum number of retries has not been exceeded, it goes to S506.
S517, if the network service component judges that the maximum retry number is exceeded, deleting the vport.
S518, the network service component determines whether the deletion was successful.
S519, if the network service assembly judges that the deletion is successful, the ENI state is modified to free, and then S520 is carried out.
S520, connect up to S519, the network service component indicates that the operation failed. The present step may also be preceded by S502, and when the check result shows no (neither running nor stopped state), it indicates that the operation failed.
In addition, in the case of no conflict, those skilled in the art can flexibly adjust the order of the above operation steps or flexibly combine the above steps according to actual needs. Various implementations are not described again for the sake of brevity.
Fig. 6 is a schematic structural diagram of a host according to an embodiment of the present invention.
As shown in fig. 6, the host 300 may include: vSwitch310, VM320, and Web services component 330. vSwitch310 and VM320 are connected to a Web Service330, respectively.
In the present embodiment, there are 8 vports in vSwitch310, which are vport311, vport312, vport313, vport314, vport315, vport316, vport317, and vport 318. Wherein, 5 ports vport311, vport312, vport313, vport314, vport315 constitute a group vport group 31. Port316, vport317, and vport318 are each separate ports disposed outside of port group 31.
In this embodiment, 4 vifs are created in the VM320, which are respectively: vif321, Vif322, Vif323, and Vif 324.
In this embodiment, the Web Service330 may be configured to create the aforementioned vport in the vSwitch310, create the aforementioned vifs in the VM, and establish a first mapping relationship between each Vif and each vport. For example, Web Service330 may establish a first mapping relationship between Vif321 and vport311, Vif322 and vport313, Vif323 and vport315, and Vif324 and vport 318. When Vif321 starts up, a network channel between Vif321 and vport311 is established. Similarly, when Vif322 is started, Vif322 communicates with the channel between vport 313.
Fig. 7 is a schematic structural diagram of a network service component according to an embodiment of the present invention.
As shown in fig. 7, the web services component 330 may include: a port setting module 331, a network card creating module 332, a first establishing module 333 and a channel establishing module 334. The port setting module 331 may be configured to set a plurality of virtual switch ports on a virtual switch; the network card creating module 332 may be configured to create a plurality of virtual network cards in a virtual machine; the first establishing module 333 may be configured to establish a first mapping relationship between a plurality of virtual network cards and a plurality of virtual switch ports; the channel establishing module 334 may be configured to, when the virtual network card is started, establish a network channel between the started virtual network card and a virtual switch port having a first mapping relationship with the started virtual network card.
In some embodiments, the channel establishing module 334 may include: an address acquisition unit and a channel establishment unit. The address acquisition unit can be used for acquiring an IP address dynamically allocated to the started virtual network card by the VM; the channel establishing unit may be configured to establish a network channel between the started virtual network card and a vport having a first mapping relationship with the started virtual network card based on the IP address.
In some embodiments, the web services component 330 may further include: the device comprises an MAC address acquisition module, an IP address configuration module and a second establishment module. The MAC address obtaining module may be configured to obtain a MAC address of the VM; the IP address configuration module may be configured to configure an IP address of the VM based on the MAC address; the second establishing module may be configured to establish a second mapping relationship between the IP address and the MAC address.
In some embodiments, web services component 330 may further include: the device comprises a port group setting module and a main Vif setting module. The port group setting module can be used for setting part of the vports in the multiple vports to be the same virtual switch port group vport group; the main Vif setting module may be configured to set, as the main Vif, a virtual network card having a first mapping relationship with 1 vport other than the vport group.
In some embodiments, web services component 330 may further include: a flow port configuration module and a management port configuration module. The traffic port configuration module may be configured to configure a vport group as a user traffic port; the management port configuration module may be configured to configure a vport corresponding to the master Vif as a management port.
In some embodiments, web services component 330 may further include: a speed parameter setting module and/or a bandwidth parameter setting module. Wherein. The speed parameter setting module can be used for setting the speed parameters of the virtual network card; the bandwidth parameter setting module may be configured to set a bandwidth parameter of the vport.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
In some embodiments, web services component 330 may also include a parameter definition module. The parameter definition module may be configured to define one or more of the following state parameters of the virtual network card: creating state parameters, freeing state parameters, mounting state parameters, mounted state parameters, unmounting state parameters, deleting state parameters, and deleted state parameters.
In some embodiments, web services component 330 may further include: the device comprises a request receiving module, a parameter judging module, a virtual network card mounting module and a state changing module. The request receiving module can be used for receiving a virtual network card mounting request; the parameter judgment module can be used for responding to the request for mounting the virtual network card and judging whether the created state parameter of the virtual network card is a free state parameter; the virtual network card mounting module can be used for mounting the created virtual network card to the VM when the state parameter is a free state parameter; the state changing module may be configured to change the state parameter of the mounted virtual network card to an atteched state parameter when the mounting is successful.
In some embodiments, the web services component 330 may further include: the device comprises a request receiving module, a parameter judging module, a virtual network card unloading module and a state changing module. The request receiving module can be used for receiving a request for unloading the virtual network card; the parameter judgment module may be configured to respond to a request for unloading a virtual network card, and judge whether a state parameter of the created virtual network card is an atteched state parameter; the virtual network card unloading module can be used for unloading the mounted virtual network card from the VM when the state parameter is an attached state parameter; the state change module may be configured to change the state parameter of the offloaded virtual network card to a free state parameter when the offload is successful.
In some embodiments, web services component 330 may further include: the device comprises a request receiving module, a parameter judging module, a virtual network card unloading module and a state changing module. The request receiving module can be used for receiving a request for deleting the virtual network card; the parameter judgment module may be configured to respond to the request for deleting the virtual network card, and judge whether the state parameter of the created virtual network card is an asserted state parameter; the virtual network card unloading module can be used for deleting the mounted virtual network card from the VM when the state parameter is an attached state parameter; the status changing module may be configured to change the deleted status parameter of the virtual network card to the deleted status parameter when the deletion is successful.
In some embodiments, the web services component 330 may further include: the system comprises an order acquisition module, an MAC address judgment module, an IP address judgment module and an instruction sending module. The order acquisition module can be used for the network service component to receive a request for purchasing the virtual network card; the MAC address judging module can be used for responding to a request for purchasing the virtual network card and judging whether the MAC address of the VM is enough; the IP address judging module can be used for judging whether the IP address is enough or not when the MAC address is enough; the instruction sending module can be used for sending the virtual network card producing instruction to the VM by the network service component when the IP address is enough.
In some embodiments, the web services component 330 may further include: the device comprises an address recording module and a first relation storage module (or a second relation storage module). The address recording module can be used for recording the MAC address and the IP address occupied by the produced virtual network card after the virtual network card is produced; the first relation storage module can be used for storing a second mapping relation between the MAC address and the IP address after the produced virtual network card is mounted to the VM; the second relation storage module may be configured to directly store a second mapping relation between the MAC address and the IP address.
In some embodiments, the address fetch unit may be further to: and acquiring the IP address dynamically allocated to the started virtual network card by the VM based on the DHCP protocol.
In some embodiments, web services component 330 may further include: the device comprises a request sending module, an address receiving module and a channel communication module. The request sending module can be used for sending a request for connecting the client through a network channel; the address receiving module can be used for receiving the IP address configured by the client;
the channel communication module can be used for communicating the vport which has the first mapping relation with the started virtual network card with the network channel between the client side when the IP address is correct.
In some embodiments, web services component 330 may further include: and a patch sending module. The patch sending module may be configured to send a patch command to the client and re-receive the IP address configured by the client when the IP address is incorrect.
It should be noted that the apparatuses in the foregoing embodiments can be used as the execution main body in the methods in the foregoing embodiments, and can implement corresponding processes in the methods to achieve the same technical effects, and for brevity, the contents of this aspect are not described again.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions which, when run on a computer, cause the computer to perform the method described in the various embodiments above. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to be performed in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Fig. 8 is a schematic diagram of a framework structure of a host according to an embodiment of the present invention.
As shown in fig. 8, the framework may include a Central Processing Unit (CPU)801 that can perform various operations of the above-described embodiment according to a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803.
In the RAM803, various programs and data necessary for the operation of the system architecture are also stored. The CPU 801, ROM 802, and RAM803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (30)

1. A method for configuring a plurality of virtual network cards for a virtual machine on a host machine is characterized in that the host machine comprises: the method comprises the following steps of:
the network service component sets a plurality of virtual switch ports on the virtual switch;
the network service component creates a plurality of virtual network cards in the virtual machine;
the network service component establishes a first mapping relation between the plurality of virtual network cards and the plurality of virtual switch ports;
when the virtual network card is started, the network service component acquires an internet protocol address dynamically allocated to the started virtual network card by the virtual machine;
and the network service component establishes a network channel between the started virtual network card and a virtual switch port having the first mapping relation with the started virtual network card based on the Internet protocol address.
2. The method of claim 1, wherein before the network service component sets up a plurality of virtual switch ports on the virtual switch, further comprising:
the network service component acquires a media access control address of the virtual machine;
the network service component configures an internet protocol address of the virtual machine based on the media access control address;
the network service component establishes a second mapping relationship between the internet protocol address and the media access control address.
3. The method of claim 1, further comprising:
the network service component sets part of the virtual switch ports in the plurality of virtual switch ports as the same virtual switch port group;
and the network service component sets a virtual network card which has the first mapping relation with 1 virtual switch port out of the virtual switch port group as a main virtual network card.
4. The method of claim 3, further comprising:
the network service component configures the virtual switch port group into a user traffic port;
and the network service component configures the virtual switch port corresponding to the main virtual network card as a management port.
5. The method of claim 1, further comprising:
the network service component sets a speed parameter of the virtual network card;
and/or the presence of a gas in the gas,
the network service component sets bandwidth parameters of the virtual switch ports.
6. The method according to any one of claims 1-5, further comprising:
the network service component defines one or more than two state parameters of the virtual network card:
create state parameter, freestate state parameter, mount state parameter, mounted state parameter, offload state parameter, delete state parameter, deleted state parameter.
7. The method of claim 6, wherein the network service component, after creating a plurality of virtual network cards in the virtual machine, further comprises:
the network service component receives a request for mounting the virtual network card;
the network service component responds to the mounting virtual network card request and judges whether the state parameter of the created virtual network card is the free state parameter or not;
when the state parameter is the free state parameter, the network service component mounts the created virtual network card to the virtual machine;
and when the mounting is successful, the network service component changes the state parameter of the mounted virtual network card into the mounted state parameter.
8. The method of claim 7, further comprising:
the network service component receives a request for unloading the virtual network card;
the network service component responds to the virtual network card unloading request and judges whether the created state parameter of the virtual network card is the mounted state parameter or not;
when the state parameter is the mounted state parameter, the network service component unloads the mounted virtual network card from the virtual machine;
and when the uninstallation is successful, the network service component changes the state parameters of the uninstalled virtual network card into the free state parameters.
9. The method of claim 7, further comprising:
the network service component receives a request for deleting the virtual network card;
the network service component responds to the request for deleting the virtual network card and judges whether the state parameter of the created virtual network card is the mounted state parameter or not;
when the state parameter is the mounted state parameter, the network service component deletes the mounted virtual network card from the virtual machine;
and when the deletion is successful, the network service component changes the deleted state parameter of the virtual network card into the deleted state parameter.
10. The method of any of claims 1-5, wherein the network service component, prior to setting up a plurality of virtual switch ports on the virtual switch, further comprises:
the network service component receives a request for purchasing a virtual network card;
the network service component responds to the request for purchasing the virtual network card and judges whether the media access control address of the virtual machine is enough;
when the media access control address is enough, the network service component judges whether the internet protocol address is enough;
and when the internet protocol address is enough, the network service component sends a virtual network card production instruction to the virtual machine.
11. The method of claim 10, further comprising:
after the virtual network card is produced, the network service component records a media access control address and an internet protocol address occupied by the produced virtual network card;
after the produced virtual network card is mounted to the virtual machine, the network service component stores a second mapping relation between the media access control address and the internet protocol address;
alternatively, the first and second liquid crystal display panels may be,
the network service component directly stores a second mapping relationship between the MAC address and the IP address.
12. The method of claim 1, wherein the network service component obtaining the internet protocol address dynamically assigned to the enabled virtual network card by the virtual machine comprises:
and the network service component acquires the internet protocol address dynamically allocated to the started virtual network card by the virtual machine based on a dynamic host configuration protocol.
13. The method according to any one of claims 1 to 5, wherein after establishing the network channel between the started virtual network card and the virtual switch port having the first mapping relationship with the started virtual network card, the method further comprises:
the network service component sends a client connection request through a network channel;
the network service component receives an internet protocol address configured by a client;
and when the internet protocol address is correct, the network service component communicates the virtual switch port with the started virtual network card in the first mapping relation with the network channel between the client.
14. The method of claim 13, further comprising:
and when the internet protocol address is incorrect, the network service component sends a patching instruction to the client and receives the internet protocol address configured by the client again.
15. A host machine, comprising: virtual switch, virtual machine and network service assembly, virtual switch with the virtual machine respectively with network service assembly is connected, network service assembly includes:
a port setting module, configured to set a plurality of virtual switch ports on the virtual switch;
the network card creating module is used for creating a plurality of virtual network cards in the virtual machine;
the first establishing module is used for establishing a first mapping relation between the plurality of virtual network cards and the plurality of virtual switch ports;
the channel establishing module is used for acquiring the internet protocol address dynamically allocated to the started virtual network card by the virtual machine when the virtual network card is started; and establishing a network channel between the started virtual network card and a virtual switch port having the first mapping relation with the started virtual network card based on the Internet protocol address.
16. The host machine of claim 15, wherein the web services component further comprises:
a media access control address obtaining module, configured to obtain a media access control address of the virtual machine;
the Internet protocol address configuration module is used for configuring the Internet protocol address of the virtual machine based on the media access control address;
and the second establishing module is used for establishing a second mapping relation between the internet protocol address and the media access control address.
17. The host machine of claim 15, wherein the web services component further comprises:
a port group setting module, configured to set some of the virtual switch ports in the multiple virtual switch ports as a same virtual switch port group;
and the main network card setting module is used for setting the virtual network card which has the first mapping relation with 1 virtual switch port outside the virtual switch port group as the main virtual network card.
18. The host machine of claim 17, wherein the web services component further comprises:
a flow port configuration module, configured to configure the virtual switch port group as a user flow port;
and the management port configuration module is used for configuring the virtual switch port corresponding to the main virtual network card as a management port.
19. The host machine of claim 15, wherein the web services component further comprises:
the speed parameter setting module is used for setting the speed parameter of the virtual network card;
and/or the presence of a gas in the gas,
and the bandwidth parameter setting module is used for setting the bandwidth parameters of the virtual switch port.
20. The host machine of any one of claims 15-19, wherein the web services component further comprises:
the parameter definition module is used for defining one or more than two state parameters of the virtual network card:
create state parameter, freestate state parameter, mount state parameter, mounted state parameter, offload state parameter, delete state parameter, deleted state parameter.
21. The host machine of claim 20, wherein the web services component further comprises:
the request receiving module is used for receiving a request for mounting the virtual network card;
the parameter judgment module is used for responding to the mounting virtual network card request and judging whether the created state parameter of the virtual network card is the free state parameter or not;
the network card mounting module is used for mounting the created virtual network card to the virtual machine when the state parameter is the free state parameter;
and the state changing module is used for changing the state parameter of the mounted virtual network card into the mounted state parameter when the mounting is successful.
22. The host machine of claim 21, wherein the web services component further comprises:
the request receiving module is also used for receiving a request for unloading the virtual network card;
the parameter judgment module is further configured to respond to the virtual network card uninstalling request and judge whether the created state parameter of the virtual network card is the installed state parameter;
a network card unloading module, configured to unload the mounted virtual network card from the virtual machine when the state parameter is the mounted state parameter;
and the state changing module is also used for changing the state parameters of the unloaded virtual network card into the free state parameters when the unloading is successful.
23. The host machine of claim 21, wherein the web services component further comprises:
the request receiving module is also used for receiving a request for deleting the virtual network card;
the parameter judgment module is also used for responding to the virtual network card deletion request and judging whether the created state parameter of the virtual network card is the mounted state parameter or not;
a network card unloading module, configured to delete a mounted virtual network card from the virtual machine when the status parameter is the mounted status parameter;
and the state changing module is also used for changing the deleted state parameter of the virtual network card into the deleted state parameter when the deletion is successful.
24. The host machine according to any of claims 15-19, wherein the web services component further comprises:
the order acquisition module is used for receiving a request for purchasing the virtual network card by the network service component;
the media access control address judging module is used for responding to the request for purchasing the virtual network card and judging whether the media access control address of the virtual machine is enough or not;
the internet protocol address judging module is used for judging whether the internet protocol address is enough or not when the media access control address is enough;
and the instruction sending module is used for sending a virtual network card production instruction to the virtual machine by the network service component when the internet protocol address is enough.
25. The host machine of claim 24, wherein the web services component further comprises:
the address recording module is used for recording the media access control address and the Internet protocol address occupied by the produced virtual network card after the virtual network card is produced;
the first relation storage module is used for storing a second mapping relation between the media access control address and the internet protocol address after a produced virtual network card is mounted to the virtual machine;
alternatively, the first and second liquid crystal display panels may be,
and the second relation storage module is used for directly storing the second mapping relation between the media access control address and the internet protocol address.
26. The host machine of claim 15, wherein the address fetch unit is further configured to:
and acquiring the Internet protocol address dynamically allocated to the started virtual network card by the virtual machine based on a dynamic host configuration protocol.
27. The host machine of any one of claims 15-19, wherein the web services component further comprises:
the request sending module is used for sending a request for connecting the client through a network channel;
the address receiving module is used for receiving an Internet protocol address configured by the client;
and the channel communication module is used for communicating the virtual switch port which has the first mapping relation with the started virtual network card with the network channel between the client side when the internet protocol address is correct.
28. The host machine of claim 27, further comprising:
and the patch sending module is used for sending a patching instruction to the client and re-receiving the Internet protocol address configured by the client by the network service component when the Internet protocol address is incorrect.
29. A host machine, comprising:
a memory for storing a program;
a processor for executing a program stored by the memory, the program causing the processor to perform the method of any of claims 1-14.
30. A computer-readable storage medium, comprising: there are stored instructions that, when executed, cause the computer to,
when run on a computer, cause the computer to perform the method of any one of claims 1-14.
CN201711096692.4A 2017-11-09 2017-11-09 Method for configuring multiple virtual network cards, host machine and storage medium Active CN109768871B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711096692.4A CN109768871B (en) 2017-11-09 2017-11-09 Method for configuring multiple virtual network cards, host machine and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711096692.4A CN109768871B (en) 2017-11-09 2017-11-09 Method for configuring multiple virtual network cards, host machine and storage medium

Publications (2)

Publication Number Publication Date
CN109768871A CN109768871A (en) 2019-05-17
CN109768871B true CN109768871B (en) 2022-09-16

Family

ID=66449965

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711096692.4A Active CN109768871B (en) 2017-11-09 2017-11-09 Method for configuring multiple virtual network cards, host machine and storage medium

Country Status (1)

Country Link
CN (1) CN109768871B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110198243B (en) * 2019-06-11 2021-11-19 深信服科技股份有限公司 Network access method of virtual machine and related equipment
CN112637088B (en) * 2019-09-24 2023-06-23 阿里巴巴集团控股有限公司 Network system, network processing method and device, electronic equipment and computer readable storage medium
CN112887440B (en) * 2019-11-29 2023-03-24 北京百度网讯科技有限公司 IP address management method and device
CN110830594B (en) * 2019-12-06 2022-04-01 广州微算互联信息技术有限公司 Method, system, device and storage medium for expanding IP address of cloud mobile phone
CN113709200B (en) * 2020-05-21 2023-11-28 阿里巴巴集团控股有限公司 Method and device for establishing communication connection
CN116866283A (en) * 2020-10-31 2023-10-10 华为技术有限公司 Flow table processing method and related equipment
CN112350866B (en) * 2020-11-06 2021-12-21 北京首都在线科技股份有限公司 Method, device and storage medium for processing virtual machine network card configuration information
CN112600903B (en) * 2020-12-09 2023-01-20 浪潮云信息技术股份公司 Elastic virtual network card migration method
CN112905192B (en) * 2021-02-07 2024-02-06 优刻得科技股份有限公司 Method for unloading on cloud server, control device and storage medium
CN113326104B (en) 2021-08-04 2021-10-29 苏州浪潮智能科技有限公司 Method, system and device for modifying internal configuration of virtual machine
CN114257568A (en) * 2021-12-09 2022-03-29 深圳市广和通无线股份有限公司 Data transmission method and related equipment
CN114338546A (en) * 2021-12-24 2022-04-12 中国联合网络通信集团有限公司 Virtual machine speed limiting method and device, electronic equipment and readable storage medium
CN114844744B (en) * 2022-03-04 2023-07-21 阿里巴巴(中国)有限公司 Virtual private cloud network configuration method and device, electronic equipment and computer readable storage medium
CN114928490B (en) * 2022-05-20 2023-08-15 国网江苏省电力有限公司 Multi-terminal network management and control method and device in container scene, storage medium and electronic equipment
CN115766342A (en) * 2022-11-14 2023-03-07 浪潮云信息技术股份公司 Method and system for designated tenant to share VLAN subnet
CN115987989B (en) * 2023-03-22 2023-09-26 麒麟软件有限公司 Method for expanding cloud virtual network in common system

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932174B (en) * 2012-10-25 2015-07-29 华为技术有限公司 A kind of physical network card management method, device and physical host
CN103281248B (en) * 2013-06-09 2016-03-30 北京星网锐捷网络技术有限公司 The discover method of network topology, device and system
CN103475704B (en) * 2013-09-06 2016-09-28 中国科学院计算技术研究所 A kind of method for virtual node configuration of Virtual group of planes application
CN103731514B (en) * 2013-12-29 2017-01-18 国云科技股份有限公司 Virtual network management method
CN103731308A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Virtual machine public network management method
JP5904514B1 (en) * 2014-10-28 2016-04-13 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method of automatically applying an update to a snapshot of a virtual machine, and its computer system and computer system program
CN105592016B (en) * 2014-10-29 2019-04-30 国家电网公司 The protective device of virtual machine under a kind of cloud environment of power information system
CN105657081B (en) * 2016-04-07 2019-01-18 华为技术有限公司 The method, apparatus and system of DHCP service are provided
CN107301083A (en) * 2017-06-16 2017-10-27 郑州云海信息技术有限公司 One kind creates OpenStack virtual machines method and OpenStack dummy machine systems

Also Published As

Publication number Publication date
CN109768871A (en) 2019-05-17

Similar Documents

Publication Publication Date Title
CN109768871B (en) Method for configuring multiple virtual network cards, host machine and storage medium
US9547624B2 (en) Computer system and configuration management method therefor
US9519580B2 (en) Load balancing logical units in an active/passive storage system
EP3385835B1 (en) Method and apparatus for configuring accelerator
CN109067877B (en) Control method for cloud computing platform deployment, server and storage medium
US8937940B2 (en) Optimized virtual function translation entry memory caching
CN111934918A (en) Network isolation method and device for container instances in same container cluster
US20130312055A1 (en) Security management device and method
EP3125468B1 (en) Cloud application processing method and application deployment method and relevant apparatus and system
US9910687B2 (en) Data flow affinity for heterogenous virtual machines
CA2914940A1 (en) Pre-configure and pre-launch compute resources
CN109495542B (en) Load distribution method based on performance monitoring and terminal equipment
EP3070633B1 (en) Network interface devices with remote storage control
KR20160047460A (en) Management of computing sessions
CN109857464B (en) System and method for platform deployment and operation of mobile operating system
CN112948248A (en) Method and device for debugging software in cloud computing service
US11444998B2 (en) Bit rate reduction processing method for data file, and server
US20150372854A1 (en) Communication control device, communication control program, and communication control method
CN114996750A (en) Data sharing method and device
CN114124812A (en) Method and device for maintaining consistency of table items and electronic equipment
CN109995890B (en) Method and server for managing Network Address Translation (NAT) gateway
US10977069B2 (en) Systems and methods for performing virtual machine updates without rebuild of distributed databases thereon
CN107483637B (en) NFS-based client link management method and device
CN111124593A (en) Information processing method and device, network element and storage medium
CN115185637A (en) Communication method and device for PaaS component management end and virtual machine agent

Legal Events

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

Effective date of registration: 20230614

Address after: Room 1-2-A06, Yungu Park, No. 1008 Dengcai Street, Sandun Town, Xihu District, Hangzhou City, Zhejiang Province

Patentee after: Aliyun Computing Co.,Ltd.

Address before: Grand Cayman, Cayman Islands

Patentee before: ALIBABA GROUP HOLDING Ltd.

TR01 Transfer of patent right