DHCP configuration method, device, equipment and storage medium for virtual machines

By using OVN and OVS to configure the DHCP of KVM virtual machines in the compute node, the problems of low efficiency and strong dependence of virtual machines in the existing technology are solved, and efficient and convenient DHCP configuration is achieved, reducing server consumption and abnormal risks.

CN118018524BActive Publication Date: 2025-05-09GUANGZHOU DULING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410346320.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2025-05-09
Estimated Expiration
2044-03-25

AI Technical Summary

Technical Problem

In the prior art, the DHCP configuration method of KVM virtual machines has problems such as high server pressure, delayed response speed and excessive dependence on additional agents. Especially when the number of virtual machines is large, it is difficult to achieve efficient and convenient DHCP configuration.

Method used

By using open virtual network (OVN) and virtual switch (OVS) in the compute node to configure the DHCP of the virtual machine, obtain the DHCP request of the virtual machine to be configured, perform DHCP configuration according to the network interface, and generate a DHCP response feedback to the virtual machine.

Benefits of technology

This method does not require a DHCP server to be provided separately in each VPC, which reduces the risk of server consumption and abnormal DHCP interruption, and realizes efficient and convenient DHCP configuration of virtual machine, and does not rely on third-party agents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118018524B_ABST
    Figure CN118018524B_ABST
Patent Text Reader

Abstract

The present disclosure provides a DHCP configuration method, device, equipment and storage medium for a virtual machine, which relates to the field of computer technology, in particular to the field of network and virtual machine technology, and can be used for cloud computing and cloud services. The specific implementation scheme is: obtaining a Dynamic Host Configuration Protocol DHCP request initiated by the virtual machine to be configured; the DHCP request includes the network interface of the virtual machine to be configured; according to the network interface, the DHCP of the virtual machine to be configured is configured through the open virtual network OVN and the virtual switch OVS to obtain DHCP configuration information; wherein the OVN and the OVS are respectively deployed in the computing nodes; a DHCP response is generated according to the DHCP configuration information, and the DHCP response is fed back to the virtual machine to be configured. Through the above technical scheme, the DHCP configuration efficiency of the virtual machine can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, in particular to the field of network and virtual machine technology, and can be used for cloud computing and cloud services. Background Art

[0002] When deploying virtual machines in the ARM cloud, after network virtualization is implemented, the KVM (Kernel-based Virtual Machine) virtual machine network of the computing node is an overlay network, that is, a virtual network, which is connected to the network node through a tunnel (such as vxlan) and enters and exits the physical network at the network node.

[0003] In the prior art, there are generally two ways to set network parameters such as the network card IP, gateway, domain name system (DNS) and so on of a KVM virtual machine: 1) providing a real Dynamic Host Configuration Protocol (DHCP) server for each virtual private network (VPC) or private cloud in the virtual network to perform DHCP configuration of the virtual machine; 2) setting DHCP in the KVM virtual machine through an agent in some virtual machines, such as qemu-guest-agent.

[0004] However, the above scheme has the following disadvantages: 1) The scheme based on additional DHCP server for DHCP configuration requires a separate DHCP server to be configured for each VPC, and a DHCP server must be configured for each additional virtual machine. Frequent operation of the server puts a lot of pressure on the server and consumes a lot of server resources. When the number of virtual machines is large, there is a problem of delayed server response speed. In addition, Software Defined Network (SDN) is required when configuring the DHCP server. SDN needs to be configured separately, and it is not easy to perform DHCP configuration centrally. 2) When DHCP configuration is performed through an agent in the virtual machine, a specific agent such as qemu-guest-agent needs to be deployed separately in the virtual machine, which is not standard and overly dependent on additional agents. Therefore, there is an urgent need for an efficient virtual machine DHCP configuration method. Summary of the invention

[0005] The present invention provides a DHCP configuration method, device, equipment and storage medium for a virtual machine.

[0006] According to one aspect of the present disclosure, a DHCP configuration method for a virtual machine is provided, the method comprising:

[0007] Obtaining a Dynamic Host Configuration Protocol DHCP request initiated by the virtual machine to be configured; the DHCP request includes a network interface of the virtual machine to be configured;

[0008] According to the network interface, the DHCP of the virtual machine to be configured is configured through the open virtual network OVN and the virtual switch OVS to obtain DHCP configuration information; wherein the OVN and the OVS are respectively deployed in the computing nodes;

[0009] A DHCP response is generated according to the DHCP configuration information, and the DHCP response is fed back to the virtual machine to be configured.

[0010] According to another aspect of the present disclosure, a DHCP configuration device for a virtual machine is provided, the device comprising:

[0011] A DHCP request acquisition module, used to acquire a Dynamic Host Configuration Protocol DHCP request initiated by the virtual machine to be configured; the DHCP request includes the network interface of the virtual machine to be configured;

[0012] A DHCP configuration information determination module, configured to configure the DHCP of the virtual machine to be configured through an open virtual network OVN and a virtual switch OVS according to the network interface to obtain DHCP configuration information; wherein the OVN and the OVS are respectively deployed in computing nodes;

[0013] The DHCP response feedback module is used to generate a DHCP response according to the DHCP configuration information, and feed back the DHCP response to the virtual machine to be configured.

[0014] According to another aspect of the present disclosure, there is provided an electronic device, the electronic device comprising:

[0015] at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the DHCP configuration method for the virtual machine described in any embodiment of the present disclosure.

[0018] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the DHCP configuration method for a virtual machine described in any embodiment of the present disclosure.

[0019] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements the DHCP configuration method for a virtual machine described in any embodiment of the present disclosure.

[0020] According to the technology disclosed in the present invention, the DHCP configuration efficiency of the virtual machine can be improved.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0023] Figure 1 It is a flowchart of a DHCP configuration method for a virtual machine provided according to an embodiment of the present disclosure;

[0024] Figure 2 is a flowchart of another DHCP configuration method for a virtual machine provided according to an embodiment of the present disclosure;

[0025] Figure 3A is a flowchart of another DHCP configuration method for a virtual machine provided according to an embodiment of the present disclosure;

[0026] Figure 3B It is a system component and interaction diagram of DHCP configuration of a virtual machine provided according to an embodiment of the present disclosure;

[0027] Figure 4 It is a structural diagram of a DHCP configuration device for a virtual machine provided according to an embodiment of the present disclosure;

[0028] Figure 5 It is a block diagram of an electronic device used to implement the DHCP configuration method of a virtual machine according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] In addition, it should be noted that in the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of virtual machine-related data, etc. are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0032] Figure 1 This is a flowchart of a DHCP configuration method for a virtual machine provided according to an embodiment of the present disclosure. This method is applicable to the situation of how to perform DHCP configuration on a virtual machine in a virtual network, and is particularly applicable to the situation of performing DHCP configuration on a ×86KVM virtual machine in a virtual network. This method can be executed by a DHCP configuration device for a virtual machine, which can be implemented in software and / or hardware, and can be integrated into an electronic device that carries the DHCP configuration function of the virtual machine, such as a server corresponding to a computing node, and specifically, can be a network controller of a computing node. Figure 1 As shown, the DHCP configuration method of the virtual machine in this embodiment may include:

[0033] S101, obtaining a Dynamic Host Configuration Protocol DHCP request initiated by a virtual machine to be configured.

[0034] In this embodiment, the virtual machine to be configured refers to a virtual machine that needs to be configured with DHCP; optionally, the virtual machine to be configured is a cloud phone or a Linux virtual machine; wherein the Linux virtual machine can be CentOS or Debian. Further, the virtual machine to be configured is deployed in a computing node. Optionally, the virtual machine to be configured is a newly added virtual machine in a VPC in a computing node.

[0035] The so-called DHCP request refers to a request for obtaining the DHCP of the virtual machine to be configured; optionally, the DHCP request may include a network interface of the virtual machine to be configured; wherein the network interface may be the Ethernet interface eth0 of the virtual machine to be configured.

[0036] Specifically, when a virtual machine to be configured is added in the VPC, the virtual machine to be configured initiates a DHCP request; accordingly, the flow table created in the local open virtual network (OVN) of the computing node will obtain the DHCP request.

[0037] S102, according to the network interface, configure the DHCP of the virtual machine to be configured through the open virtual network OVN and the virtual switch (Open vSwitch, OVS) to obtain DHCP configuration information.

[0038] In this embodiment, OVN and OVS are respectively deployed in computing nodes; it should be noted that the network controller agent of the computing node can connect to OVN and OVS.

[0039] The so-called DHCP configuration information refers to the DHCP information of the virtual machine to be configured. Optionally, the DHCP configuration information includes a subnet gateway IP identifier, a subnet gateway MAC, an IP validity period, a subnet gateway IP, and a DNS server. Among them, the subnet gateway IP identifier is used to uniquely identify the subnet gateway IP, such as 72.16.80.254; the subnet gateway MAC can be, for example, 02:01:00:00:f2:00; the IP validity period can be, for example, 3600; the subnet gateway IP can be, for example, 172.16.80.254), which is used to set the subnet gateway of the virtual machine to be configured; the DNS server can be, for example, 114.114.114.114, 223.5.5.5.

[0040] Specifically, based on the network interface of the virtual machine to be configured, the network controller can automatically configure the DHCP of the virtual machine to be configured in OVN and OVS, for example, the subnet gateway IP identifier, subnet gateway MAC, IP validity period, subnet gateway IP and DNS server of the virtual machine to be configured.

[0041] S103: Generate a DHCP response according to the DHCP configuration information, and feed the DHCP response back to the virtual machine to be configured.

[0042] In this embodiment, the DHCP response refers to response information to the DHCP request. Optionally, the DHCP response may include DHCP configuration information of the virtual machine to be configured.

[0043] Specifically, the DHCP configuration information may be composed into a DHCP response, and then the DHCP response may be fed back to the virtual machine to be configured through the network port vnet of the OVN logical switch.

[0044] It should be noted that DHCP requests only work locally, that is, within the computing node, and do not need to be transmitted to the physical network Gateway VTEP.

[0045] The technical solution provided by the embodiment of the present disclosure obtains a Dynamic Host Configuration Protocol DHCP request initiated by the virtual machine to be configured; the DHCP request includes the network interface of the virtual machine to be configured, and then according to the network interface, the DHCP of the virtual machine to be configured is configured through the open virtual network OVN and the virtual switch OVS to obtain DHCP configuration information; wherein OVN and OVS are respectively deployed in computing nodes, and then a DHCP response is generated according to the DHCP configuration information, and the DHCP response is fed back to the virtual machine to be configured. The above technical solution is compared with the traditional DHCP configuration, which requires providing a separate DHCP server in each VPC, which not only consumes servers, but also has the problem that DHCP configuration cannot be performed when DHCP is abnormally interrupted. The present disclosure does not need to provide a separate DHCP server in each VPC of the virtual network, and only configures the DHCP of the virtual machine in OVN and OVS through the network controller of the computing node, so that the DHCP configuration of the virtual machine is only performed locally on the computing node, and the configuration is more convenient and efficient, and there is no need to worry about the problem of DHCP server abnormalities; at the same time, compared with the traditional DHCP configuration, which requires an additional DHCP server or a specific agent to be deployed separately in the virtual machine, and is overly dependent on other third-party products, the present disclosure only needs to deploy OVN and OVS in the computing node to realize the DHCP configuration of the virtual machine in the computing node, does not rely on third-party products, and configures faster.

[0046] On the basis of the above embodiment, as an optional method of the present disclosure, an OVN logical switch may also be created in a computing node for a private cloud VPC; wherein the OVN logical switch interacts with the virtual machine to be configured.

[0047] Specifically, an OVN logical switch is created for each private cloud VPC in the computing node, and the OVN logical switch can interact with the virtual machine to be configured. Specifically, the virtual machine to be configured interacts with the OVN logical switch through the Ethernet interface eht0 of the virtual machine to be configured and the network interface vnet of the OVN logical switch.

[0048] It can be understood that by creating an OVN logical switch in the computing node to implement DHCP configuration with the virtual machine to be configured, there is no need to go through the physical gateway of the physical layer.

[0049] Figure 2 This is a flowchart of another DHCP configuration method for a virtual machine provided according to an embodiment of the present disclosure. Based on the above embodiment, this embodiment further optimizes "according to the network interface, through the open virtual network OVN and the virtual switch OVS, the DHCP of the virtual machine to be configured is configured to obtain DHCP configuration information" and provides an optional implementation scheme. Figure 2As shown, the DHCP configuration method of the virtual machine in this embodiment may include:

[0050] S201, obtaining a Dynamic Host Configuration Protocol DHCP request initiated by a virtual machine to be configured.

[0051] The DHCP request includes the network interface of the virtual machine to be configured.

[0052] S202, add the network interface to OVS.

[0053] Specifically, the network interface of the virtual machine to be configured can be added to OVS through a virtual attach device (Virsh Attach-Device), and the network interface name can be recorded as vnet.

[0054] S203, create a logical switch port for the network interface in OVN.

[0055] Specifically, in OVN, a corresponding logical switch port is created for the network interface of the virtual machine to be configured.

[0056] S204, associate the network interface with the logical switch port in OVS.

[0057] Specifically, in OVS, the network interface of the virtual machine to be configured is associated with the logical switch port in OVN, so that the virtual machine to be configured can correctly interact with the OVN logical switch.

[0058] S205: Create a DHCP configuration option in OVN and determine the DHCP information of the virtual machine to be configured.

[0059] In this embodiment, the DHCP configuration options include a subnet gateway IP identification option server_id, a subnet gateway MAC option server_mac, an IP validity time option lease_time, a subnet gateway IP option route, and a DNS server option dns_server.

[0060] Specifically, create DHCP options in OVN, set Classless InterDomain Routing (CIDR) and DHCP specific options, and then configure the DHCP information of the virtual machine to be configured in the DHCP options.

[0061] S206: Generate a DHCP response according to the DHCP configuration information, and feed the DHCP response back to the virtual machine to be configured.

[0062] An optional method is to set port attribute information of the logical switch port; and generate a DHCP response according to the logical switch port and the DHCP configuration information.

[0063] Among them, port attribute information refers to the relevant attribute information of the logical switch port; optionally, the port attribute information may include the address information and port security information of the virtual machine to be configured; wherein the address information includes the IP and MAC addresses; the port security information refers to the security information used for the logical switch port to only transmit network traffic with the virtual machine to be configured.

[0064] Specifically, the port attribute information of the logical switch port is set in OVN, and the logical switch port and DHCP configuration information are combined into a DHCP response. The DHCP response is then fed back to the virtual machine to be configured.

[0065] It can be understood that by setting the port security information of the logical switch port, it is used to limit the network traffic sent by the IP and MAC of the virtual machine to be configured that can pass through this logical switch port, preventing other lessees from manually setting other IPs and MACs.

[0066] The technical solution provided by the embodiment of the present disclosure is to obtain a Dynamic Host Configuration Protocol DHCP request initiated by the virtual machine to be configured; the DHCP request includes the network interface of the virtual machine to be configured, and then the network interface is added to OVS; a logical switch port is created for the network interface in OVN; the network interface and the logical switch port are associated in OVS; a DHCP configuration option is created in OVN, and the DHCP information of the virtual machine to be configured is determined; wherein OVN and OVS are respectively deployed in computing nodes, and then a DHCP response is generated according to the DHCP configuration information, and the DHCP response is fed back to the virtual machine to be configured. The above technical solution can improve the efficiency and convenience of virtual machine configuration by cooperating with OVS and OVN deployed in computing nodes to perform DHCP configuration of virtual machines.

[0067] Based on the above embodiment, as an optional method of the present disclosure, the logical switch port and the DHCP configuration option may also be associated in OVN.

[0068] Specifically, in OVN, logical switch ports are associated with DHCP configuration options. This allows DHCP to be specifically configured in the logical switch, thereby achieving efficiency in DHCP configuration.

[0069] Figure 3A is a flowchart of another DHCP configuration method for a virtual machine provided according to an embodiment of the present disclosure; Figure 3BIt is a system component and interaction diagram of DHCP configuration of a virtual machine provided according to an embodiment of the present disclosure. Optionally, in the ×86 physical machine, i.e., the computing node, ×86 KVM virtual machines KVM VM1, KVM VM2, KVM VM3, and KVM VM4 are deployed, and the Ethernet interface eth0 is used in the virtual machine; OVS and OVN are deployed in the ×86 physical machine respectively; private cloud VPC1 and private cloud VPC2 are deployed in the ×86 physical machine; a logical switch Logical Switch is created in each private cloud, and the port of the Logical Switch is vnet; the virtual machine interacts with the logical switch port vnet in the private cloud through the Ethernet interface eth0 for data traffic; the software switch of the private cloud VPC is VTEP L2 GW, and VTEP L2 GW interacts with the physical gateway Gateway VTEP for data.

[0070] This embodiment provides a preferred implementation scheme based on the above embodiments. Figure 3A and Figure 3B As shown, the DHCP configuration method of the virtual machine in this embodiment may include:

[0071] S301, obtaining a Dynamic Host Configuration Protocol DHCP request initiated by a virtual machine to be configured.

[0072] The DHCP request includes the network interface of the virtual machine to be configured.

[0073] S302, create an OVN logical switch for the private cloud VPC.

[0074] Specifically, create an OVN logical switch for each private cloud VPC.

[0075] S303: Add the network interface of the virtual machine to be configured to the VOS.

[0076] S304, create a logical switch port for the network interface in OVN, and set port attribute information of the logical switch port.

[0077] S305, associate the network interface with the logical switch port in OVS.

[0078] In OVS, associate the network interface eth0 of the virtual machine to be configured with the logical switch port vnet in OVN so that the virtual machine KVM VM to be configured can correctly interact with the OVN logical switch Logical Switch.

[0079] S306: Create a DHCP configuration option in OVN and determine the DHCP information of the virtual machine to be configured.

[0080] S307: Associate the logical switch port with the DHCP configuration option in OVN.

[0081] S308: Generate a DHCP response according to the logical switch port and the DHCP configuration information, and feed the DHCP response back to the virtual machine to be configured.

[0082] The technical solution provided by the embodiment of the present disclosure configures the DHCP of the virtual machine in OVN and OVS through the network controller of the computing node, so that the DHCP configuration of the virtual machine is only performed locally on the computing node, and the configuration is more convenient and efficient.

[0083] Figure 4 This is a schematic diagram of the structure of a DHCP configuration device for a virtual machine provided according to an embodiment of the present disclosure. This embodiment is applicable to the situation of how to perform DHCP configuration on a virtual machine in a virtual network, and is particularly applicable to the situation of performing DHCP configuration on a ×86KVM virtual machine in a virtual network. The device can be implemented in software and / or hardware, and can be integrated into an electronic device that carries the DHCP configuration function of the virtual machine, such as a server corresponding to a computing node, and can specifically be a network controller of the computing node. Figure 4 As shown, the DHCP configuration device 400 of the virtual machine of this embodiment may include:

[0084] The DHCP request acquisition module 401 is used to acquire a Dynamic Host Configuration Protocol DHCP request initiated by the virtual machine to be configured; the DHCP request includes the network interface of the virtual machine to be configured;

[0085] The DHCP configuration information determination module 402 is used to configure the DHCP of the virtual machine to be configured through the open virtual network OVN and the virtual switch OVS according to the network interface to obtain the DHCP configuration information; wherein the OVN and the OVS are respectively deployed in the computing nodes;

[0086] The DHCP response feedback module 403 is used to generate a DHCP response according to the DHCP configuration information, and feed back the DHCP response to the virtual machine to be configured.

[0087] The technical solution provided by the embodiment of the present disclosure obtains a Dynamic Host Configuration Protocol DHCP request initiated by the virtual machine to be configured; the DHCP request includes the network interface of the virtual machine to be configured, and then according to the network interface, the DHCP of the virtual machine to be configured is configured through the open virtual network OVN and the virtual switch OVS to obtain DHCP configuration information; wherein OVN and OVS are respectively deployed in computing nodes, and then a DHCP response is generated according to the DHCP configuration information, and the DHCP response is fed back to the virtual machine to be configured. The above technical solution is compared with the traditional DHCP configuration, which requires providing a separate DHCP server in each VPC, which not only consumes servers, but also has the problem that DHCP configuration cannot be performed when DHCP is abnormally interrupted. The present disclosure does not need to provide a separate DHCP server in each VPC of the virtual network, and only configures the DHCP of the virtual machine in OVN and OVS through the network controller of the computing node, so that the DHCP configuration of the virtual machine is only performed locally on the computing node, and the configuration is more convenient and efficient, and there is no need to worry about the problem of DHCP server abnormalities; at the same time, compared with the traditional DHCP configuration, which requires an additional DHCP server or a specific agent to be deployed separately in the virtual machine, and is overly dependent on other third-party products, the present disclosure only needs to deploy OVN and OVS in the computing node to realize the DHCP configuration of the virtual machine in the computing node, does not rely on third-party products, and configures faster.

[0088] Further, the DHCP configuration information determining module 402 is specifically configured to:

[0089] Add the network interface to OVS;

[0090] Create logical switch ports for network interfaces in OVN;

[0091] Associate the network interface with the logical switch port in OVS;

[0092] Create a DHCP configuration option in OVN and confirm the DHCP information of the VM to be configured.

[0093] Furthermore, the device also includes:

[0094] An association module that associates logical switch ports with DHCP configuration options in OVN.

[0095] Furthermore, the DHCP response feedback module 403 is specifically configured to:

[0096] Setting port attribute information of the logical switch port; wherein the port attribute information includes address information and port security information of the virtual machine to be configured;

[0097] Generates a DHCP response based on the logical switch port and DHCP configuration information.

[0098] Furthermore, the device also includes:

[0099] The logical switch creation module is used to create an OVN logical switch for the private cloud VPC in the computing node; wherein the OVN logical switch interacts with the virtual machine to be configured.

[0100] Furthermore, the DHCP configuration information includes a subnet gateway IP identifier, a subnet gateway MAC, an IP validity period, a subnet gateway IP, and a DNS server.

[0101] Furthermore, the virtual machine to be configured is deployed in the computing node; the virtual machine to be configured is a newly added virtual machine in the VPC in the computing node.

[0102] Furthermore, the virtual machine to be configured is a cloud phone or a Linux virtual machine.

[0103] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0104] Figure 5 It is a block diagram of an electronic device used to implement the DHCP configuration method of a virtual machine according to an embodiment of the present disclosure. Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0105] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0106] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0107] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a DHCP configuration method for a virtual machine. For example, in some embodiments, the DHCP configuration method for a virtual machine may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the DHCP configuration method for the virtual machine described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to execute the DHCP configuration method for the virtual machine by any other appropriate means (e.g., by means of firmware).

[0108] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0109] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0110] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0111] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0112] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0113] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0114] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.

[0115] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.

[0116] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0117] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A DHCP configuration method for a virtual machine, executed by a network controller in a computing node, comprising: Obtaining a Dynamic Host Configuration Protocol DHCP request initiated by the virtual machine to be configured; the DHCP request includes a network interface of the virtual machine to be configured; According to the network interface, the DHCP of the virtual machine to be configured is configured through the open virtual network OVN and the virtual switch OVS to obtain DHCP configuration information, including: adding the network interface to the OVS; creating a logical switch port for the network interface in the OVN; associating the network interface with the logical switch port in the OVS; creating a DHCP configuration option in the OVN, and determining the DHCP information of the virtual machine to be configured; wherein the OVN and the OVS are respectively deployed in computing nodes; A DHCP response is generated according to the DHCP configuration information, and the DHCP response is fed back to the virtual machine to be configured.

2. The method according to claim 1, wherein: Also includes: Associating the logical switch port with the DHCP configuration option in the OVN.

3. The method according to claim 1, wherein: Generating a DHCP response according to the DHCP configuration information includes: Setting port attribute information of the logical switch port; wherein the port attribute information includes address information and port security information of the virtual machine to be configured; A DHCP response is generated according to the logical switch port and the DHCP configuration information.

4. The method according to claim 1, wherein: Also includes: An OVN logical switch is created in a computing node for a private cloud VPC; wherein the OVN logical switch interacts with the virtual machine to be configured.

5. The method according to any one of claims 1 to 4, wherein: The DHCP configuration information includes the subnet gateway IP identifier, subnet gateway MAC, IP validity period, subnet gateway IP and DNS server.

6. The method according to any one of claims 1 to 4, wherein: The virtual machine to be configured is deployed in the computing node; the virtual machine to be configured is a newly added virtual machine in the VPC in the computing node.

7. The method according to any one of claims 1 to 4, wherein: The virtual machine to be configured is a cloud phone or a Linux virtual machine.

8. A DHCP configuration device for a virtual machine, executed by a network controller in a computing node, comprising: A DHCP request acquisition module is used to acquire a Dynamic Host Configuration Protocol DHCP request initiated by the virtual machine to be configured; The DHCP request includes the network interface of the virtual machine to be configured; A DHCP configuration information determination module is used to configure the DHCP of the virtual machine to be configured through the open virtual network OVN and the virtual switch OVS according to the network interface to obtain the DHCP configuration information, including: adding the network interface to the OVS; creating a logical switch port for the network interface in the OVN; associating the network interface with the logical switch port in the OVS; creating a DHCP configuration option in the OVN, and determining the DHCP information of the virtual machine to be configured; wherein the OVN and the OVS are respectively deployed in computing nodes; The DHCP response feedback module is used to generate a DHCP response according to the DHCP configuration information, and feed back the DHCP response to the virtual machine to be configured.

9. The device according to claim 8, wherein: The device also includes: An association module is used to associate the logical switch port with the DHCP configuration option in the OVN.

10. The device according to claim 8, wherein: The DHCP response feedback module is specifically used to: Setting port attribute information of the logical switch port; wherein the port attribute information includes address information and port security information of the virtual machine to be configured; A DHCP response is generated according to the logical switch port and the DHCP configuration information.

11. The device according to claim 8, wherein: The device also includes: A logical switch creation module is used to create an OVN logical switch for a private cloud VPC in a computing node; wherein the OVN logical switch interacts with the virtual machine to be configured.

12. The device according to any one of claims 8 to 11, wherein: The DHCP configuration information includes the subnet gateway IP identifier, subnet gateway MAC, IP validity period, subnet gateway IP and DNS server.

13. The device according to any one of claims 8 to 11, wherein: The virtual machine to be configured is deployed in the computing node; the virtual machine to be configured is a newly added virtual machine in the VPC in the computing node.

14. The device according to any one of claims 8 to 11, wherein: The virtual machine to be configured is a cloud phone or a Linux virtual machine.

15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the DHCP configuration method for a virtual machine according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the DHCP configuration method for a virtual machine according to any one of claims 1-7.

17. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the DHCP configuration method for a virtual machine according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for realizing multiple network planes of kubernetes container

    CN113127152A

  • Method for configuring seven-layer load balancing for OVN architecture, OVN architecture load balancing control method and medium

    CN113572856A