A network configuration method and apparatus
By setting up a Windows service module in the DC controller, the network resources of virtual machines (VMs) in the data center network are automatically configured, solving the problems of cumbersome configuration and frequent errors in the existing technology, and realizing simplified and more accurate network configuration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2022-06-27
- Publication Date
- 2026-07-03
Smart Images

Figure CN115277389B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a network configuration method and apparatus. Background Technology
[0002] Currently, in data center networks, to ensure that virtual machines (VMs) on physical hosts in the network can come online normally, administrators typically need to manually configure the corresponding network resource information on both the data center (DC) controller side and the virtual management module side of the management server. For example, on the DC controller side, they need to manually configure the Virtual eXtensible Local Access Network (VXLAN) to which the VMs used by the tenants belong, and on the virtual management module side of the management server, they need to configure the relevant logical switches, uplink port configuration files, logical networks, network sites, VM networks, etc. The configuration process is quite cumbersome and prone to configuration errors. Summary of the Invention
[0003] To overcome the problems existing in related technologies, this application provides a network configuration method and apparatus.
[0004] According to a first aspect of the embodiments of this application, a network configuration method is provided, the method being applied to a DC controller, the method comprising:
[0005] Establish a communication connection with the target management server based on the device information of the target management server stored locally;
[0006] Upon receiving a first configuration command from the administrator for configuring a target logical switch, the system generates a target file name for the target uplink port configuration file that needs to be configured when configuring the target logical switch, based on the target device name of the target logical switch carried in the first configuration command. It also generates a first configuration request carrying the target device name, a second configuration request carrying the target file name, and a third configuration request carrying both the target device name and the target file name. These requests are then sequentially sent to the target management server. This allows the target management server to configure the target logical switch with the target device name (as specified in the command) on a virtual management module within the server using a Windows service module when it receives the first configuration request. Upon receiving the second configuration request, it configures the target uplink port configuration file with the target file name on the virtual management module using the Windows service module. Finally, upon receiving the third configuration request, it binds the target logical switch and the target uplink port configuration file on the virtual management module using the Windows service module.
[0007] When receiving the second configuration instruction input by the administrator for configuring the target VM network corresponding to the target logical switch for VMs to go online, determine whether the target device name carried in the second configuration instruction is recorded locally;
[0008] If the determination result is negative, based on the UUID of the target VXLN network carried in the second configuration instruction and the target device name recorded locally, a first network name of the target logical network to be configured when configuring the target VM network and a target site identifier of the target network site are generated. A fourth configuration request carrying the first network name, a fifth configuration request carrying the first network name, the target site identifier, the target subnet segment information and the target VLAN identifier carried in the second configuration instruction, a sixth configuration request carrying the target site identifier, the target subnet information, the target VLAN identifier, and the second network name of the target VM network carried in the second configuration instruction, and a seventh configuration request carrying the target site identifier and the target file name are generated. The fourth, fifth, sixth, and seventh configuration requests are sent sequentially to the target management server so that when the target management server receives the fourth configuration request, it uses the Windows... The Windows service module configures the target logical network with the first network name on the virtual management module. When receiving the fifth configuration request, the Windows service module configures the target network site on the target logical network on the virtual management module with the site identifier as the target site identifier, the network segment information of the corresponding subnet as the target network segment information, and the VLAN identifier of the corresponding subnet as the target VLAN identifier. When receiving the sixth configuration request, the Windows service module configures the target VM network with the second network name on the virtual management module using the target network segment information and the target VLAN identifier of the target subnet corresponding to the target network site. When receiving the seventh configuration request, the Windows service module binds the target network site and the target uplink port configuration file on the virtual management module so that the administrator can configure the target virtual machines that need to be online on the target VM network.
[0009] When the determination result is yes, an update request is generated, carrying the site identifier of the network site corresponding to the target logical switch corresponding to the target device name recorded locally, the target subnet segment information and target VLAN identifier carried in the second configuration instruction, and an eighth configuration request carrying the site identifier, the target subnet segment information, the target VLAN identifier and the second network name of the target VM network carried in the second configuration instruction. The update request and the eighth configuration request are sent to the target management server in sequence, so that when the target management server receives the update request, it updates the subnet segment information and VLAN identifier of the network site corresponding to the site identifier on the virtual management module through the Windows service module. When it receives the eighth configuration request, it configures the target VM network with the second network name on the virtual management module using the target subnet segment information and target VLAN identifier of the target subnet corresponding to the network site, so that the administrator can configure the target virtual machines that need to be online on the target VM network.
[0010] According to a second aspect of the embodiments of this application, a network configuration apparatus is provided, the apparatus being applied to a DC controller, the apparatus comprising:
[0011] The module is used to establish a communication connection with the target management server based on the device information of the target management server stored locally.
[0012] The first configuration module is configured to, upon receiving a first configuration instruction from an administrator for configuring a target logical switch, generate a target file name for the target uplink port configuration file to be configured when configuring the target logical switch, based on the target device name of the target logical switch carried in the first configuration instruction, and generate a first configuration request carrying the target device name, a second configuration request carrying the target file name, and a third configuration request carrying the target device name and the target file name. The first configuration request, the second configuration request, and the third configuration request are then sent sequentially to the target management server. This allows the target management server, upon receiving the first configuration request, to configure the target logical switch with the device name of the target device name on a virtual management module set up in the target management server via a Windows service module within itself. Upon receiving the second configuration request, it configures the target uplink port configuration file with the target file name on the virtual management module via the Windows service module. Upon receiving the third configuration request, it binds the target logical switch and the target uplink port configuration file on the virtual management module via the Windows service module.
[0013] The judgment module is used to determine whether the target device name carried in the second configuration instruction is recorded locally when it receives the second configuration instruction input by the administrator for configuring the target VM network corresponding to the target logical switch for VMs to go online.
[0014] The second configuration module is used to, when the judgment result of the judgment module is negative, generate, based on the UUID of the target VXLN network carried in the second configuration instruction and the target device name recorded locally, a first network name of the target logical network to be configured when configuring the target VM network and a target site identifier of the target network site, and generate a fourth configuration request carrying the first network name, a fifth configuration request carrying the first network name, the target site identifier, the target subnet segment information and the target VLAN identifier carried in the second configuration instruction, a sixth configuration request carrying the target site identifier, the target subnet information, the target VLAN identifier and the second network name of the target VM network carried in the second configuration instruction, and a seventh configuration request carrying the target site identifier and the target file name, and sequentially send the fourth configuration request, the fifth configuration request, the sixth configuration request and the seventh configuration request to the target management server, so that the target management server, upon receiving the fourth configuration request, can... The Windows service module configures the target logical network with the first network name on the virtual management module. When the fifth configuration request is received, the Windows service module configures the target network site on the target logical network on the virtual management module with the site identifier as the target site identifier, the network segment information of the corresponding subnet as the target network segment information, and the VLAN identifier of the corresponding subnet as the target VLAN identifier. When the sixth configuration request is received, the Windows service module configures the target VM network with the second network name on the virtual management module using the target network segment information and the target VLAN identifier of the target subnet corresponding to the target network site. When the seventh configuration request is received, the Windows service module binds the target network site and the target uplink port configuration file on the virtual management module so that the administrator can configure the target virtual machines that need to be online on the target VM network.
[0015] The third configuration module is used to generate, when the judgment result of the judgment module is yes, a site identifier of the network site corresponding to the target logical switch corresponding to the target device name recorded locally, an update request for the target subnet's target network segment information and target VLAN identifier carried in the second configuration instruction, and an eighth configuration request for the second network name of the target VM network carried in the second configuration instruction. The update request and the eighth configuration request are then sent to the target management server sequentially. Upon receiving the update request, the target management server updates the network segment information and VLAN identifier of the subnet corresponding to the site identifier on the virtual management module through the Windows service module. Upon receiving the eighth configuration request, the Windows service module configures the target VM network with the second network name on the virtual management module using the target network segment information and target VLAN identifier of the target subnet corresponding to the network site. This allows the administrator to configure the target virtual machines that need to be online on the target VM network.
[0016] The technical solutions provided by the embodiments of this application may include the following beneficial effects:
[0017] In this embodiment of the application, within a data center network, a Windows service module is configured in the management server. The DC controller establishes a communication connection with the corresponding management server based on the device information of the locally configured management server. Through the Windows service module of the corresponding management server, the relevant network resources of the VM network that the virtual machine needs to access are configured on the virtual management module within the management server. This simplifies the configuration process and improves configuration accuracy.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this application, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] Figure 1 A flowchart illustrating a network configuration method provided in an embodiment of this application;
[0021] Figure 2 A schematic diagram of the architecture of a data center network provided in an embodiment of this application;
[0022] Figure 3This is a schematic diagram of the structure of a network configuration device provided in an embodiment of this application;
[0023] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0024] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0025] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0026] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if” or “suppose” as used herein may be interpreted as “when…” or “when…”.
[0027] The embodiments of this application will now be described in detail.
[0028] This application provides a network configuration method, which is applied to a DC controller, such as... Figure 1 As shown, the method may include the following steps:
[0029] S11. Establish a communication connection with the target management server based on the device information of the target management server stored locally.
[0030] S12. Upon receiving the first configuration command input by the administrator for configuring the target logical switch, based on the target device name of the target logical switch carried in the first configuration command, generate the target file name of the target uplink port configuration file that needs to be configured when configuring the target logical switch, and generate a first configuration request carrying the target device name, a second configuration request carrying the target file name, and a third configuration request carrying both the target device name and the target file name. Send the first, second, and third configuration requests to the target management server in sequence. This allows the target management server to configure the target logical switch with the target device name on the virtual management module set in the target management server through its own Windows service module when receiving the first configuration request; to configure the target uplink port configuration file with the target file name on the virtual management module through the Windows service module when receiving the second configuration request; and to bind the target logical switch and the target uplink port configuration file on the virtual management module through the Windows service module when receiving the third configuration request.
[0031] S13. When receiving the second configuration instruction from the administrator for configuring the target VM network corresponding to the target logical switch for virtual machines (VMs) to go online, determine whether the target device name carried in the second configuration instruction is recorded locally; if the determination result is no, execute step S14; if the determination result is yes, execute step S15.
[0032] S14. Based on the Universally Unique Identifier (UUID) of the target VXLN network carried in the second configuration instruction and the locally recorded target device name, determine the first network name of the target logical network and the target site identifier of the target network site that need to be configured when configuring the target VM network. Generate a fourth configuration request carrying the first network name, a fifth configuration request carrying the first network name, the target site identifier, the target subnet segment information and the target VLAN identifier carried in the second configuration instruction, a sixth configuration request carrying the target site identifier, target subnet segment information, the target VLAN identifier, and the second network name of the target VM network carried in the second configuration instruction, and a seventh configuration request carrying the target site identifier and the target file name. Send the fourth, fifth, sixth, and seventh configuration requests sequentially to the target management server so that when the target management server receives the fourth configuration request, it can... The Windows service module configures a target logical network with the first network name on the virtual management module. Upon receiving the fifth configuration request, the Windows service module configures a target network site on the target logical network on the virtual management module with the site identifier as the target site identifier, the corresponding subnet segment information as the target subnet information, and the corresponding subnet VLAN identifier as the target VLAN identifier. Upon receiving the sixth configuration request, the Windows service module configures a target VM network with the second network name on the virtual management module using the target subnet segment information and target VLAN identifier corresponding to the target network site. Upon receiving the seventh configuration request, the Windows service module binds the target network site and the target uplink port configuration file on the virtual management module so that the administrator can configure the target virtual machines that need to be online on the target VM network.
[0033] In this step, the target VLAN identifier can specifically be the target VLAN ID.
[0034] S15. Generate an update request for the network site corresponding to the target logical switch corresponding to the target device name with local records, as well as the target subnet segment information and target VLAN identifier carried in the second configuration instruction, and an eighth configuration request for the second network name of the target VM network carried in the second configuration instruction, and send the update request and the eighth configuration request to the target management server in sequence. When the target management server receives the update request, it updates the subnet segment information and VLAN identifier of the network site corresponding to the network site with the site identifier on the virtual management module through the Windows service module. When it receives the eighth configuration request, it configures the target VM network with the second network name on the virtual management module using the target subnet segment information and target VLAN identifier of the network site corresponding to the target VM network with the target subnet corresponding to the network site, through the Windows service module, so that the administrator can configure the target virtual machines that need to be online on the target VM network.
[0035] It should be noted that, in this embodiment of the application, the data center network to which the DC controller belongs may only include one management server (i.e., the aforementioned target management server), for example, such as Figure 2 As shown, Figure 2 It may also include other network devices not shown; it may also include multiple management servers, each of which is equipped with a Windows service module and a virtual management module, and in this case, the target management server may be one of these management servers.
[0036] Specifically, in step S11 above, the DC controller can establish a communication connection with the target management server in the following ways:
[0037] Send a Secure Hyper Text Transfer Protocol (HTTPS) connection request to the target management server. The HTTPS connection request carries information such as the target management server's IP address, username, and password.
[0038] Upon receiving an HTTPS connection response from the target management server, it is determined that a communication connection has been successfully established with the target management server. This HTTPS connection response is sent by the target management server after successfully logging into itself using a username and password through the Windows service module.
[0039] In step S12 above, the DC controller can generate the target file name of the target uplink port configuration file that needs to be configured when configuring the target logical switch in the following way:
[0040] Generate a UUID for the target logical switch corresponding to the target device name;
[0041] According to the preset first concatenation rule, the target device name and the generated UUID are concatenated to obtain the target file name of the target uplink port configuration file required to configure the target logical switch.
[0042] Here, the aforementioned preset first splicing rule can be set according to the administrator's actual configuration needs and is stored in advance on the DC controller.
[0043] In one example, the first pre-defined concatenation rule could be to concatenate the target device name and the generated UUID together and separate them with a specified delimiter (e.g., " / ", "-", etc.). For example, assuming the target logical switch is named switch1, and the DC controller generates the UUID for the target logical switch as 9ce86d19-42f7-4114-949f-7d2a3a7dc636, in this case, the target file name of the corresponding target uplink port configuration file could be switch1_9ce86d19-42f7-4114-949f-7d2a3a7dc636.
[0044] Of course, the preset first splicing rule can also be other content, which will not be listed here.
[0045] It should be noted that after the DC controller completes step S12 above, the target management server configures a target uplink port configuration file (named after the target file name, with empty content) on its own virtual management module via a Windows service module. This allows administrators to manually populate the relevant information when binding virtual machines to the corresponding VM network on the virtual management module. The content required for manual binding of virtual machines to the corresponding VM network and the subsequent virtual machine deployment process are existing technologies and will not be detailed here.
[0046] It should be further noted that, for the DC controller, if the determination result is negative after executing step S13, this indicates that the second configuration command carrying the target device name is being received by the DC controller for the first time; and this second configuration command was entered by the administrator after confirming the target device name recorded by the DC controller itself. Here, the target device name recorded locally by the DC controller is the name recorded by the DC controller when it receives the first configuration command.
[0047] If the determination result is yes, it means that the DC controller had already received a configuration instruction carrying the target device name before receiving the second configuration instruction carrying the target device name, and had already recorded the target device name. This situation can be understood as the administrator needing the DC controller to continue configuring the VM network of the network site corresponding to the shared target logical switch.
[0048] Specifically, in step S14 above, the DC controller can generate the first network name of the target logical network and the target site identifier of the target network site that need to be configured when configuring the target VM network in the following way:
[0049] According to the preset second splicing rule, the network identifier of the target VXLN network carried in the second configuration instruction and the target device name recorded locally are spliced to obtain the first network name and the target site identifier.
[0050] It should be noted that the aforementioned preset second splicing rule can also be set according to the administrator's actual configuration needs and is stored in advance on the DC controller.
[0051] Here, the aforementioned preset second splicing rule can be the same as or different from the aforementioned preset first splicing rule.
[0052] In step S15 above, after the DC controller sends the update request to the target manager, the target manager will update the subnet information and VLAN identifier of the network site corresponding to the target logical switch on the virtual management module through the Windows service module. That is, the target subnet information and target VLAN identifier of the target subnet carried in the update request are added for this network site.
[0053] It should be further noted that, in the embodiments of this application, when the target management server receives any one of the following requests: first configuration request, second configuration request, third configuration request, fourth configuration request, fifth configuration request, sixth configuration request, seventh configuration request, update request, eighth configuration request, query request, retrieval request, and configuration repair request, it calls the PowerShell command corresponding to the request through the Windows service module to perform the relevant operations required on the virtual management module.
[0054] Furthermore, in this embodiment of the application, in order to facilitate the administrator's management of the relevant network resources of the VM network, the DC controller may also perform the following operations:
[0055] When a query command is received from the administrator to query the online information of online VMs on the target VM network, a query request is generated to query the online information of online VMs on the target VM network according to the query command.
[0056] The query request is sent to the target management server so that when the target management server receives the query request, it can query the online information of the online VMs on the target VM network from the virtual management module through the Windows service module.
[0057] When a query response is received from the target management server via the Windows service module in response to a query request, the online information of the online VMs on the target VM network carried in the query response is displayed to the administrator.
[0058] Furthermore, in this embodiment of the application, in order to ensure the integrity and accuracy of the relevant VM network configuration so that the relevant VMs can operate normally, the DC controller may also perform the following operations:
[0059] Upon receiving the configuration comparison command input by the administrator, a request to obtain object information of multiple specified objects is sent to the target management server, so that the target management server can obtain the object information of all specified objects from the virtual management module through the Windows service module when it receives the request.
[0060] When a response to a request is received from the target management server via the Windows service module, the object information of all specified objects in the response is compared with the object information of all specified objects in the local records, and the comparison result is displayed to the administrator.
[0061] If a configuration repair command is received from the administrator based on the comparison results, a modification request is generated carrying the object information of the specified object that needs to be repaired as determined by the DC controller with local records. The configuration repair request is then sent to the target management server so that when the target management server receives the configuration repair request, it can use the Windows service module to repair the object information of the specified object that needs to be repaired in the virtual management module to the object information of the specified object that needs to be repaired carried in the configuration repair request.
[0062] Among them, all the specified objects include each logical switch, the uplink port configuration file corresponding to each logical switch, the logical network corresponding to each logical switch, the network site on each logical network, and each VM network;
[0063] The object information for all specified objects includes the device name of each logical switch, the file name of the uplink port configuration file corresponding to each logical switch, the network name of the logical network corresponding to each logical switch, the site identifier of the network site on each logical network and the network segment information and VLAN identifier of the corresponding subnet on each logical network, and the network name of each VM network and the network segment information and VLAN identifier of the subnet corresponding to the network site used by each VM network.
[0064] In this operation process, if the object information of all specified objects in the obtained response is completely consistent with the object information of all specified objects recorded locally, the comparison result can be presented as "no configuration error"; if the object information of all specified objects in the obtained response is not completely consistent with the object information of all specified objects recorded locally, the comparison result can be presented as "configuration error".
[0065] Of course, the above comparison results can also be presented in other ways, which will not be listed here.
[0066] In addition, in this operation process, the specified object that needs to be repaired is determined by the DC controller by comparing the object information of all specified objects in the obtained response with the object information of all specified objects recorded locally.
[0067] It should be noted that, in this embodiment of the application, in order to improve the security of VM network configuration, the target management server can carry a token in the HTTPS connection response sent to the DC controller. The DC controller will then record the token and carry it when sending the first configuration request, second configuration request, third configuration request, fourth configuration request, fifth configuration request, sixth configuration request, seventh configuration request, update request, eighth configuration request, query request, retrieval request, and configuration repair request. In this way, when the target management server receives these requests, it will first verify the legitimacy of these requests based on the token through the Windows service module. If the verification is successful, it will then perform the subsequent related operations.
[0068] Here, the token can be obtained by the target management server using the Windows service module to sign the aforementioned username and password using the JWT (JSON Web Token) algorithm. In this scenario, when the target management server receives any of the above requests, it first obtains the aforementioned username and password through the Windows service module based on the token carried in the request, and then uses the aforementioned username and password to log in to itself through the Windows service module. If the login is successful, the request is considered legitimate; otherwise, it is considered illegitimate and discarded.
[0069] In addition, in this embodiment of the application, after the DC controller sends the first configuration request, the second configuration request, the third configuration request, the fourth configuration request, the fifth configuration request, the sixth configuration request, the seventh configuration request, the update request, and the eighth configuration request to the target management server, it will subsequently receive the corresponding request response from the target management server through the Windows service module indicating that the relevant operations have been completed, and generate and output the corresponding logs based on the corresponding request response so that the administrator can understand the configuration status in a timely manner.
[0070] As can be seen from the above technical solutions, in this embodiment of the application, in the data center network, by setting a Windows service module in the management server, the DC controller establishes a communication connection with the corresponding management server based on the device information of the locally configured management server, and through the Windows service module of the corresponding management server, configures the relevant network resources of the VM network that the virtual machine needs to go online on the virtual management module in the management server. In this way, the configuration process is simplified and the configuration accuracy is improved.
[0071] Based on the same inventive concept, this application also provides a network configuration device, which is applied to a DC controller, and its structural schematic diagram is shown below. Figure 3 As shown, it specifically includes:
[0072] Establishment module 31 is used to establish a communication connection with the target management server based on the device information of the target management server stored locally;
[0073] The first configuration module 32 is configured to, upon receiving a first configuration instruction input by an administrator for configuring a target logical switch, generate a target file name for the target uplink port configuration file to be configured when configuring the target logical switch, based on the target device name of the target logical switch carried in the first configuration instruction, and generate a first configuration request carrying the target device name, a second configuration request carrying the target file name, and a third configuration request carrying the target device name and the target file name, and sequentially send the first configuration request, the second configuration request, and the third configuration request to the target management server, so that when the target management server receives the first configuration request, it configures the target logical switch with the device name of the target device name on the virtual management module set in the target management server through the Windows service module set in itself; when it receives the second configuration request, it configures the target uplink port configuration file with the target file name on the virtual management module through the Windows service module; and when it receives the third configuration request, it binds the target logical switch and the target uplink port configuration file on the virtual management module through the Windows service module.
[0074] The judgment module 33 is used to determine whether the target device name carried in the second configuration instruction is recorded locally when it receives the second configuration instruction input by the administrator for configuring the target VM network corresponding to the target logical switch for virtual machines (VMs) to go online.
[0075] The second configuration module 34 is configured to, when the judgment result of the judgment module 33 is negative, generate, based on the universally unique identifier (UUID) of the target VXLN network carried in the second configuration instruction and the locally recorded target device name, generate a first network name of the target logical network to be configured when configuring the target VM network and a target site identifier of the target network site, and generate a fourth configuration request carrying the first network name, a fifth configuration request carrying the first network name, the target site identifier, the target subnet segment information and the target VLAN identifier carried in the second configuration instruction, a sixth configuration request carrying the target site identifier, the target subnet information and the target VLAN identifier carried in the second configuration instruction, and a seventh configuration request carrying the target site identifier and the target file name, and sequentially send the fourth configuration request, the fifth configuration request, the sixth configuration request and the seventh configuration request to the target management server, so that the target management server, upon receiving the fourth configuration request, will... When a configuration request is received, the Windows service module configures the target logical network with the network name of the first network name on the virtual management module. When the fifth configuration request is received, the Windows service module configures the target network site on the target logical network on the virtual management module with the site identifier of the target site identifier, the network segment information of the corresponding subnet as the target network segment information, and the VLAN identifier of the corresponding subnet as the target VLAN identifier. When the sixth configuration request is received, the Windows service module configures the target VM network with the network name of the second network name on the virtual management module using the target network segment information and the target VLAN identifier of the target subnet corresponding to the target network site. When the seventh configuration request is received, the Windows service module binds the target network site and the target uplink port configuration file on the virtual management module so that the administrator can configure the target virtual machine that needs to be online on the target VM network.
[0076] The third configuration module 35 is configured to, when the judgment result of the judgment module 33 is yes, generate an update request carrying the site identifier of the network site corresponding to the target logical switch corresponding to the target device name recorded locally, the target subnet segment information and target VLAN identifier carried in the second configuration instruction, and an eighth configuration request carrying the site identifier, the target subnet information, the target VLAN identifier and the second network name of the target VM network carried in the second configuration instruction, and sequentially send the update request and the eighth configuration request to the target management server, so that when the target management server receives the update request, it updates the subnet segment information and VLAN identifier of the network site corresponding to the site identifier on the virtual management module through the Windows service module, and when it receives the eighth configuration request, it configures the target VM network with the second network name on the virtual management module using the target subnet segment information and target VLAN identifier of the target subnet corresponding to the network site, so that the administrator can configure the target virtual machines that need to be online on the target VM network.
[0077] Preferably, the establishment module 31 is specifically used to establish a communication connection with the target management server in the following ways:
[0078] Send a Hypertext Transfer Protocol (HTTPS) connection request to the target management server, wherein the HTTPS connection request carries the IP address, username, and password of the target management server;
[0079] Upon receiving an HTTPS connection response from the target management server via the Windows service module, it is determined that a communication connection has been successfully established with the target management server. The HTTPS connection response is sent by the target management server after successfully logging in to itself using the username and password via the Windows service module.
[0080] Preferably, the first configuration module 32 is specifically used to generate the target file name of the target uplink port configuration file that needs to be configured when configuring the target logical switch in the following manner:
[0081] Generate a UUID for the target logical switch corresponding to the target device name;
[0082] According to the preset first concatenation rule, the target device name and the generated UUID are concatenated to obtain the target file name of the target uplink port configuration file required to configure the target logical switch.
[0083] Preferably, the second configuration module 34 is specifically used to generate the first network name of the target logical network and the target site identifier of the target network site that need to be configured when configuring the target VM network in the following manner:
[0084] According to the preset second splicing rule, the network identifier of the target VXLN network carried in the second configuration instruction and the target device name recorded locally are spliced together to obtain the first network name and the target site identifier.
[0085] Preferably, the device further includes:
[0086] Query module ( Figure 3 (not shown in the image), is used to generate a query request for querying the online information of online VMs on the target VM network according to the query instruction input by the administrator when the administrator inputs a query instruction for querying the online information of online VMs on the target VM network.
[0087] The query request is sent to the target management server, so that when the target management server receives the query request, it queries the online information of the online VMs on the target VM network from the virtual management module through the Windows service module;
[0088] Upon receiving a query response from the target management server via the Windows service module in response to the query request, the administrator is shown the online information of the online VMs on the target VM network carried in the query response.
[0089] Preferably, the device further includes:
[0090] Comparison and repair module ( Figure 3 (Not shown in the image), is used to send a request to the target management server to obtain object information of multiple specified objects when receiving the configuration comparison instruction input by the administrator, so that when the target management server receives the request, it can obtain the object information of all specified objects from the virtual management module through the Windows service module;
[0091] Upon receiving the acquisition response from the target management server via the Windows service module in response to the acquisition request, the object information of all specified objects in the acquisition response is compared with the object information of all specified objects in the local records, and the comparison result is displayed to the administrator.
[0092] If a configuration repair instruction is received from the administrator based on the comparison result, a modification request is generated carrying the object information of the specified object that needs to be repaired as determined by the DC controller with local records. The configuration repair request is then sent to the target management server so that when the target management server receives the configuration repair request, it uses the Windows service module on the virtual management module to repair the object information of the specified object that needs to be repaired to the object information of the specified object that needs to be repaired carried in the configuration repair request.
[0093] Among them, all the specified objects include each logical switch, the uplink port configuration file corresponding to each logical switch, the logical network corresponding to each logical switch, the network site on each logical network, and each VM network;
[0094] The object information for all specified objects includes the device name of each logical switch, the file name of the uplink port configuration file corresponding to each logical switch, the network name of the logical network corresponding to each logical switch, the site identifier of the network site on each logical network and the network segment information and VLAN identifier of the corresponding subnet on each logical network, and the network name of each VM network and the network segment information and VLAN identifier of the subnet corresponding to the network site used by each VM network.
[0095] As can be seen from the above technical solutions, in this embodiment of the application, in the data center network, by setting a Windows service module in the management server, the DC controller establishes a communication connection with the corresponding management server based on the device information of the locally configured management server, and through the Windows service module of the corresponding management server, configures the relevant network resources of the VM network that the virtual machine needs to go online on the virtual management module in the management server. In this way, the configuration process is simplified and the configuration accuracy is improved.
[0096] This application also provides an electronic device, such as... Figure 4 As shown, it includes a processor 41 and a machine-readable storage medium 42, the machine-readable storage medium 42 storing machine-executable instructions that can be executed by the processor 41, the processor 41 being prompted by the machine-executable instructions to implement the steps of the above-described network configuration method.
[0097] The aforementioned machine-readable storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the machine-readable storage medium may also be at least one storage device located remotely from the aforementioned processor.
[0098] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0099] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described network configuration method.
[0100] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A network configuration method, characterized in that, The method is applied to a data center DC controller, and the method includes: Establish a communication connection with the target management server based on the device information of the target management server stored locally; Upon receiving a first configuration command from the administrator for configuring a target logical switch, the system generates a target file name for the target uplink port configuration file that needs to be configured when configuring the target logical switch, based on the target device name of the target logical switch carried in the first configuration command. It also generates a first configuration request carrying the target device name, a second configuration request carrying the target file name, and a third configuration request carrying both the target device name and the target file name. These requests are then sequentially sent to the target management server. This allows the target management server to configure the target logical switch with the target device name (as specified in the command) on a virtual management module within the server using a Windows service module when it receives the first configuration request. Upon receiving the second configuration request, it configures the target uplink port configuration file with the target file name on the virtual management module using the Windows service module. Finally, upon receiving the third configuration request, it binds the target logical switch and the target uplink port configuration file on the virtual management module using the Windows service module. When receiving the second configuration instruction input by the administrator for configuring the target VM network corresponding to the target logical switch for virtual machines (VMs) to go online, determine whether the target device name carried in the second configuration instruction is recorded locally; If the determination result is negative, based on the Universally Unique Identifier (UUID) of the target VXLN network carried in the second configuration instruction and the locally recorded target device name, a first network name of the target logical network and a target site identifier of the target network site that need to be configured when configuring the target VM network are generated. A fourth configuration request carrying the first network name, a fifth configuration request carrying the first network name, the target site identifier, the target subnet segment information and the target VLAN identifier carried in the second configuration instruction, a sixth configuration request carrying the target site identifier, the target subnet segment information, the target VLAN identifier, and the second network name of the target VM network carried in the second configuration instruction, and a seventh configuration request carrying the target site identifier and the target file name are generated. The fourth, fifth, sixth, and seventh configuration requests are sent sequentially to the target management server so that when the target management server receives the fourth configuration request, it can use the W... The Windows service module configures the target logical network with the first network name on the virtual management module. When receiving the fifth configuration request, the Windows service module configures the target network site on the target logical network on the virtual management module with the site identifier as the target site identifier, the network segment information of the corresponding subnet as the target network segment information, and the VLAN identifier of the corresponding subnet as the target VLAN identifier. When receiving the sixth configuration request, the Windows service module configures the target VM network with the second network name on the virtual management module using the target network segment information and the target VLAN identifier of the target subnet corresponding to the target network site. When receiving the seventh configuration request, the Windows service module binds the target network site and the target uplink port configuration file on the virtual management module so that the administrator can configure the target virtual machines that need to be online on the target VM network. When the determination result is yes, an update request is generated, carrying the site identifier of the network site corresponding to the target logical switch corresponding to the target device name recorded locally, the target subnet segment information and target VLAN identifier carried in the second configuration instruction, and an eighth configuration request carrying the site identifier, the target subnet segment information, the target VLAN identifier and the second network name of the target VM network carried in the second configuration instruction. The update request and the eighth configuration request are sent to the target management server in sequence, so that when the target management server receives the update request, it updates the subnet segment information and VLAN identifier of the network site corresponding to the site identifier on the virtual management module through the Windows service module. When it receives the eighth configuration request, it configures the target VM network with the second network name on the virtual management module using the target subnet segment information and target VLAN identifier of the target subnet corresponding to the network site, so that the administrator can configure the target virtual machines that need to be online on the target VM network.
2. The method according to claim 1, characterized in that, Establish a communication connection with the target management server using the following methods: Send a Hypertext Transfer Protocol (HTTPS) connection request to the target management server, wherein the HTTPS connection request carries the IP address, username, and password of the target management server; Upon receiving an HTTPS connection response from the target management server via the Windows service module, it is determined that a communication connection has been successfully established with the target management server. The HTTPS connection response is sent by the target management server after successfully logging in to itself using the username and password via the Windows service module.
3. The method according to claim 1, characterized in that, Based on the target device name of the target logical switch carried in the first configuration instruction, generate the target file name of the target uplink port configuration file that needs to be configured when configuring the target logical switch, specifically including: Generate a UUID for the target logical switch corresponding to the target device name; According to the preset first concatenation rule, the target device name and the generated UUID are concatenated to obtain the target file name of the target uplink port configuration file required to configure the target logical switch.
4. The method according to claim 1, characterized in that, Based on the UUID of the target VXLN network carried in the second configuration instruction and the target device name recorded locally, the first network name of the target logical network and the target site identifier of the target network site that need to be configured when configuring the target VM network are generated, specifically including: According to the preset second splicing rule, the network identifier of the target VXLN network carried in the second configuration instruction and the target device name recorded locally are spliced together to obtain the first network name and the target site identifier.
5. The method according to claim 1, characterized in that, The method further includes: Upon receiving a query instruction from the administrator to query the online information of online VMs on the target VM network, a query request to query the online information of online VMs on the target VM network is generated according to the query instruction. The query request is sent to the target management server, so that when the target management server receives the query request, it queries the online information of the online VMs on the target VM network from the virtual management module through the Windows service module; Upon receiving a query response from the target management server via the Windows service module in response to the query request, the administrator is shown the online information of the online VMs on the target VM network carried in the query response.
6. The method according to claim 1, characterized in that, The method further includes: Upon receiving the configuration comparison instruction input by the administrator, a request to obtain object information of multiple specified objects is sent to the target management server, so that when the target management server receives the request, it obtains the object information of all specified objects from the virtual management module through the Windows service module. Upon receiving the acquisition response from the target management server via the Windows service module in response to the acquisition request, the object information of all specified objects in the acquisition response is compared with the object information of all specified objects in the local records, and the comparison result is displayed to the administrator. If a configuration repair instruction is received from the administrator based on the comparison result, a modification request is generated carrying the object information of the specified object that needs to be repaired as determined by the DC controller with local records. The modification request is then sent to the target management server so that when the target management server receives the modification request, it uses the Windows service module on the virtual management module to repair the object information of the specified object that needs to be repaired to the object information of the specified object that needs to be repaired carried in the modification request. Among them, all the specified objects include each logical switch, the uplink port configuration file corresponding to each logical switch, the logical network corresponding to each logical switch, the network site on each logical network, and each VM network; The object information for all specified objects includes the device name of each logical switch, the file name of the uplink port configuration file corresponding to each logical switch, the network name of the logical network corresponding to each logical switch, the site identifier of the network site on each logical network and the network segment information and VLAN identifier of the corresponding subnet on each logical network, and the network name of each VM network and the network segment information and VLAN identifier of the subnet corresponding to the network site used by each VM network.
7. A network configuration device, characterized in that, The device is used in a data center DC controller, and the device includes: The module is used to establish a communication connection with the target management server based on the device information of the target management server stored locally. The first configuration module is configured to, upon receiving a first configuration instruction from an administrator for configuring a target logical switch, generate a target file name for the target uplink port configuration file to be configured when configuring the target logical switch, based on the target device name of the target logical switch carried in the first configuration instruction, and generate a first configuration request carrying the target device name, a second configuration request carrying the target file name, and a third configuration request carrying the target device name and the target file name. The first configuration request, the second configuration request, and the third configuration request are then sent sequentially to the target management server. This allows the target management server, upon receiving the first configuration request, to configure the target logical switch with the device name of the target device name on a virtual management module set up in the target management server via a Windows service module within itself. Upon receiving the second configuration request, it configures the target uplink port configuration file with the target file name on the virtual management module via the Windows service module. Upon receiving the third configuration request, it binds the target logical switch and the target uplink port configuration file on the virtual management module via the Windows service module. The judgment module is used to determine whether the target device name carried in the second configuration instruction is recorded locally when it receives the second configuration instruction input by the administrator for configuring the target VM network corresponding to the target logical switch for virtual machines (VMs) to go online. The second configuration module is used to, when the judgment result of the judgment module is negative, generate, based on the universally unique identifier (UUID) of the target VXLN network carried in the second configuration instruction and the locally recorded target device name, generate a first network name of the target logical network to be configured when configuring the target VM network and a target site identifier of the target network site, and generate a fourth configuration request carrying the first network name, a fifth configuration request carrying the first network name, the target site identifier, the target subnet segment information and the target VLAN identifier carried in the second configuration instruction, a sixth configuration request carrying the target site identifier, the target subnet information, the target VLAN identifier and the second network name of the target VM network carried in the second configuration instruction, and a seventh configuration request carrying the target site identifier and the target file name, and sequentially send the fourth configuration request, the fifth configuration request, the sixth configuration request and the seventh configuration request to the target management server, so that the target management server, upon receiving the fourth configuration request... When a configuration request is received, the Windows service module configures the target logical network with the network name of the first network name on the virtual management module. When the fifth configuration request is received, the Windows service module configures the target network site on the target logical network on the virtual management module with the site identifier of the target site identifier, the network segment information of the corresponding subnet as the target network segment information, and the VLAN identifier of the corresponding subnet as the target VLAN identifier. When the sixth configuration request is received, the Windows service module configures the target VM network with the network name of the second network name on the virtual management module using the target network segment information and the target VLAN identifier of the target subnet corresponding to the target network site. When the seventh configuration request is received, the Windows service module binds the target network site and the target uplink port configuration file on the virtual management module so that the administrator can configure the target virtual machines that need to be online on the target VM network. The third configuration module is used to generate, when the judgment result of the judgment module is yes, a site identifier of the network site corresponding to the target logical switch corresponding to the target device name recorded locally, an update request for the target subnet's target network segment information and target VLAN identifier carried in the second configuration instruction, and an eighth configuration request for the second network name of the target VM network carried in the second configuration instruction. The update request and the eighth configuration request are then sent to the target management server sequentially. Upon receiving the update request, the target management server updates the network segment information and VLAN identifier of the subnet corresponding to the site identifier on the virtual management module through the Windows service module. Upon receiving the eighth configuration request, the Windows service module configures the target VM network with the second network name on the virtual management module using the target network segment information and target VLAN identifier of the target subnet corresponding to the network site. This allows the administrator to configure the target virtual machines that need to be online on the target VM network.
8. The apparatus according to claim 7, characterized in that, The establishment module is specifically used to establish a communication connection with the target management server in the following ways: Send a Hypertext Transfer Protocol (HTTPS) connection request to the target management server, wherein the HTTPS connection request carries the IP address, username, and password of the target management server; Upon receiving an HTTPS connection response from the target management server via the Windows service module, it is determined that a communication connection has been successfully established with the target management server. The HTTPS connection response is sent by the target management server after successfully logging in to itself using the username and password via the Windows service module.
9. The apparatus according to claim 7, characterized in that, The first configuration module is specifically used to generate the target file name of the target uplink port configuration file that needs to be configured when configuring the target logical switch in the following way: Generate a UUID for the target logical switch corresponding to the target device name; According to the preset first concatenation rule, the target device name and the generated UUID are concatenated to obtain the target file name of the target uplink port configuration file required to configure the target logical switch.
10. The apparatus according to claim 7, characterized in that, The second configuration module is specifically used to generate the first network name of the target logical network and the target site identifier of the target network site that need to be configured when configuring the target VM network in the following ways: According to the preset second splicing rule, the network identifier of the target VXLN network carried in the second configuration instruction and the target device name recorded locally are spliced together to obtain the first network name and the target site identifier.
11. The apparatus according to claim 7, characterized in that, The device further includes: The query module is used to generate a query request for querying the online information of online VMs on the target VM network when it receives a query instruction input by the administrator for querying the online information of online VMs on the target VM network. The query request is sent to the target management server, so that when the target management server receives the query request, it queries the online information of the online VMs on the target VM network from the virtual management module through the Windows service module; Upon receiving a query response from the target management server via the Windows service module in response to the query request, the administrator is shown the online information of the online VMs on the target VM network carried in the query response.
12. The apparatus according to claim 7, characterized in that, The device further includes: The comparison and repair module is used to send an acquisition request to the target management server to obtain object information of multiple specified objects when it receives the configuration comparison instruction input by the administrator, so that when the target management server receives the acquisition request, it can obtain the object information of all specified objects from the virtual management module through the Windows service module; Upon receiving the acquisition response from the target management server via the Windows service module in response to the acquisition request, the object information of all specified objects in the acquisition response is compared with the object information of all specified objects in the local records, and the comparison result is displayed to the administrator. If a configuration repair instruction is received from the administrator based on the comparison result, a modification request is generated carrying the object information of the specified object that needs to be repaired as determined by the DC controller with local records. The modification request is then sent to the target management server so that when the target management server receives the modification request, it uses the Windows service module on the virtual management module to repair the object information of the specified object that needs to be repaired to the object information of the specified object that needs to be repaired carried in the modification request. Among them, all the specified objects include each logical switch, the uplink port configuration file corresponding to each logical switch, the logical network corresponding to each logical switch, the network site on each logical network, and each VM network; The object information for all specified objects includes the device name of each logical switch, the file name of the uplink port configuration file corresponding to each logical switch, the network name of the logical network corresponding to each logical switch, the site identifier of the network site on each logical network and the network segment information and VLAN identifier of the corresponding subnet on each logical network, and the network name of each VM network and the network segment information and VLAN identifier of the subnet corresponding to the network site used by each VM network.