A method, device, equipment and medium for modifying cloud physical machine IP by a cloud platform
By utilizing the collaborative work of the ironic, ironic-nova, and neutron components in the cloud platform to dynamically update the network card IP of the cloud physical machine, the problems of long modification time and data loss in the existing technology are solved, and an efficient and secure IP modification process is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2023-02-10
- Publication Date
- 2026-07-21
AI Technical Summary
In existing technologies, modifying the IP address of a cloud physical machine requires deleting the existing cloud physical machine and redeploying it, resulting in data loss, excessive time consumption, and low efficiency.
By leveraging the ironic, ironic-nova, and neutron components to work together without deleting existing cloud physical machines, the network interface IPs of cloud physical machines can be dynamically updated, avoiding the need to redeploy the operating system.
It improves the efficiency of modifying cloud physical machine IPs, ensures data integrity and security, avoids data loss and malicious tampering, and saves time.
Smart Images

Figure CN116366604B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud platform technology, and in particular to a method, apparatus, device, and medium for modifying the IP address of a cloud physical machine on a cloud platform. Background Technology
[0002] When using a bare metal server, cloud management platform users can exclusively access the resources of the entire bare metal server. Once the cloud physical machine is deployed, it can be used immediately. However, the deployment process requires the installation of the ironic service and other business systems, which is relatively time-consuming. If a user misconfigures network information when creating the cloud physical machine, or wants to modify the IP address of the cloud physical machine through the cloud platform during use, the current system does not provide an online method for modifying the IP address. The only solution is to delete the cloud physical machine, reselect the image maintenance parameters, choose the network, and then deploy a new cloud physical machine. This approach is too costly and time-consuming for users.
[0003] However, modifying the cloud physical machine's IP address by deleting and redeploying it means that all system data on the cloud physical machine will be wiped before redeployment. This not only results in significant data loss for users but is also time-consuming and inefficient. Therefore, a solution for modifying the IP address of cloud platform physical machines is urgently needed to address these issues. Summary of the Invention
[0004] In view of this, the present invention proposes a method, apparatus, device and medium for modifying the IP address of a cloud physical machine on a cloud platform. When modifying the cloud physical machine IP address, there is no need to delete the existing cloud physical machine and then redeploy it. The modification of the cloud physical machine IP address can be completed without the need to delete the existing cloud physical machine and then redeploy it. The operation process is simple, the time spent is short, and the efficiency of modifying the cloud physical machine IP address is improved.
[0005] To achieve the above objectives, one aspect of the present invention provides a method for modifying the IP address of a cloud physical machine on a cloud platform, specifically including the following steps:
[0006] In response to receiving a task to modify the IP address of a cloud physical machine, obtain the corresponding cloud physical machine information;
[0007] An IP update request is generated based on the cloud physical machine information;
[0008] Based on the IP update request, an IP address is assigned to the network card of the cloud physical machine, and it is determined whether the assigned IP address is being used by other ports of the cloud platform;
[0009] In response to the fact that the assigned IP address is not being used by the other ports of the cloud platform, the network interface card IP address of the cloud device is updated based on the assigned IP address.
[0010] In some implementations, in response to receiving a task to modify the IP address of a cloud physical machine, obtaining the corresponding cloud physical machine information includes:
[0011] In response to receiving a task to modify the IP address of a cloud physical machine, ironic obtains the corresponding cloud physical machine information and sends the cloud physical machine information to ironic-nova.
[0012] In some implementations, generating an IP update request based on the cloud physical machine information includes:
[0013] In response to the ironic-nova receiving the cloud physical machine information, it generates an IP update request based on the cloud physical machine information and sends the IP update request to neutron.
[0014] In some implementations, assigning an IP address to the network interface card of the cloud physical machine based on the IP update request, and determining whether the assigned IP address is being used by other ports of the cloud platform, includes:
[0015] In response to the neutron receiving the IP update request, it assigns an IP address to the network interface card of the cloud physical machine and determines whether the assigned IP address is being used by other ports of the cloud platform.
[0016] In some implementations, updating the network interface card (NIC) IP of the cloud device based on the allocated IP in response to the fact that the allocated IP is not used by the other ports of the cloud platform includes:
[0017] In response to the fact that the assigned IP address is not being used by the other ports of the cloud platform, the neutron sends the assigned IP address to the ironic-nova.
[0018] In response to the assigned IP being used by the other port, the neutron returns an error message to the ironic-nova;
[0019] In response to the ironic-nova receiving the assigned IP, it obtains the network configuration file of the cloud physical machine based on the cloud physical machine information, updates the assigned IP to the network configuration file of the cloud physical machine, and returns the updated network interface IP of the cloud physical machine to ironic.
[0020] In some implementations, assigning an IP address to the network interface card (NIC) of the cloud physical machine includes:
[0021] Based on the cloud physical machine ID in the IP update request, obtain the virtual data center to which the cloud physical machine belongs, obtain the virtual private cloud of the virtual data center, and obtain the subnet information to which the cloud physical machine belongs from the virtual private cloud;
[0022] Determine whether the subnet status is normal based on the subnet information;
[0023] If the subnet is in normal condition, a target IP list is generated based on the subnet information, and the target IP list is returned to the ironic.
[0024] If the subnet is not in a normal state, an empty list is returned to the ironic.
[0025] In some implementations, determining whether the assigned IP address is being used by other ports of the cloud platform includes:
[0026] In response to the neutron receiving an IP from the target IP list, it determines whether the IP in the received target IP list is being used by other ports of the cloud platform;
[0027] In response to the neutron not receiving an IP from the target IP list, an IP is randomly selected from the subnet information, and it is determined whether the randomly selected IP is being used by other ports of the cloud platform.
[0028] In another aspect of this invention, an apparatus for modifying the IP address of a cloud physical machine on a cloud platform is also provided, comprising:
[0029] The receiving module is configured to obtain the corresponding cloud physical machine information in response to receiving a task to modify the IP address of the cloud physical machine;
[0030] The generation module is configured to generate an IP update request based on the cloud physical machine information;
[0031] The allocation module is configured to allocate an IP address to the network interface card of the cloud physical machine based on the IP update request, and to determine whether the allocated IP address is being used by other ports of the cloud platform.
[0032] An update module is configured to update the network interface card (NIC) IP of the cloud device based on the assigned IP in response to the fact that the assigned IP is not used by the other ports of the cloud platform.
[0033] In another aspect, the present invention provides a computer device, comprising: at least one processor; and a memory storing a computer program executable on the processor, the computer program, when executed by the processor, implementing the steps of the following method:
[0034] In response to receiving a task to modify the IP address of a cloud physical machine, obtain the corresponding cloud physical machine information;
[0035] An IP update request is generated based on the cloud physical machine information;
[0036] Based on the IP update request, an IP address is assigned to the network card of the cloud physical machine, and it is determined whether the assigned IP address is being used by other ports of the cloud platform;
[0037] In response to the fact that the assigned IP address is not being used by the other ports of the cloud platform, the network interface card IP address of the cloud device is updated based on the assigned IP address.
[0038] In some implementations, in response to receiving a task to modify the IP address of a cloud physical machine, obtaining the corresponding cloud physical machine information includes:
[0039] In response to receiving a task to modify the IP address of a cloud physical machine, ironic obtains the corresponding cloud physical machine information and sends the cloud physical machine information to ironic-nova.
[0040] In some implementations, generating an IP update request based on the cloud physical machine information includes:
[0041] In response to the ironic-nova receiving the cloud physical machine information, it generates an IP update request based on the cloud physical machine information and sends the IP update request to neutron.
[0042] In some implementations, assigning an IP address to the network interface card of the cloud physical machine based on the IP update request, and determining whether the assigned IP address is being used by other ports of the cloud platform, includes:
[0043] In response to the neutron receiving the IP update request, it assigns an IP address to the network interface card of the cloud physical machine and determines whether the assigned IP address is being used by other ports of the cloud platform.
[0044] In some implementations, updating the network interface card (NIC) IP of the cloud device based on the allocated IP in response to the fact that the allocated IP is not used by the other ports of the cloud platform includes:
[0045] In response to the fact that the assigned IP address is not being used by the other ports of the cloud platform, the neutron sends the assigned IP address to the ironic-nova.
[0046] In response to the assigned IP being used by the other port, the neutron returns an error message to the ironic-nova;
[0047] In response to the ironic-nova receiving the assigned IP, it obtains the network configuration file of the cloud physical machine based on the cloud physical machine information, updates the assigned IP to the network configuration file of the cloud physical machine, and returns the updated network interface IP of the cloud physical machine to ironic.
[0048] In some implementations, assigning an IP address to the network interface card (NIC) of the cloud physical machine includes:
[0049] Based on the cloud physical machine ID in the IP update request, obtain the virtual data center to which the cloud physical machine belongs, obtain the virtual private cloud of the virtual data center, and obtain the subnet information to which the cloud physical machine belongs from the virtual private cloud;
[0050] Determine whether the subnet status is normal based on the subnet information;
[0051] If the subnet is in normal condition, a target IP list is generated based on the subnet information, and the target IP list is returned to the ironic.
[0052] If the subnet is not in a normal state, an empty list is returned to the ironic.
[0053] In some implementations, determining whether the assigned IP address is being used by other ports of the cloud platform includes:
[0054] In response to the neutron receiving an IP from the target IP list, it determines whether the IP in the received target IP list is being used by other ports of the cloud platform;
[0055] In response to the neutron not receiving an IP from the target IP list, an IP is randomly selected from the subnet information, and it is determined whether the randomly selected IP is being used by other ports of the cloud platform.
[0056] In another aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method steps.
[0057] This invention has at least the following beneficial technical effects: Compared with traditional OpenStack platforms, on the one hand, the solution of this invention provides a method for modifying the IP of cloud physical machines without destroying existing cloud physical machines, saving the step of redeploying cloud physical machines and improving efficiency; on the other hand, since the solution of this invention does not require redeployment of the operating system, it can well guarantee data integrity, solve the risk of data loss caused by redeploying cloud physical machines, and provide good technical support for users' business services; furthermore, after the cloud physical machine issues the IP modification task, it calls the interface of the cloud physical machine maintenance mode to enter maintenance mode, thereby greatly ensuring the security of data and network, avoiding malicious data tampering, and improving data security while saving time. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.
[0059] Figure 1 A block diagram illustrating an embodiment of the method for modifying the IP address of a cloud physical machine in a cloud platform provided by the present invention;
[0060] Figure 2 A schematic diagram of an embodiment of the apparatus for modifying the IP address of a cloud physical machine in a cloud platform provided by the present invention;
[0061] Figure 3 A schematic diagram of the structure of an embodiment of the computer device provided by the present invention;
[0062] Figure 4 This is a schematic diagram of an embodiment of the computer-readable storage medium provided by the present invention. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.
[0064] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities or parameters with the same name but different names. It is clear that "first" and "second" are only for the convenience of expression and should not be construed as limiting the embodiments of the present invention. Subsequent embodiments will not explain this in detail.
[0065] Based on the above objectives, a first aspect of the present invention provides an embodiment of a method for modifying the IP address of a cloud physical machine on a cloud platform. For example... Figure 1 As shown, it includes the following steps:
[0066] S10. In response to receiving the task to modify the IP address of the cloud physical machine, obtain the corresponding cloud physical machine information;
[0067] S20. Generate an IP update request based on the cloud physical machine information;
[0068] S30. Assign an IP address to the network card of the cloud physical machine based on the IP update request, and determine whether the assigned IP address is being used by other ports of the cloud platform;
[0069] S40. In response to the fact that the allocated IP is not used by the other ports of the cloud platform, update the network card IP of the cloud device based on the allocated IP.
[0070] Specifically, the cloud platform is the OpenStack cloud platform. The user selects a specific cloud physical machine on the cloud platform, specifies the network interface card (NIC) of the cloud physical machine, and selects new network information to issue a task to modify the IP address. After receiving the task, Ironic sends the cloud physical machine ID to Ironic-nova. Ironic-nova obtains the corresponding cloud physical machine information from the cloud physical machine ID, generates an update IP request, and sends the update IP request to Neutron. After receiving the request, Neutron obtains the cloud physical machine ID and port information, assigns an IP address to the corresponding NIC of the cloud physical machine, and sends the assigned IP address to Ironic-nova. Ironic-nova updates the existing IP address of the NIC to the assigned new IP address, thereby achieving the purpose of modifying the IP address of the cloud physical machine at the platform entry point.
[0071] It's important to note that OpenStack is an open-source cloud computing management platform project, a combination of several open-source software projects. Ironic is the component in OpenStack that provides bare-metal services, Ironic-nova is the virtualization management component, and Neutron is the virtual network service component. In the OpenStack cloud platform, a single port can correspond to various device types, including the network interface card (NIC) of a physical cloud machine, a virtual machine's NIC, a manually created NIC, and a NIC used by a router. Other ports refer to ports other than those corresponding to the NICs of the physical cloud machine whose IP addresses need to be modified.
[0072] This invention enables the modification of the IP address of a cloud physical machine. The operation is simple, takes little time, and improves the efficiency of modifying the IP address of a cloud physical machine.
[0073] In some implementations, in response to receiving a task to modify the IP address of a cloud physical machine, obtaining the corresponding cloud physical machine information includes:
[0074] In response to receiving a task to modify the IP address of a cloud physical machine, ironic obtains the corresponding cloud physical machine information and sends the cloud physical machine information to ironic-nova.
[0075] In some implementations, generating an IP update request based on the cloud physical machine information includes:
[0076] In response to the ironic-nova receiving the cloud physical machine information, it generates an IP update request based on the cloud physical machine information and sends the IP update request to neutron.
[0077] In some implementations, assigning an IP address to the network interface card of the cloud physical machine based on the IP update request, and determining whether the assigned IP address is being used by other ports of the cloud platform, includes:
[0078] In response to the neutron receiving the IP update request, it assigns an IP address to the network interface card of the cloud physical machine and determines whether the assigned IP address is being used by other ports of the cloud platform.
[0079] In some implementations, updating the network interface card (NIC) IP of the cloud device based on the allocated IP in response to the fact that the allocated IP is not used by the other ports of the cloud platform includes:
[0080] In response to the fact that the assigned IP address is not being used by the other ports of the cloud platform, the neutron sends the assigned IP address to the ironic-nova.
[0081] In response to the assigned IP being used by the other port, the neutron returns an error message to the ironic-nova;
[0082] In response to the ironic-nova receiving the assigned IP, it obtains the network configuration file of the cloud physical machine based on the cloud physical machine information, updates the assigned IP to the network configuration file of the cloud physical machine, and returns the updated network interface IP of the cloud physical machine to ironic.
[0083] In one specific embodiment, when a user selects a cloud physical machine and specifies a network interface card (NIC) on the OpenStack cloud platform frontend, and issues a task to modify the IP address, Ironic receives the task on the OpenStack cloud platform backend, obtains the cloud physical machine ID from the task, and sends the cloud physical machine ID to Ironic-nova. Upon receiving the cloud physical machine ID, Ironic-nova generates an IP update request and sends it to Neutron. Neutron, upon receiving the IP update request, assigns an IP address to the cloud physical machine and checks if the assigned IP address is being used by other ports on the cloud platform. If it is not being used by other ports, it returns the cloud physical machine ID, NIC MAC address information, and the assigned IP address to Ironic-nova. Ironic-nova writes the assigned IP address to the cloud physical machine's NIC configuration file and sends the modified NIC information back to Ironic, which then displays the modified NIC information on the frontend. If the assigned IP address is already being used by another port, possibly by a cloud physical machine or virtual machine, Neutron detects the duplicate IP address and returns a readable error message via the interface, causing the IP modification task to fail.
[0084] Compared to traditional OpenStack platforms, this invention provides a solution for modifying the IP address of cloud physical machines without destroying existing machines, saving the step of redeploying and improving efficiency. At the same time, since this invention does not require redeploying the operating system, it effectively ensures data integrity, mitigating the risk of data loss associated with redeploying cloud physical machines and providing strong technical support for users' business services.
[0085] In one specific embodiment, after the cloud physical machine issues the task to modify the IP, its corresponding cloud physical machine calls the maintenance mode interface to enter maintenance mode, thereby greatly ensuring the security of data and network, avoiding malicious data tampering, and improving data security while saving time.
[0086] In one specific embodiment, before ironic obtains the corresponding cloud physical machine information after receiving the task to modify the cloud physical machine's IP address, the following steps are also performed:
[0087] S11. Determine the source of the cloud physical machine;
[0088] S12. If the source of the cloud physical machine is managed, this scenario involves managing cloud physical machines with existing operating systems. Changing the IP address is not supported, so an error message indicating that IP modification is not supported is returned.
[0089] S13. If the source of the cloud physical machine is the cloud platform, then determine whether the cloud platform is in normal status;
[0090] S14. If the cloud platform is in normal condition, proceed with the step of obtaining the corresponding cloud physical machine information;
[0091] S15. If the cloud platform is not in a normal state, return an error message that it does not support modifying the IP and call the maintenance mode interface to enter maintenance mode.
[0092] In some implementations, assigning an IP address to the network interface card (NIC) of the cloud physical machine includes:
[0093] Based on the cloud physical machine ID in the IP update request, obtain the virtual data center to which the cloud physical machine belongs, obtain the virtual private cloud of the virtual data center, and obtain the subnet information to which the cloud physical machine belongs from the virtual private cloud;
[0094] Determine whether the subnet status is normal based on the subnet information;
[0095] If the subnet is in normal condition, a target IP list is generated based on the subnet information, and the target IP list is returned to the ironic.
[0096] If the subnet is not in a normal state, an empty list is returned to the ironic.
[0097] In one specific embodiment, assigning an IP address to the network interface card (NIC) of the cloud physical machine includes assigning a user-specified IP address to the NIC of the cloud physical machine, and the specific process is as follows:
[0098] The user can select a network interface card (NIC) on a cloud physical machine that is in a normal state and click "Modify IP". Neutron then retrieves the virtual data center to which the cloud physical machine belongs based on its ID, obtains the available virtual private cloud (VPN), retrieves the subnet information of the cloud physical machine from the VPN, and returns this information to the front end, displaying a list of selectable target IPs to the user. If the subnet is in a normal state, the user can select from all subnets and allocate addresses; if the subnet is in an abnormal state, the returned list is empty. The user selects an IP from the returned list and clicks "OK" to issue the IP modification task. Neutron receives the task, checks if the IP is already in use, returns an error message if it is, and terminates the task. If it is not in use, it deletes the IP corresponding to the port and updates it with the user-specified IP. Ironic-nova updates this specified IP to the cloud physical machine's network configuration file. The user can then access the cloud physical machine and see that the IP has been successfully updated.
[0099] The above solution enables the allocation and modification of IP addresses for network interface cards (NICs) of cloud physical machines that require IP address changes, thereby improving the efficiency of modifying cloud physical machine IP addresses.
[0100] In some implementations, determining whether the assigned IP address is being used by other ports of the cloud platform includes:
[0101] In response to the neutron receiving an IP from the target IP list, it determines whether the IP in the received target IP list is being used by other ports of the cloud platform;
[0102] In response to the neutron not receiving an IP from the target IP list, an IP is randomly selected from the subnet information, and it is determined whether the randomly selected IP is being used by other ports of the cloud platform.
[0103] In one specific embodiment, assigning an IP address to the network interface card (NIC) of the cloud physical machine includes assigning a random IP address to the NIC of the cloud physical machine, and the specific process is as follows:
[0104] If the user selects the network interface card of the cloud physical machine, clicks "Modify IP," and then clicks "OK" without selecting any data from the target IP list, Neutron will receive the task and randomly assign an IP address from the subnet address pool to the cloud physical machine. After receiving the cloud physical machine and the assigned IP address, Neutron will determine whether the IP address is in use. If it is in use, it will return the corresponding error message and terminate the task. If it is not in use, it will delete the corresponding IP address from the port and update it with the IP address specified by the user. Ironic-nova will then update this IP address to the cloud physical machine's network configuration file. The user will then be able to see that the cloud physical machine's IP address has been successfully updated when they access the cloud physical machine.
[0105] The above solution enables the allocation and modification of IP addresses for network interface cards (NICs) of cloud physical machines that require IP address changes, thereby improving the efficiency of modifying cloud physical machine IP addresses.
[0106] Based on the same inventive concept, according to another aspect of the present invention, such as Figure 2 As shown, embodiments of the present invention also provide an apparatus for modifying the IP address of a cloud physical machine on a cloud platform, comprising:
[0107] The receiving module 110 is configured to obtain the corresponding cloud physical machine information in response to receiving a task to modify the IP address of the cloud physical machine;
[0108] Generation module 120, configured to generate an IP update request based on the cloud physical machine information;
[0109] The allocation module 130 is configured to allocate an IP address to the network card of the cloud physical machine based on the IP update request, and to determine whether the allocated IP address is being used by other ports of the cloud platform.
[0110] Update module 140 is configured to update the network interface card IP of the cloud device based on the allocated IP in response to the fact that the allocated IP is not used by the other ports of the cloud platform.
[0111] Based on the same inventive concept, according to another aspect of the present invention, such as Figure 3 As shown, an embodiment of the present invention also provides a computer device 30, which includes a processor 310 and a memory 320. The memory 320 stores a computer program 321 that can be run on the processor. When the processor 310 executes the program, it performs the steps of the method described above.
[0112] The memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the method for modifying the IP of a cloud physical machine in the cloud platform as described in this application embodiment. The processor executes various functional applications and data processing of the device by running the non-volatile software programs, instructions, and modules stored in the memory, thereby implementing the method for modifying the IP of a cloud physical machine in the cloud platform as described in the above method embodiment.
[0113] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on system usage. Furthermore, the memory may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the local module via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0114] Based on the same inventive concept, according to another aspect of the present invention, such as Figure 4 As shown, embodiments of the present invention also provide a computer-readable storage medium 40, which stores a computer program 410 that, when executed by a processor, performs the methods described above.
[0115] Finally, it should be noted that those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The storage medium for the program can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The above computer program embodiments can achieve the same or similar effects as any of the corresponding foregoing method embodiments.
[0116] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the overall device. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.
[0117] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. The sequence numbers of the disclosed embodiments of this invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.
[0118] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.
[0119] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A method for modifying the IP address of a cloud physical machine on a cloud platform, characterized in that, include: In response to receiving a task to modify the IP address of a cloud physical machine, ironic obtains the corresponding cloud physical machine information and sends the cloud physical machine information to ironic-nova; In response to the ironic-nova receiving the cloud physical machine information, it generates an IP update request based on the cloud physical machine information and sends the IP update request to neutron; In response to the neutron receiving the IP update request, it assigns an IP address to the network card of the cloud physical machine and determines whether the assigned IP address is being used by other ports of the cloud platform. In response to the fact that the assigned IP address is not being used by the other ports of the cloud platform, the network interface card (NIC) IP address of the cloud physical machine is updated based on the assigned IP address.
2. The method according to claim 1, characterized in that, In response to the fact that the allocated IP address is not being used by the other ports of the cloud platform, updating the network interface card (NIC) IP address of the cloud physical machine based on the allocated IP address includes: In response to the fact that the assigned IP address is not being used by the other ports of the cloud platform, the neutron sends the assigned IP address to the ironic-nova. In response to the assigned IP being used by the other port, the neutron returns an error message to the ironic-nova; In response to the ironic-nova receiving the assigned IP, it obtains the network configuration file of the cloud physical machine based on the cloud physical machine information, updates the assigned IP to the network configuration file of the cloud physical machine, and returns the updated network interface IP of the cloud physical machine to ironic.
3. The method according to claim 1, characterized in that, Assigning IP addresses to the network interface cards (NICs) of the cloud physical machine includes: Based on the cloud physical machine ID in the IP update request, obtain the virtual data center to which the cloud physical machine belongs, obtain the virtual private cloud of the virtual data center, and obtain the subnet information to which the cloud physical machine belongs from the virtual private cloud; Determine whether the subnet status is normal based on the subnet information; If the subnet is in normal condition, a target IP list is generated based on the subnet information, and the target IP list is returned to the ironic. If the subnet is not in a normal state, an empty list is returned to the ironic.
4. The method according to claim 3, characterized in that, Determining whether the assigned IP address is being used by other ports on the cloud platform includes: In response to the neutron receiving an IP from the target IP list, it determines whether the IP in the received target IP list is being used by other ports of the cloud platform; In response to the neutron not receiving an IP from the target IP list, an IP is randomly selected from the subnet information, and it is determined whether the randomly selected IP is being used by other ports of the cloud platform.
5. A device for modifying the IP address of a cloud physical machine on a cloud platform, characterized in that, include: The receiving module is configured to, in response to ironic receiving a task to modify the IP address of a cloud physical machine, obtain the corresponding cloud physical machine information and send the cloud physical machine information to ironic-nova; The generation module is configured to, in response to the ironic-nova receiving the cloud physical machine information, generate an IP update request based on the cloud physical machine information and send the IP update request to neutron; The allocation module is configured to, in response to the neutron receiving the IP update request, allocate an IP address to the network interface card of the cloud physical machine and determine whether the allocated IP address is being used by other ports of the cloud platform; An update module is configured to update the network interface card (NIC) IP of the cloud physical machine based on the assigned IP in response to the fact that the assigned IP is not used by the other ports of the cloud platform.
6. A computer device, comprising: At least one processor; as well as A memory storing a computer program executable on the processor, characterized in that the processor executes the program and performs the steps of the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it performs the steps of the method as described in any one of claims 1 to 4.