Cloud platform deployment method, device, computer equipment and storage medium
By deploying storage and cloud platform software on the same physical machine and realizing physical isolation of the operating system in the virtual machine, the compatibility problem in the deployment of hyperconverged cloud platform is solved, resource utilization and stability are improved, and the deployment process is simplified.
Patent Information
- Application Number
- CN202311753062.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2043-12-19
AI Technical Summary
When deploying a hyper-converged cloud platform, storage software and cloud platform software may cause software package conflicts and operating system versions to be incompatible due to different sources, resulting in cloud platform being unable to be deployed smoothly, and it needs to be deployed on multiple physical machines, and resource utilization rate Low, complex deployment and high cost.
Deploy storage software and cloud platform software on the same physical machine, and realize the physical isolation of the storage operating system and cloud platform operating system by creating a virtual machine. Use PCI number to identify the target physical device, create the target virtual machine and deploy the storage operating system on it. , ensure that the two operate independently.
It reduces the difficulty and cost of cloud platform deployment, improves resource utilization and stability, avoids compatibility issues, and simplifies the deployment process.
Smart Images

Figure CN117909023B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a cloud platform deployment method, apparatus, computer equipment and storage medium. Background Art
[0002] With the rapid development of information technology, many enterprises have increasingly higher application demands for IT (Information Technology) infrastructure. As an emerging IT infrastructure, the hyper-converged cloud platform has the characteristics of high resource utilization and simple deployment and maintenance. Cloud computing through the hyper-converged cloud platform can improve the flexibility and reliability of each enterprise's business.
[0003] However, in the process of deploying a hyper-converged cloud platform, storage software and cloud platform software need to be deployed on multiple physical machines. This not only places certain requirements on the memory of the physical machines, but also because the storage software and cloud platform software come from different manufacturers, there may be problems with the smooth deployment of the cloud platform due to software package conflicts and incompatibility of operating system versions. Summary of the invention
[0004] Based on this, it is necessary to provide a cloud platform deployment method, device, computer equipment and storage medium that can deploy storage software and cloud platform software on the same physical machine and achieve physical isolation between the storage operating system and the cloud platform operating system to avoid compatibility issues in response to the above technical problems.
[0005] In a first aspect, the present application provides a cloud platform deployment method, the method comprising:
[0006] In a case where the platform operating system of the cloud platform has been deployed on the physical machine, determining a target physical device for use by a target virtual machine on the physical machine from among various physical devices of the physical machine;
[0007] Based on the target physical device, create a target virtual machine on the physical machine;
[0008] Deploy the storage operating system of the cloud platform in the created target virtual machine.
[0009] In the technical solution of the embodiment of the present application, by deploying a platform operating system in a physical machine, and allocating the target physical device of the physical machine to the target virtual machine for use, so as to deploy a storage operating system in the target virtual machine, the platform operating system and the storage operating system can be deployed simultaneously, and the two can be physically isolated, which can reduce the difficulty of cloud platform deployment and avoid compatibility issues in cloud platform deployment.
[0010] In one embodiment, determining a target physical device for use by a target virtual machine on the physical machine from among the physical devices of the physical machine includes:
[0011] Call the device query command to obtain the PCI number of each physical device of the physical machine;
[0012] According to the PCI number of each physical device, a target physical device for use by a target virtual machine on the physical machine is determined from among the physical devices.
[0013] In the technical solution of the embodiment of the present application, by obtaining the PCI numbers of all physical devices of the physical machine and screening out the target physical devices that can be used by the target virtual machine based on the PCI numbers, it can be ensured that the operation of the created target virtual machine will not affect the operation of the physical machine, which is conducive to improving the stability of the deployed cloud platform.
[0014] In one embodiment, each physical device includes at least one of a network card and a disk, and according to a PCI number of each physical device, determining a target physical device for use by a target virtual machine on the physical machine from each physical device includes:
[0015] Get the specified device type; wherein the specified device type includes a network card and / or a disk;
[0016] From the physical devices, a physical device having a prefix identifier corresponding to the specified device type in the PCI number is selected, and the selected physical device is used as a target physical device for use by a target virtual machine on the physical machine.
[0017] In the technical solution of the embodiment of the present application, by identifying the prefix identifier in the PCI number, the target physical device that can be used by the target virtual machine is screened out, that is, the network card and / or disk that can be used by the target virtual machine can be determined more accurately from all physical devices, ensuring that the network card and / or disk of the target virtual machine can operate normally, which is conducive to improving the stability of the storage service.
[0018] In one embodiment, if the specified device type is a network card, the prefix identifier corresponding to the specified device type is an Ethernet card identifier; if the specified device type is a disk, the prefix identifier corresponding to the specified device type is a disk array identifier.
[0019] In the technical solution of the embodiment of the present application, it is specifically explained that the prefix identifier corresponding to the network card is the Ethernet card identifier, and the prefix identifier corresponding to the disk is the disk array identifier.
[0020] In one embodiment, creating a target virtual machine on a physical machine based on a target physical device includes:
[0021] Create an image file of the target virtual machine on the physical machine through the target physical device;
[0022] Add an identifier BDF of the target physical device to a virtual machine configuration file of the target virtual machine; wherein the identifier BDF includes a bus number, a slot number, and a function number.
[0023] In the technical solution of the embodiment of the present application, by creating an image file of the target virtual machine and configuring the virtual machine configuration file of the target virtual machine, the basic creation process of the target virtual machine is completed to maintain the integrity of the solution; further, the BDF number of the target physical device is added to the virtual machine configuration file to achieve transparent transmission of the target physical device to the target virtual machine, so that the target physical device is bound to the target virtual machine, and the transparent transmission method can ensure the high-performance operation of the target virtual machine.
[0024] In one embodiment, creating an image file of a target virtual machine on a physical machine through a target physical device includes:
[0025] Start the virtualization platform management service through the target physical device to run the QEMU process;
[0026] Run the image creation command of the QEMU process through the target physical device to create an image file of the target virtual machine on the physical machine.
[0027] In the technical solution of the embodiment of the present application, the image creation command is run through the virtualization platform management service and the QEMU process to complete the creation of the image file. The creation process can be applied to different physical machines, and the image file creation process can be completed independently to ensure the reliability of the image file creation.
[0028] In one embodiment, the image creation command of the QEMU process is run through the target physical device to create an image file of the target virtual machine on the physical machine, including:
[0029] If the device type of the target physical device is a disk, the image creation command corresponding to the target disk image format of the QEMU process is run through the target physical device to create an image file of the target virtual machine whose image format is the target disk image format on the physical machine.
[0030] In the technical solution of the embodiment of the present application, image files of different image formats are created through different image creation commands. For cloud platform deployment solutions in different scenarios, image files of corresponding image formats can be created according to actual needs, thereby improving the flexibility of deploying storage operating systems.
[0031] In one embodiment, before adding the identifier BDF of the target physical device to the virtual machine configuration file of the target virtual machine, the method further includes:
[0032] Get the identifier BDF of the target physical device from the preset configuration file.
[0033] In the technical solution of the embodiment of the present application, a preset configuration file of the physical machine is generated in advance, and then when the identifier BDF of the target physical device needs to be added to the virtual machine configuration file, it can be directly obtained from the preset configuration file, thereby avoiding errors in the added identifier BDF due to inconsistency of the identifier BDF of the target physical device on different physical machines, thereby improving the reliability of virtual machine creation.
[0034] In one embodiment, deploying a storage operating system of a cloud platform in the created target virtual machine includes:
[0035] Installing the storage operating system of the cloud platform in the created target virtual machine;
[0036] Change the startup mode of the operating system stored in the virtual machine configuration file of the target virtual machine from image startup to hard disk startup.
[0037] In the technical solution of the embodiment of the present application, the independent operation of the storage operating system is achieved by installing a storage operating system and updating the startup method of the storage operating system, so that the cloud platform service and storage service of the cloud platform are respectively run in two independent operating systems that are isolated from each other, thereby achieving physical isolation between the platform operating system and the storage operating system, and solving the compatibility problem of cloud platform deployment.
[0038] In a second aspect, the present application also provides a cloud platform deployment device, the device comprising:
[0039] A determination module, used to determine, from various physical devices of the physical machine, a target physical device for use by a target virtual machine on the physical machine, when the platform operating system of the cloud platform has been deployed on the physical machine;
[0040] A creation module, used to create a target virtual machine on a physical machine based on a target physical device;
[0041] The deployment module is used to deploy the storage operating system of the cloud platform in the created target virtual machine.
[0042] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method of the first aspect when executing the computer program.
[0043] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method of the first aspect when the computer program is executed by a processor.
[0044] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the method of the first aspect when executed by a processor.
[0045] The above-mentioned cloud platform deployment method, apparatus, computer equipment and storage medium, when the physical machine has deployed the platform operating system of the cloud platform, determine the target physical device for use by the target virtual machine on the physical machine from the physical devices of the physical machine; create a target virtual machine on the physical machine based on the target physical device; and deploy the storage operating system of the cloud platform in the created target virtual machine. This application realizes the simultaneous deployment of two operating systems required for the operation of the cloud platform on the same physical machine by creating a virtual machine on a physical machine, deploying the platform operating system of the cloud platform on the physical machine, and deploying the storage operating system of the cloud platform on the virtual machine, and physically isolates the two operating systems to avoid compatibility issues, thereby reducing the difficulty of cloud platform deployment and improving the applicability and reliability of cloud platform deployment. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] FIG1 is an application scenario diagram of a cloud platform deployment method in one embodiment;
[0047] FIG2 is a schematic diagram of a process of a cloud platform deployment method in one embodiment;
[0048] FIG3 is a schematic diagram of a process for determining a target physical device in one embodiment;
[0049] FIG4 is a schematic diagram of a process for determining a target physical device in another embodiment;
[0050] FIG5 is a schematic diagram of a process of creating a target virtual machine in one embodiment;
[0051] FIG6 is a schematic diagram of a process of creating an image file in one embodiment;
[0052] FIG7 is a schematic diagram of a process of deploying a storage operating system in one embodiment;
[0053] FIG8 is a schematic diagram of a process of cloud platform deployment method in another embodiment;
[0054] FIG9 is a structural block diagram of a cloud platform deployment device in one embodiment;
[0055] FIG10 is a structural block diagram of a cloud platform deployment device in another embodiment;
[0056] FIG11 is a structural block diagram of a cloud platform deployment device in yet another embodiment;
[0057] FIG12 is a structural block diagram of a cloud platform deployment device in yet another embodiment;
[0058] FIG13 is a structural block diagram of a cloud platform deployment device in yet another embodiment;
[0059] FIG. 14 is a structural block diagram of a computer device for implementing a cloud platform deployment method in one embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] The cloud platform deployment method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the physical machine 102 communicates with the server 104 through the network. The data storage system can store data that the physical machine 102 needs to obtain from the server 104, such as storage software and cloud platform software. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. At least one virtual machine can be created on the physical machine 102. In the case where the platform operating system of the cloud platform has been deployed on the physical machine 102, the target physical device for the target virtual machine on the physical machine 102 is determined from the physical devices of the physical machine 102, and then based on the target physical device, the target virtual machine is created on the physical machine 102, and further, the storage operating system of the cloud platform is deployed in the created target virtual machine. Among them, the physical machine 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0062] At present, when deploying a hyper-converged cloud platform on a physical machine, the storage software and cloud platform software are generally deployed on different physical machines. For example, if three physical machines are needed to deploy both the storage software and the cloud platform software, then a total of six physical machines are needed to deploy the hyper-converged platform, which brings problems such as low resource utilization, complex deployment and maintenance, and high costs to the deployment of the hyper-converged cloud platform. If the storage software and the cloud platform software are deployed on the same physical machine, the server memory requirements are high, and there may be conflicts between the storage software and the cloud platform software, as well as incompatibility between their respective operating systems.
[0063] In order to solve the above problem, in one embodiment, as shown in FIG2 , a cloud platform deployment method is provided, comprising the following steps:
[0064] S201 , when a platform operating system of a cloud platform has been deployed on a physical machine, a target physical device for use by a target virtual machine on the physical machine is determined from various physical devices of the physical machine.
[0065] A cloud platform is a platform that runs cloud computing on the cloud. It can provide computing, network and storage services based on hardware resources and software resources. The cloud platform can be a hyper-converged cloud platform, which can more efficiently utilize various cloud computing resources, thereby improving the flexibility and reliability of the corresponding business.
[0066] A physical machine refers to a physical device pre-registered with the cloud platform, which is used to provide hardware and software support for the normal operation of the cloud platform. A platform operating system is deployed on the physical machine, where the platform operating system can be a conventional operating system or a cloud platform-specific operating system, which is not limited in this embodiment.
[0067] The physical devices of a physical machine are the hard disk and various physical devices attached to the system. Specifically, the physical devices are PCI (Peripheral Component Interconnect) devices, such as network cards, sound cards, and disks.
[0068] The target virtual machine is the virtual machine to be created. Before creating the target virtual machine on the physical machine, the target physical device to be allocated to the target virtual machine is determined. In other words, the physical devices of the physical machine are divided into physical devices used by the physical machine and physical devices used by the virtual machine. The target physical device is the physical device used by the virtual machine.
[0069] Optionally, the target physical device may be a physical device of one device type, such as a network card, or a physical device of multiple device types, such as a network card and a disk. The device type of the target physical device may be pre-set according to the actual requirements of the cloud platform deployment, and then during the cloud platform deployment process, the target physical device is selected from the physical devices of the physical machine according to the pre-set device type of the target physical device.
[0070] S202: Create a target virtual machine on a physical machine based on the target physical device.
[0071] Install the toolkit required to create the target virtual machine, and then use the relevant tools in the toolkit through the target physical device to create the target virtual machine on the physical machine. For example, install the toolkit of the virtualization platform management service required to create the target virtual machine and the toolkit of the virtual machine image on the physical machine, start and run the service corresponding to the installed toolkit based on the target physical device, use the relevant tools in the toolkit, thereby building the operating environment of the target virtual machine, establishing the corresponding relationship between the target virtual machine and the physical machine, and installing the target virtual machine.
[0072] Optionally, the target physical device is a disk, and the service corresponding to the toolkit of the installed virtual machine image is started and run based on the disk, and relevant tools in the toolkit of the virtual machine image are used to store the virtual machine image on the disk and create a target virtual machine based on the virtual machine image.
[0073] Optionally, the target physical device is a network card, such as a storage network card. The network between the storage network card of the target virtual machine and the management network card of the physical machine can communicate normally. The network environment of the target virtual machine is built based on the storage network card. For example, the mapped storage network cards are a group of two, and bond4 is configured on the target virtual machine supported by the distributed block storage software.
[0074] S203: deploying a storage operating system of the cloud platform in the created target virtual machine.
[0075] The storage operating system may be a conventional operating system or a cloud platform-specific operating system, which is not limited in this embodiment.
[0076] The created target virtual machine is a bare virtual machine, and the operating system has not been installed. Start the target virtual machine to connect the target virtual machine to the target physical device, and then mount the virtual machine image of the target virtual machine to a CD-ROM (CompactDisc Read-Only Memory) to deploy the storage operating system of the cloud platform in the target virtual machine.
[0077] In the above scheme, when the platform operating system of the cloud platform has been deployed on the physical machine, the target physical device for the target virtual machine on the physical machine is determined from the physical devices of the physical machine; based on the target physical device, a target virtual machine is created on the physical machine; and the storage operating system of the cloud platform is deployed in the created target virtual machine. This embodiment realizes the simultaneous deployment of two operating systems required for the operation of the cloud platform on the same physical machine by creating a virtual machine on the physical machine, deploying the platform operating system of the cloud platform on the physical machine, and deploying the storage operating system of the cloud platform on the virtual machine, and physically isolating the two operating systems to avoid compatibility issues, thereby reducing the difficulty of cloud platform deployment and improving the applicability and reliability of cloud platform deployment.
[0078] In order to improve the accuracy of determining the target physical device, so as to reasonably allocate the target physical device to the target virtual machine, based on the above embodiment, in one embodiment, the physical device is a PCI device, and the relevant information of all PCI devices can be directly obtained according to the device query command of the PCI device, and then the target physical device that can be used by the target virtual machine is accurately determined therefrom. As shown in FIG. 3, the above S201 includes:
[0079] S301, calling a device query command to obtain the PCI number of each physical device of the physical machine.
[0080] Specifically, the physical device is a PCI device, and the PCI numbers of all PCI devices on the physical machine can be obtained by calling the device query command, i.e., the lspci command. Among them, lspci is a tool for displaying all PCI devices in the system or all devices connected to the bus.
[0081] For example, calling the lspci -v command can display the information of all devices in redundant mode; calling the lspci -vv command can display more detailed information of all devices in super redundant mode; calling the lspci -n command can display the PCI manufacturer and PCI number in digital form.
[0082] S302: Determine a target physical device for use by a target virtual machine on the physical machine from among the physical devices according to the PCI numbers of the physical devices.
[0083] According to the PCI number of each physical device, the physical device that needs to be allocated to the target virtual machine and the target physical device that can be allocated to the target virtual machine can be determined from the physical devices.
[0084] For example, a network card needs to be allocated to the target virtual machine. According to the PCI number of each physical device, a currently unused network card is screened out from each physical device and used as the target physical device.
[0085] It should be noted that the target physical device is transparently transmitted to the target virtual machine, so the target physical device is a transparent PCI device, such as a network card, graphics card, sound card, HBA (Host Bus Adapter) card, disk, and USB (Universal Serial Bus) controller.
[0086] Optionally, after the target physical device is determined from each physical device, the target physical device is transparently transmitted from the physical machine to the target virtual machine for use by the target virtual machine. The transparent transmission can be implemented by PCI transparent transmission or RAID (Redundant Array of Independent Disks) transparent transmission. By allocating the target physical device to the target virtual machine in the transparent transmission manner, the high-performance operation of the target virtual machine can be achieved, and the condition of mutual isolation between the physical machine and the target virtual machine can be met.
[0087] This embodiment obtains all PCI devices on the physical machine by calling the device query command, namely the lspci command, and then determines the PCI devices to be transmitted to the target virtual machine from all PCI devices according to actual needs, and completes the filtering step of the PCI devices, so that the finally determined PCI devices can be used normally by the target virtual machine and do not affect the operation of the physical machine.
[0088] In order to improve the accuracy of determining the target physical device, so as to reasonably allocate the target physical device to the target virtual machine, based on the above embodiment, in one embodiment, each physical device includes at least one of a network card and a disk, and the target physical device that can be used by the target virtual machine can be accurately determined according to the prefix identifier corresponding to the specified device type. As shown in FIG. 4, the above S302 includes:
[0089] S401, obtaining a specified device type.
[0090] The specified device type includes a network card and / or a disk, that is, the specified device type may be a network card, a disk, or a network card and a disk. The specified device type may be determined in advance according to actual needs.
[0091] Optionally, a virtual machine creation policy is obtained, and the virtual machine creation policy is parsed to obtain a specified device type.
[0092] S402 , selecting a physical device having a prefix identifier corresponding to a specified device type in a PCI number from among the physical devices, and using the selected physical device as a target physical device for use by a target virtual machine on the physical machine.
[0093] The prefix identifier is a field in the PCI number that can distinguish different device types. Among the PCI numbers of all physical devices, the PCI number with the prefix identifier corresponding to the specified device type is searched, and the physical device to which the found PCI number belongs is used as the target physical device.
[0094] Optionally, if the specified device type is a network card, the prefix identifier corresponding to the specified device type is an Ethernet card identifier, expressed as "eth"; if the specified device type is a disk, the prefix identifier corresponding to the specified device type is a disk array identifier, expressed as "raid".
[0095] This embodiment determines the corresponding target physical device from the physical devices of the physical machine through a prefix identifier corresponding to a predetermined specified device type, thereby allocating the required target physical device to the target virtual machine to be created. The target physical device cannot be used by the physical machine, thereby achieving mutual isolation of physical devices between the physical machine and the target virtual machine.
[0096] In order to successfully deploy the corresponding target virtual machine on each physical machine, based on the above embodiment, in one embodiment, the image file of the target virtual machine may be deployed first, and then the virtual machine configuration file of the target virtual machine may be modified, as shown in FIG. 5 , and the above S202 includes:
[0097] S501, creating an image file of a target virtual machine on a physical machine through a target physical device.
[0098] The image file of the target virtual machine refers to an ISO image file, that is, a file stored according to ISO-9660 CD-ROM file system standards.
[0099] Specifically, when a toolkit required for creating a target virtual machine is installed on the physical machine, the service corresponding to the toolkit can be started and run through the target physical device, and related tools in the toolkit can be used to create an image file of the target virtual machine on the physical machine.
[0100] Optionally, a pre-stored image file of the target virtual machine to be created is obtained, and the pre-stored image file is migrated to a corresponding storage directory of the target virtual machine to be created.
[0101] S502: Add the identifier BDF of the target physical device to the virtual machine configuration file of the target virtual machine.
[0102] The identifier BDF is uniquely corresponding to the physical device, and the identifier BDF of each physical device is inconsistent. Generally, the identifier BDF refers to the Bus number, Device number and Function number. The identifier BDF in this embodiment can be the Bus number, Slot number and Function number.
[0103] For example, the identifier BDF of the target physical device is represented as "03:00.1", where "03" represents the Bus number of the target physical device, "00" represents the Slot number of the target physical device, and "1" represents the Function number of the target physical device.
[0104] The identifier BDF of the target physical device is written into the virtual machine configuration file of the target virtual machine, so that the target physical device can be used when the target virtual machine is started.
[0105] In an optional embodiment, an identifier BDF of the target physical device is obtained from a preset configuration file; wherein the identifier BDF includes a bus number, a slot number, and a function number.
[0106] The preset configuration file is used to store various configuration files required to create the target virtual machine. The preset configuration file can be pre-set according to the actual needs of cloud platform deployment. For example, the preset configuration file stores "<addressdomain=‘0x0000’bus=‘0x05’slot=‘0x00’function=‘0x1’ / > ", you can find the identifier BDF of the target physical device from the configuration file and then write it into the virtual machine configuration file.
[0107] Optionally, a virtual machine creation policy is obtained, and the virtual machine creation policy is parsed to obtain a preset configuration file.
[0108] This embodiment provides a prerequisite for the normal startup and operation of the target virtual machine by first creating an image file of the target virtual machine and then modifying the virtual machine configuration file of the target virtual machine. The BDF identifier of the target physical device is added to the virtual machine configuration file, so that the target physical device can be transparently transmitted to the target virtual machine and the target physical device can be bound to the target virtual machine, so that the target physical device can be used when the target virtual machine is started, thereby achieving high-performance operation of the target virtual machine.
[0109] In order to allocate the target physical device to the target virtual machine for use by hardware transparent transmission, based on the above embodiment, in one embodiment, the creation of the target virtual machine can be implemented based on the virtualization platform management service and the QEMU (Quick Emulator, virtual operating system simulator) process, as shown in FIG6 , the above S501 includes:
[0110] S601, start the virtualization platform management service through the target physical device to run the virtual operating system simulator QEMU process.
[0111] Among them, the virtualization platform management service is the Libvirt service. The Libvirt service can provide management of virtual machines and corresponding virtualization devices, networks, and storage. It can serve as an intermediate adaptation layer between physical machines and virtual machines and provide a stable management API (Application Programming Interface).
[0112] Start the Libvirt service on the target physical device and check whether the Libvirt service is started successfully. If the Libvirt service status is "Active", it means that the Libvirt service is started successfully. Start the Libvirt service on the target physical device to run the QEMU process.
[0113] Optionally, the target physical device starts a QEMU component and checks whether QEMU is started successfully, wherein QEMU is a general open source computer emulator and virtualizer.
[0114] It should be noted that the Libvirt service corresponds to the toolkit for the virtualization platform management service required to create the target virtual machine, and the QEMU process corresponds to the toolkit for the virtual machine image required to create the target virtual machine. By parsing the toolkits installed on the physical machine, the Libvirt service can be started through the target physical device to run the QEMU process and enter the virsh management mode of the Libvirt service.
[0115] S602, running the image creation command of the QEMU process through the target physical device to create an image file of the target virtual machine on the physical machine.
[0116] The target physical device uses the image creation command qemu-img of QEMU in the QEMU process to create an image file of the target virtual machine on the physical machine. Specifically, the target physical device uses the create command of the qemu-img tool to create the image file.
[0117] The image file of the target virtual machine may correspond to different image formats, such as qcow2 image format and raw image format, wherein both qcow2 image format and raw image format are disk image formats supported by QEMU.
[0118] In an optional embodiment, if the device type of the target physical device is a disk, the image creation command corresponding to the target disk image format of the QEMU process is run through the target physical device to create an image file of the target virtual machine with the image format being the target disk image format on the physical machine.
[0119] The target disk image format is the qcow2 image format. The image creation command corresponding to the target disk image format can be expressed as "qemu-img create -f qcow2 xxx.qcow2 xG", where "xxx" refers to the file name of the created image file, and "xG" refers to the file size of the created image file.
[0120] This embodiment can complete the creation of the image file of the target virtual machine through the Libvirt service and the QEMU process. Based on the image file of the target virtual machine and in combination with the virtual machine configuration file of the target virtual machine, the target virtual machine can be installed on the physical machine. The Libvirt service and the QEMU process can be applied to different physical machines to ensure the reliability of creating the image file of the target virtual machine.
[0121] In order to run the storage software of the cloud platform on the target virtual machine to achieve physical isolation between the platform software and the storage software of the cloud platform, based on the above embodiment, in one embodiment, when the platform operating system is installed on the physical machine, the storage operating system can be installed on the target virtual machine accordingly, as shown in FIG. 7, the above S203 includes:
[0122] S701, installing a storage operating system of the cloud platform in the created target virtual machine.
[0123] It is understandable that the created target virtual machine is a bare virtual machine, and the operating system has not been installed. The target virtual machine is started to connect the target virtual machine to the target physical device, and then the virtual machine image of the target virtual machine is mounted to the CD-ROM to deploy the storage operating system of the cloud platform in the target virtual machine.
[0124] The storage operating system of the cloud platform deployed in the target virtual machine and the platform operating system of the cloud platform deployed in the physical machine can be the same or different types of operating systems, and this embodiment does not limit this. The storage operating system is used to run the storage software of the cloud platform, and the platform operating system is used to run the cloud platform software of the cloud platform. The storage operating system and the platform operating system are physically isolated from each other, so as to avoid conflicts between the storage software and the cloud platform software, and avoid incompatibility between the storage operating system and the platform operating system.
[0125] S702, changing the boot mode of the operating system stored in the virtual machine configuration file of the target virtual machine from image boot to hard disk boot.
[0126] After the storage operating system is installed, the storage operating system is written to the corresponding disk of the target virtual machine. Further, the startup item is modified in the virtual machine configuration file of the target virtual machine to change the startup mode of the storage operating system from image startup, i.e., cdrom startup, to hard disk startup, i.e., hd startup.
[0127] This embodiment installs a storage operating system in the target virtual machine and modifies the startup method of the storage operating system, thereby getting rid of the mutual dependence between the cloud platform software and the storage software, and the platform operating system and the storage operating system, and realizing the isolation between the cloud platform services and storage services of the cloud platform without being restricted by the environment, thereby deploying two services of the cloud platform on the same physical machine, reducing the difficulty of cloud platform deployment and improving the applicability and reliability of cloud platform deployment.
[0128] In one embodiment, an optional example of a cloud platform deployment method is provided, as shown in FIG8 , including the following steps:
[0129] S801, when the platform operating system of the cloud platform has been deployed on the physical machine, a device query command is called to obtain the PCI number of each physical device of the physical machine.
[0130] Each physical device includes at least one of a network card and a disk.
[0131] S802, obtaining a specified device type.
[0132] The specified device type includes a network card and / or a disk.
[0133] S803 , selecting a physical device having a prefix identifier corresponding to a specified device type in a PCI number from among the physical devices, and using the selected physical device as a target physical device for use by a target virtual machine on the physical machine.
[0134] If the specified device type is a network card, the prefix identifier corresponding to the specified device type is an Ethernet card identifier; if the specified device type is a disk, the prefix identifier corresponding to the specified device type is a disk array identifier.
[0135] S804, start the virtualization platform management service through the target physical device to run the QEMU process.
[0136] S805, running the image creation command of the QEMU process through the target physical device to create an image file of the target virtual machine on the physical machine.
[0137] Among them, if the device type of the target physical device is a disk, the image creation command corresponding to the target disk image format of the QEMU process is run through the target physical device to create an image file of the target virtual machine with the image format being the target disk image format on the physical machine.
[0138] S806: Obtain an identifier BDF of the target physical device from a preset configuration file.
[0139] The identifier BDF includes a bus number, a slot number and a function number.
[0140] S807, adding the identifier BDF of the target physical device to the virtual machine configuration file of the target virtual machine to complete the creation of the target virtual machine on the physical machine.
[0141] S808, installing the storage operating system of the cloud platform in the created target virtual machine.
[0142] S809, changing the boot mode of the operating system stored in the virtual machine configuration file of the target virtual machine from image boot to hard disk boot.
[0143] The specific process of the above steps can be found in the description of the above method embodiment. The implementation principles and technical effects are similar and will not be repeated here.
[0144] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0145] Based on the same inventive concept, the embodiment of the present application also provides a cloud platform deployment device for implementing the cloud platform deployment method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more cloud platform deployment device embodiments provided below can refer to the limitations of the cloud platform deployment method above, and will not be repeated here.
[0146] In one embodiment, as shown in FIG9 , a cloud platform deployment device 1 is provided, comprising a determination module 10, a creation module 20 and a deployment module 30, wherein:
[0147] The determination module 10 is used to determine a target physical device for use by a target virtual machine on the physical machine from among various physical devices of the physical machine when the platform operating system of the cloud platform has been deployed on the physical machine.
[0148] The creation module 20 is used to create a target virtual machine on a physical machine based on the target physical device.
[0149] The deployment module 30 is used to deploy the storage operating system of the cloud platform in the created target virtual machine.
[0150] In one embodiment, based on FIG. 9 , as shown in FIG. 10 , the determination module 10 may include:
[0151] The calling unit 11 is used to call a device query command to obtain the PCI number of each physical device of the physical machine.
[0152] The determination unit 12 is used to determine a target physical device for use by a target virtual machine on the physical machine from among the physical devices according to the PCI numbers of the physical devices.
[0153] In one embodiment, each physical device includes at least one of a network card and a disk, and the determination unit 12 may include:
[0154] Gets the subunit, used to get the specified device type.
[0155] The specified device type includes a network card and / or a disk.
[0156] The determination subunit is used to select a physical device having a prefix identifier corresponding to a specified device type in a PCI number from among the physical devices, and use the selected physical device as a target physical device for use by a target virtual machine on the physical machine.
[0157] In one embodiment, if the specified device type is a network card, the prefix identifier corresponding to the specified device type is an Ethernet card identifier; if the specified device type is a disk, the prefix identifier corresponding to the specified device type is a disk array identifier.
[0158] In one embodiment, based on FIG. 9 , as shown in FIG. 11 , the creation module 20 may include:
[0159] The creation unit 21 is used to create an image file of a target virtual machine on a physical machine through a target physical device.
[0160] The configuration unit 22 is used to add the identifier BDF of the target physical device to the virtual machine configuration file of the target virtual machine; wherein the identifier BDF includes a bus number, a slot number and a function number.
[0161] In one embodiment, the creation unit 21 may include:
[0162] The startup subunit is used to start the virtualization platform management service through the target physical device to run the QEMU process.
[0163] The creation subunit is used to run the image creation command of the QEMU process through the target physical device to create an image file of the target virtual machine on the physical machine.
[0164] In one embodiment, if the device type of the target physical device is a disk, the above-mentioned creation subunit is used to run the image creation command corresponding to the target disk image format of the QEMU process through the target physical device to create an image file of the target virtual machine with the image format being the target disk image format on the physical machine.
[0165] In one embodiment, based on FIG. 11 , as shown in FIG. 12 , the creation module 20 may further include:
[0166] The acquiring unit 23 is configured to acquire an identifier BDF of a target physical device from a preset configuration file.
[0167] In one embodiment, based on FIG. 9 , as shown in FIG. 13 , the deployment module 30 may include:
[0168] The installation unit 31 is used to install the storage operating system of the cloud platform in the created target virtual machine.
[0169] The configuration unit 32 is used to change the startup mode of the operating system stored in the virtual machine configuration file of the target virtual machine from image startup to hard disk startup.
[0170] Each module in the above-mentioned cloud platform deployment device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0171] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in FIG14. The computer device includes a processor, a memory, and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a specified device type. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a cloud platform deployment method is implemented.
[0172] Those skilled in the art will understand that the structure shown in FIG. 14 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0173] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned cloud platform deployment method when executing the computer program.
[0174] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned cloud platform deployment method are implemented.
[0175] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned cloud platform deployment method when executed by a processor.
[0176] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0177] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0178] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A cloud platform deployment method, characterized in that: The method comprises: In the case where the platform operating system of the cloud platform has been deployed on the physical machine, determining a target physical device for use by a target virtual machine on the physical machine from among the physical devices of the physical machine; Starting a virtualization platform management service through the target physical device to run a virtual operating system simulator QEMU process; Run the image creation command of the QEMU process through the target physical device to create an image file of the target virtual machine on the physical machine; wherein the image creation command includes the image format, file name and file size of the image file; Adding the identifier BDF of the target physical device to the virtual machine configuration file of the target virtual machine; wherein the identifier BDF includes a bus number, a slot number and a function number; The storage operating system of the cloud platform is deployed in the created target virtual machine.
2. The method according to claim 1, characterized in that The step of determining, from among the physical devices of the physical machine, a target physical device for use by a target virtual machine on the physical machine comprises: Calling a device query command to obtain the PCI number of the peripheral component expansion interface of each physical device of the physical machine; According to the PCI number of each physical device, a target physical device for use by the target virtual machine on the physical machine is determined from the physical devices.
3. The method according to claim 2, characterized in that Each physical device includes at least one of a network card and a disk, and determining a target physical device for use by a target virtual machine on the physical machine from each physical device according to a PCI number of each physical device includes: Obtaining a specified device type; wherein the specified device type includes a network card and / or a disk; A physical device having a prefix identifier corresponding to the specified device type in a PCI number is selected from each physical device, and the selected physical device is used as a target physical device for use by a target virtual machine on the physical machine.
4. The method according to claim 1, characterized in that: The step of running the image creation command of the QEMU process through the target physical device to create the image file of the target virtual machine on the physical machine includes: If the device type of the target physical device is a disk, the image creation command corresponding to the target disk image format of the QEMU process is run through the target physical device to create an image file of the target virtual machine with the image format of the target disk image format on the physical machine.
5. The method according to claim 1, characterized in that The step of deploying the storage operating system of the cloud platform in the created target virtual machine includes: Installing the storage operating system of the cloud platform in the created target virtual machine; The startup mode of the storage operating system in the virtual machine configuration file of the target virtual machine is changed from image startup to hard disk startup.
6. A cloud platform deployment device, characterized in that: The device comprises: A determination module, used to determine, from various physical devices of the physical machine, a target physical device for use by a target virtual machine on the physical machine, when the platform operating system of the cloud platform has been deployed on the physical machine; A creation module is used to start a virtualization platform management service through the target physical device to run a virtual operating system simulator QEMU process; run an image creation command of the QEMU process through the target physical device to create an image file of the target virtual machine on the physical machine; wherein the image creation command includes the image format, file name and file size of the image file; add an identifier BDF of the target physical device to a virtual machine configuration file of the target virtual machine; wherein the identifier BDF includes a bus number, a slot number and a function number; A deployment module is used to deploy the storage operating system of the cloud platform in the created target virtual machine.
7. The device according to claim 6, characterized in that The determination module comprises: A calling unit, used for calling a device query command to obtain a PCI number of each physical device of the physical machine; The determination unit is used to determine, from among the physical devices, a target physical device for use by the target virtual machine on the physical machine according to the PCI number of each physical device.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 5 when being executed by a processor.
Citation Information
Patent Citations
Distributed storage calling method, device and apparatus
CN109375874A
Method and device for testing business continuity of Linux cloud host on cloud computing platform
CN111538562A
Secure communication using a trusted virtual machine
US8656482B1
