Method and system for detecting node storage connectivity during virtual machine migration
By identifying storage protocols in OpenStack cloud computing environment and detecting the storage connectivity of computing nodes, filtering target nodes, the problem of storage connectivity confirmation difficulties during virtual machine migration is solved, the migration success rate and data integrity are improved, and a Flexible and reliable virtual machine migration solution.
Patent Information
- Application Number
- CN202411397042.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2024-11-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In OpenStack cloud computing environment, the risk of migration failure due to the inability to confirm the storage connectivity of the computing node during virtual machines is difficult to effectively solve the existing technology.
During the virtual machine migration process, by identifying the storage protocol and using ping commands to detect the storage connectivity of the computing nodes, the target nodes with connectivity are selected to ensure that the storage access during the migration process is not interrupted.
Improve the success rate of virtual machine migration, reduce the risk of migration failure caused by storage problems, ensure data consistency and integrity, and provide a flexible and reliable virtual machine migration solution to adapt to changing storage needs and networks. environment.
Smart Images

Figure CN118897716A_ABST
Abstract
Description
Technical Field
[0001] The invention discloses a method and a system for detecting node storage connectivity when migrating a virtual machine, and relates to the technical field of cloud computing. Background Art
[0002] When using the open source OpenStack architecture to provide cloud computing services, the Nova component provides computing services, provides virtual machines to customers, and implements full life cycle management of virtual machines (VMs) from creation to deletion; the Cinder component provides stable data block storage services for running virtual machines, and implements full life cycle management of hard disks (Volumes) from creation to deletion. The Cinder-Volume service is responsible for performing tasks that interact with the storage backend and integrating with various storage providers, such as Ceph, SAN, NAS, local disks, etc.
[0003] The Nova component provides the ability to migrate virtual machines between different computing nodes, which is used to recover virtual machines when a node fails or to balance resource usage between computing nodes. During the migration process, the volume needs to be mounted on the target node instead of the source node. In a cloud environment, different types of storage may exist at the same time, and volumes of different storage types may be mounted on the same virtual machine. It is ideal for all computing nodes to be able to connect to various storage. However, when some computing nodes cannot confirm the storage type, there is a risk of failure to migrate virtual machines to these nodes. Summary of the invention
[0004] In view of the problems of the prior art, the present invention provides a method and system for detecting node storage connectivity when migrating a virtual machine, which increases the detection of storage connectivity of computing nodes when migrating virtual machines, filters out computing nodes that cannot be migrated normally, effectively improves the success rate of migrating virtual machines, and ensures service quality.
[0005] The specific scheme proposed by the present invention is: The present invention provides a method for detecting node storage connectivity when migrating a virtual machine, comprising: Step 1: Based on the OpenStack architecture, obtain all volumes mounted on the virtual machine to be migrated, obtain the volume type to which the volume belongs, call the Cinder component to query the storage backend name of the volume type, and query the backend storage pool to obtain the backend storage list. In the backend storage list, obtain all matching storage protocols according to the storage backend name. Step 2: According to all storage protocols, detect the storage connectivity of the computing nodes respectively and select the migration target node: If the storage protocol includes a Ceph-based storage protocol, using a ping command to detect network connectivity from the computing node to the Ceph cluster node; If the storage protocol includes the iscsi storage protocol, the ping command is used to detect the network connectivity from the computing node to the iscsi server. If the storage protocol includes a storage protocol based on Fibre Channel (FC), then detecting whether the optical fiber link of the disk array of the computing node is reachable, Filter out computing nodes that cannot be connected by any protocol, and obtain computing nodes that have connectivity as migration target nodes.
[0006] Furthermore, in step 2 of the method for detecting node storage connectivity when migrating a virtual machine, the ping command is used to detect the network connectivity from the computing node to the Ceph cluster node, including: searching for a Ceph configuration file corresponding to the computing node, obtaining the IP address of the mon node of the Ceph cluster according to the Ceph configuration file, and using the ping command to detect the network connectivity from the computing node to the Ceph cluster node according to the IP address.
[0007] Furthermore, in step 2 of the method for detecting node storage connectivity when migrating a virtual machine, the ping command is used to detect the network connectivity from the computing node to the iSCSI server, including: calling the Cinder component to obtain the mounting information of the volume used by the virtual machine, recording the connection information in the mounting information, the connection information recording the iSCSI server IP address, and using the ping command to detect the network connectivity from the computing node to the iSCSI server according to the iSCSI server IP address.
[0008] Furthermore, in step 2 of the method for detecting node storage connectivity when migrating a virtual machine, detecting whether the fiber optic link of the disk array of the computing node is reachable includes: calling the Cinder component to obtain the mounting information of the volume used by the virtual machine, recording the connection information of the Fibre Channel FC in the mounting information, recording the port number wwpn of the HBA card in the connection information, and comparing the port number wwpn in the connection information with the port number wwpn recorded in the computing node. If they are the same, it means that the fiber optic link is reachable and has connectivity.
[0009] The present invention also provides a system for detecting node storage connectivity when migrating a virtual machine, comprising a calling query module and a screening module. The query module is called based on the OpenStack architecture to obtain all volumes mounted on the virtual machine to be migrated, obtain the volume type to which the volume belongs, call the Cinder component to query the storage backend name of the volume type, and query the backend storage pool to obtain the backend storage list. In the backend storage list, all matching storage protocols are obtained according to the storage backend name. The screening module detects the storage connectivity of computing nodes according to all storage protocols and screens the migration target nodes: If the storage protocol includes a Ceph-based storage protocol, using a ping command to detect network connectivity from the computing node to the Ceph cluster node; If the storage protocol includes the iscsi storage protocol, the ping command is used to detect the network connectivity from the computing node to the iscsi server. If the storage protocol includes a storage protocol based on Fibre Channel (FC), then detecting whether the optical fiber link of the disk array of the computing node is reachable, Filter out computing nodes that cannot be connected by any protocol, and obtain computing nodes that have connectivity as migration target nodes.
[0010] Furthermore, the screening module of the system for detecting node storage connectivity when migrating a virtual machine uses the ping command to detect the network connectivity from the computing node to the Ceph cluster node, including: searching for a Ceph configuration file corresponding to the computing node, obtaining the IP address of the mon node of the Ceph cluster according to the Ceph configuration file, and using the ping command to detect the network connectivity from the computing node to the Ceph cluster node according to the IP address.
[0011] Furthermore, the screening module of the system for detecting node storage connectivity when migrating a virtual machine uses a ping command to detect the network connectivity from the computing node to the iscsi server, including: calling a Cinder component to obtain the mounting information of the volume used by the virtual machine, recording the connection information in the mounting information, the connection information recording the iscsi server IP address, and using the ping command to detect the network connectivity from the computing node to the iscsi server according to the iscsi server IP address.
[0012] Furthermore, the screening module of the system for detecting node storage connectivity when migrating a virtual machine detects whether the fiber optic link of the disk array of the computing node is reachable, including: calling the Cinder component to obtain the mounting information of the volume used by the virtual machine, recording the connection information of the Fibre Channel FC in the mounting information, the connection information recording the port number wwpn of the HBA card, and comparing the port number wwpn in the connection information with the port number wwpn recorded in the computing node. If they are the same, it means that the fiber optic link is reachable and has connectivity.
[0013] The benefits of the method of the present invention are: Through advanced storage protocol identification and connectivity detection mechanisms, the storage access of virtual machines is ensured to be uninterrupted during the migration process, thereby improving the consistency and integrity of data. Through the automated detection process, manual intervention is reduced, reducing the risk of migration failure caused by storage problems. At the same time, the flexibility and scalability of the solution enable it to adapt to the ever-changing storage needs and network environment, providing a reliable and efficient virtual machine migration solution for the cloud computing platform, enabling enterprises to achieve faster resource scheduling and more flexible business deployment, thereby gaining an advantage in the fiercely competitive market. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a schematic diagram of the process flow of the present invention. DETAILED DESCRIPTION
[0015] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0016] Embodiment 1: The present invention provides a method for detecting node storage connectivity when migrating a virtual machine, comprising: Step 1: Based on the OpenStack architecture, obtain all volumes mounted on the VM to be migrated, obtain the volume type to which the volume belongs, call the Cinder component to query the storage backend name of the volume type, query the backend storage pool to obtain the backend storage list, and obtain all matching storage protocols in the backend storage list according to the storage backend name.
[0017] In the OpenStack architecture, the Nova component is responsible for the management of the virtual machine life cycle, and the Cinder component is responsible for the management of the volume life cycle. Each volume has a volume type volume_type, and the volume type and the storage backend are in a many-to-one relationship. Once the volume type is known, the storage type to which the volume belongs can be uniquely determined, that is, the storage backend name volume_backend_name of the volume type can be queried by calling the Cinder component through the method of the present invention, and the backend storage list can be obtained through the interface of the backend storage pool. In the backend storage list, all matching storage protocols storage_protocol are obtained according to the storage backend name volume_backend_name field. If storage_protocol is a ceph-based storage protocol, the location field in the return value can be additionally recorded, and the location field records the name of the ceph configuration file.
[0018] Step 2: According to all storage protocols, detect the storage connectivity of the computing nodes respectively and select the migration target node: If the storage protocol includes a ceph-based storage protocol, the ping command is used to detect the network connectivity of the computing node to the Ceph cluster node. When the storage protocol is a ceph-based storage protocol, the computing node connects to the Ceph volume in the form of a RADOS block device (RBD), and data is transmitted based on Ethernet. The nova-compute service is run on each computing node, and the nova-compute service relies on the Ceph configuration file to execute commands to complete the connection operation. When detecting the network connectivity of the computing node to the Ceph cluster storage node, it may specifically include: searching for the corresponding Ceph configuration file in the / etc / ceph directory of the computing node, obtaining the IP address of the mon node of the Ceph cluster according to the Ceph configuration file, and using the ping command to detect the network connectivity of the computing node to the Ceph cluster node according to the IP address.
[0019] If the storage protocol includes the iSCSI storage protocol, the ping command is used to detect the network connectivity from the computing node to the iSCSI server. The computing node is connected to the iSCSI server provided on the storage through the iscsiadm tool, and data is transmitted based on Ethernet. Detecting the network connectivity from the computing node to the iSCSI server IP address may specifically include: calling the Cinder component to obtain the mount information of the volume used by the virtual machine, recording the connection information connection_info in the mount information, recording the storage protocol target_portals field in the connection information, and recording the list of iSCSI server IP addresses in the storage protocol target_portals field, and using the ping command to detect the network connectivity from the computing node to the iSCSI server according to the iSCSI server IP address.
[0020] If the storage protocol includes a storage protocol based on Fibre Channel FC, then it is detected whether the optical fiber link of the disk array of the computing node is reachable. The computing node is connected to the volume of the SAN storage through the optical fiber link. When the optical fiber link is normal, the wwpn number of the remote device that can be connected is recorded in the / sys / class / fc_remote_ports / directory of the computing node, wherein each port rport in the directory records at least port_name and port_state, Port_name is the unique wwpn number of each HBA card, and port_state indicates the current connection state to this port, online means normal connection, and offline or blocked means abnormal state. Therefore, when the optical fiber link of the computing node is reachable, it is only necessary to ensure that the port rport corresponding to the storage can be found and the state is online.
[0021] Specifically, it may include: calling the Cinder component to obtain the mount information of the volume used by the virtual machine, recording the connection information connection_info of the Fibre Channel FC in the mount information, recording the port number wwpn of the HBA card in the connection information, and comparing the port number wwpn in the connection information with the port number wwpn recorded in the computing node. If they are the same, it means that the optical fiber link is reachable and has connectivity.
[0022] Filter out computing nodes that cannot be connected by any protocol, and obtain computing nodes that have connectivity as migration target nodes.
[0023] In the above embodiments, the method of the present invention significantly reduces the risk of migration failure by pre-detecting storage connectivity and has high stability; supports multiple storage protocols, adapts to different storage environments and requirements, and has high flexibility; simplifies troubleshooting during the migration process, improves operation and maintenance efficiency, and has high practicality.
[0024] Embodiment 2: The present invention also provides a system for detecting node storage connectivity when migrating a virtual machine, comprising a calling query module and a screening module. The query module is called based on the OpenStack architecture to obtain all volumes mounted on the virtual machine to be migrated, obtain the volume type to which the volume belongs, call the Cinder component to query the storage backend name of the volume type, and query the backend storage pool to obtain the backend storage list. In the backend storage list, all matching storage protocols are obtained according to the storage backend name. The screening module detects the storage connectivity of computing nodes according to all storage protocols and screens the migration target nodes: If the storage protocol includes a Ceph-based storage protocol, using a ping command to detect network connectivity from the computing node to the Ceph cluster node; If the storage protocol includes the iscsi storage protocol, the ping command is used to detect the network connectivity from the computing node to the iscsi server. If the storage protocol includes a storage protocol based on Fibre Channel (FC), then detecting whether the optical fiber link of the disk array of the computing node is reachable, Filter out computing nodes that cannot be connected by any protocol, and obtain computing nodes that have connectivity as migration target nodes.
[0025] Since the above-mentioned system information interaction, execution process and other contents are based on the same concept as the embodiment of the method of the present invention, the specific contents can be found in the description of the embodiment of the method of the present invention and will not be repeated here.
[0026] Likewise, the benefits of the system of the present invention are: Through advanced storage protocol identification and connectivity detection mechanisms, the storage access of virtual machines is ensured to be uninterrupted during the migration process, thereby improving the consistency and integrity of data. Through the automated detection process, manual intervention is reduced, reducing the risk of migration failure caused by storage problems. At the same time, the flexibility and scalability of the solution enable it to adapt to the ever-changing storage needs and network environment, providing a reliable and efficient virtual machine migration solution for the cloud computing platform, enabling enterprises to achieve faster resource scheduling and more flexible business deployment, thereby gaining an advantage in the fiercely competitive market.
[0027] It should be noted that not all steps and modules in the above-mentioned processes and system structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.
[0028] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A method for detecting node storage connectivity when migrating a virtual machine, characterized in that include: Step 1: Based on the OpenStack architecture, obtain all volumes mounted on the virtual machine to be migrated, obtain the volume type to which the volume belongs, call the Cinder component to query the storage backend name of the volume type, and query the backend storage pool to obtain the backend storage list. In the backend storage list, obtain all matching storage protocols according to the storage backend name. Step 2: According to all storage protocols, detect the storage connectivity of the computing nodes respectively and select the migration target node: If the storage protocol includes a Ceph-based storage protocol, using a ping command to detect network connectivity from the computing node to the Ceph cluster node; If the storage protocol includes the iscsi storage protocol, the ping command is used to detect the network connectivity from the computing node to the iscsi server. If the storage protocol includes a storage protocol based on Fibre Channel (FC), then detecting whether the optical fiber link of the disk array of the computing node is reachable, Filter out computing nodes that cannot be connected by any protocol, and obtain computing nodes that have connectivity as migration target nodes.
2. A method for detecting node storage connectivity when migrating a virtual machine according to claim 1, characterized in that In step 2, the ping command is used to detect the network connectivity from the computing node to the Ceph cluster node, including: searching for the Ceph configuration file corresponding to the computing node, obtaining the IP address of the mon node of the Ceph cluster according to the Ceph configuration file, and using the ping command to detect the network connectivity from the computing node to the Ceph cluster node according to the IP address.
3. The method for detecting node storage connectivity when migrating a virtual machine according to claim 1, characterized in that In step 2, the ping command is used to detect the network connectivity from the computing node to the iscsi server, including: calling the Cinder component to obtain the mount information of the volume used by the virtual machine, recording the connection information in the mount information, recording the iscsi server IP address in the connection information, and using the ping command to detect the network connectivity from the computing node to the iscsi server according to the iscsi server IP address.
4. The method for detecting node storage connectivity when migrating a virtual machine according to claim 1, characterized in that In step 2, whether the optical fiber link of the disk array of the computing node is reachable is detected, including: calling the Cinder component to obtain the mount information of the volume used by the virtual machine, recording the connection information of the Fibre Channel FC in the mount information, recording the port number wwpn of the HBA card in the connection information, and comparing the port number wwpn in the connection information with the port number wwpn recorded in the computing node. If they are the same, it means that the optical fiber link is reachable and has connectivity.
5. A system for detecting node storage connectivity when migrating a virtual machine, characterized in that Including calling query module and screening module, The query module is called based on the OpenStack architecture to obtain all volumes mounted on the virtual machine to be migrated, obtain the volume type to which the volume belongs, call the Cinder component to query the storage backend name of the volume type, and query the backend storage pool to obtain the backend storage list. In the backend storage list, all matching storage protocols are obtained according to the storage backend name. The screening module detects the storage connectivity of computing nodes according to all storage protocols and screens the migration target nodes: If the storage protocol includes a Ceph-based storage protocol, using a ping command to detect network connectivity from the computing node to the Ceph cluster node; If the storage protocol includes the iscsi storage protocol, the ping command is used to detect the network connectivity from the computing node to the iscsi server. If the storage protocol includes a storage protocol based on Fibre Channel (FC), then detecting whether the optical fiber link of the disk array of the computing node is reachable, Filter out computing nodes that cannot be connected by any protocol, and obtain computing nodes that have connectivity as migration target nodes.
6. A system for detecting node storage connectivity when migrating a virtual machine according to claim 5, characterized in that Filter Module The ping command is used to detect the network connectivity from the computing node to the Ceph cluster node, including: searching for the Ceph configuration file corresponding to the computing node, obtaining the IP address of the mon node of the Ceph cluster according to the Ceph configuration file, and using the ping command to detect the network connectivity from the computing node to the Ceph cluster node according to the IP address.
7. The system for detecting node storage connectivity when migrating a virtual machine according to claim 5, characterized in that The screening module uses the ping command to detect the network connectivity from the computing node to the iscsi server, including: calling the Cinder component to obtain the mounting information of the volume used by the virtual machine, recording the connection information in the mounting information, recording the iscsi server IP address in the connection information, and using the ping command to detect the network connectivity from the computing node to the iscsi server according to the iscsi server IP address.
8. The system for detecting node storage connectivity when migrating a virtual machine according to claim 5, characterized in that The screening module detects whether the optical fiber link of the disk array of the computing node is reachable, including: calling the Cinder component to obtain the mounting information of the volume used by the virtual machine, recording the connection information of the Fibre Channel FC in the mounting information, recording the port number wwpn of the HBA card in the connection information, and comparing the port number wwpn in the connection information with the port number wwpn recorded in the computing node. If they are the same, it means that the optical fiber link is reachable and has connectivity.
Citation Information
Patent Citations
Ceph-based network target range rear-end storage system design method
CN110750334A
Fault injection storage device and electronic equipment
CN117215845A
Distributed storage system virtual and storage data migration
US20180329647A1
Flexible capacity expansion method, apparatus and system
WO2017000589A1
