CN113835644B - Complete machine migration method, device, equipment and storage medium - Google Patents

Complete machine migration method, device, equipment and storage medium Download PDF

Info

Publication number
CN113835644B
CN113835644B CN202111417159.XA CN202111417159A CN113835644B CN 113835644 B CN113835644 B CN 113835644B CN 202111417159 A CN202111417159 A CN 202111417159A CN 113835644 B CN113835644 B CN 113835644B
Authority
CN
China
Prior art keywords
disk
migration
data
machine
target machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111417159.XA
Other languages
Chinese (zh)
Other versions
CN113835644A (en
Inventor
程方全
简德书
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Clerware Technology Co ltd
Original Assignee
Shenzhen Clerware Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Clerware Technology Co ltd filed Critical Shenzhen Clerware Technology Co ltd
Priority to CN202111417159.XA priority Critical patent/CN113835644B/en
Publication of CN113835644A publication Critical patent/CN113835644A/en
Application granted granted Critical
Publication of CN113835644B publication Critical patent/CN113835644B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/119Details of migration of file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0664Virtualisation aspects at device level, e.g. emulation of a storage device or system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0665Virtualisation aspects at area level, e.g. provisioning of virtual or logical volumes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Abstract

The invention belongs to the field of data migration, and discloses a complete machine migration method, a complete machine migration device, complete machine migration equipment and a storage medium. The method comprises the steps of generating a virtual disk mapped by disk data on a migration target machine; determining a system file in the disk data through the virtual disk; acquiring hardware information of a target host; correcting the system file according to the hardware information of the target host; and writing the corrected system file back to the hard disk of the target host through the virtual disk. According to the method and the device, the virtual disk mapped by the disk data on the migration target machine is generated, the system file in the disk data is determined according to the virtual disk, and then the system file is corrected.

Description

Complete machine migration method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data migration technologies, and in particular, to a complete machine migration method, device, apparatus, and storage medium.
Background
At present, there are many migration requirements for an operating system and a service, and hardware environments of a source machine and a target machine which are migrated are generally different, so that after data migration, if a system is directly started on the target machine, system start failure may be caused because the migrated operating system does not have a corresponding hardware driver installed, or an unsuitable software program and configuration exist, so that the migrated system needs to be modified so that the migrated operating system is compatible with the hardware environment of the target machine. The common practice is to run a simplified operating system on the target machine, receive data transmitted from the source machine through the network, and after the migration is completed, modify the migrated system (such as adding a driver and modifying system configuration) through the simplified operating system so as to adapt to the hardware of the target host. Because the system is simplified, many functions and application programs are cut off, the system after the migration is modified is troublesome (for example, the disk format, the file system format, the boot configuration file format and the like of the system to be migrated cannot be identified), the flexibility is poor, if the system is not simplified, the system is too large, the transmission between the network and the medium is too time-consuming, and the migration efficiency is reduced.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a complete machine migration method, a complete machine migration device, complete machine migration equipment and a storage medium, and aims to solve the technical problems that corresponding functions are lacked and flexibility is lacked when a simplified operating system is used for correcting a migration target machine in the prior art.
In order to achieve the purpose, the invention provides a complete machine migration method, which comprises the following steps:
generating a virtual disk mapped by disk data on a migration target machine;
determining a system file in the disk data through the virtual disk;
acquiring hardware information of the migration target machine;
correcting the system file according to the hardware information;
and writing the corrected system file back to the hard disk of the migration target machine through the virtual disk.
Optionally, the step of generating a virtual disk to which the disk data on the migration target machine is mapped includes:
receiving disk mapping information sent by a migration target machine;
acquiring the disk data of the migration target machine according to the disk mapping information;
and generating a virtual disk according to the disk data.
Optionally, the step of generating a virtual disk according to the disk data includes:
acquiring the number of disks and the size of the disks on the migration target machine according to the disk data;
and generating a virtual disk according to the number of the disks and the size of the disks.
Optionally, the step of determining, by the virtual disk, a system file in the disk data includes:
reading data in the disk data through the virtual disk to obtain disk partition information;
determining the type of the disk partition according to the disk partition information;
organizing the disk data into a roll according to the type of the disk partition;
system files are searched on the volume.
Optionally, the step of modifying the system file according to the hardware information includes:
searching a target driver corresponding to the hardware information in a preset driver library, and adding the target driver to the migration target machine;
adding or deleting part of software programs according to the hardware information of the migration target machine;
and adjusting the guide parameters of the migration target machine according to the hardware information of the migration target machine.
Optionally, after the step of writing back the modified system file to the hard disk of the migration target machine through the virtual disk, the method further includes:
and informing the virtual disk drive to destroy the virtual disk.
In addition, to achieve the above object, the present invention further provides a complete machine transfer apparatus, including:
the generation module is used for generating a virtual disk mapped by the disk data on the migration target machine;
the system file determining module is used for determining a system file in the disk data through the virtual disk;
the acquisition module is used for acquiring the hardware information of the migration target machine;
the correction module is used for correcting the system file according to the hardware information;
and the write-back module is used for writing back the corrected system file to the hard disk of the migration target machine through the virtual disk.
In addition, in order to achieve the above object, the present invention further provides a complete machine migration apparatus, including: the system comprises a memory, a processor and a complete machine migration program which is stored on the memory and can run on the processor, wherein the complete machine migration program is configured to realize the steps of the complete machine migration method.
In addition, to achieve the above object, the present invention further provides a storage medium, on which a complete machine migration program is stored, and the complete machine migration program, when executed by a processor, implements the steps of the complete machine migration method as described above.
The method comprises the steps of generating a virtual disk mapped by disk data on a migration target machine; determining a system file in the disk data through the virtual disk; acquiring hardware information of a target host; correcting the system file according to the hardware information of the target host; and writing the corrected system file back to the hard disk of the target host through the virtual disk. According to the method and the device, the virtual disk mapped by the disk data on the migration target machine is generated, the system file in the disk data is determined according to the virtual disk, and then the system file is corrected.
Drawings
Fig. 1 is a schematic structural diagram of a complete machine migration device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a complete machine migration method according to a first embodiment of the present invention;
FIG. 3 is a schematic diagram of a mapping process of a migrated target machine in a first embodiment of the complete machine migration method according to the present invention;
FIG. 4 is a flowchart illustrating a complete machine migration method according to a second embodiment of the present invention;
fig. 5 is a block diagram of the whole machine migration apparatus according to the first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a complete machine migration device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the complete machine migration apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the overall machine-migrating apparatus, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include an operating system, a network communication module, a user interface module, and a whole machine migration program therein.
In the whole machine migration apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the complete machine migration apparatus of the present invention may be arranged in the complete machine migration apparatus, and the complete machine migration apparatus calls the complete machine migration program stored in the memory 1005 through the processor 1001 and executes the complete machine migration method provided by the embodiment of the present invention.
Based on the complete machine migration device, an embodiment of the present invention provides a complete machine migration method, and referring to fig. 2, fig. 2 is a schematic flow diagram of a first embodiment of the complete machine migration method according to the present invention.
In this embodiment, the complete machine migration method includes the following steps:
step S10: and generating a virtual disk mapped by the disk data on the migration target machine.
It should be noted that the execution subject of the embodiment may be a computing service device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, a personal computer, etc., or an electronic device or a correction service system capable of implementing the above functions. The present embodiment and the following embodiments will be described below by taking the correction service system as an example.
It should be noted that the migration target machine may be a computer that receives the migrated data when the data migration operation is performed. Correspondingly, the migration source machine may be a host that needs system or service migration, and is used to provide migrated data, where the migrated data includes operating system data and other service data. The disk data may be data migrated from the migration source machine to the migration target machine. The virtual disk may be a disk generated by a fix-up service system based on the mapping of the disk data.
It should be understood that if the migrated system and the thin operating system in the migration target machine are not of the same type, system modifications are almost impossible, for example, if the migrated system is linux and the thin operating system in the migration target machine is windows, system modifications cannot be performed because windows cannot identify the file system and virtual volume of linux; in addition, the hardware device driver library is very large and is not suitable for being integrated into a compact system. Therefore, several types of revision service systems need to be preset, and different types of operating systems can be configured and revised.
In a specific implementation, the migration source machine migrates all the disk data to the disk of the migration target machine, after the data migration is completed, in order to enable the correction service system to correct the migrated operating system, the disk data needs to be mapped to the correction service system corresponding to the operating system in the disk data, and after the data migration is completed, the type of the migrated operating system needs to be simply identified (it is not necessary to identify all the data on the disk) so as to map the disk data to the correction service system corresponding to the type of the operating system. Therefore, several types of modification service systems, such as windows, linux, macos, aix … …, etc., need to be preset, all of which are in a running state, are complete operating systems, have various system modification programs installed, and all integrate a huge driver library, so that configuration and modification can be performed on the same type of operating systems, for example: and importing a hardware device driver, configuring an ip address of a network card and the like. And after the correction service system corresponding to the migrated operating system is identified, mapping the disk data on the migrated target machine to the correction service system so that the correction service system generates a virtual disk according to the mapped disk data. For example, the preset correction service system includes windows, linux, macos, and aix, and the migrated operating system is windows, the migration target machine maps the disk data to the correction service system whose operating system is windows, and the correction service system whose operating system is windows generates the virtual disk according to the disk data after receiving the disk data mapped by the migration target machine.
It should be understood that the migration target may run a thin operating system, receive disk data (including operating system data and service data) transmitted by the migration source machine through the network, after all the disk data are transmitted, the thin operating system may start a mapping connection program, the mapping connection program may first analyze all partitions on the disk, identify characteristics of volumes on the partitions (such as lvm of Linux, windows dynamic disks, and the like), characteristics of file systems, and characteristics of files on the file systems, and identify the type of the migrated system according to the characteristics of the volumes, so as to map the disk to the corresponding correction service system. For example, if the volume on the disk uses the ntfs file system, and directories such as Windows, Program Files, and ProgramData exist in the root directory of the file system, the migrated system may be considered as a Windows system; if file systems such as ext, xfs, btrfs and the like are used, and directories such as boot, etc., root, home, var and the like exist in a root directory of the file systems, the migrated system can be considered as a linux system; other system types may be identified in a manner similar to the principles described above, and so on, and the present embodiment is not limited thereto.
Step S20: and determining the system file in the disk data through the virtual disk.
It should be understood that, the determination of the system file in the disk data by the virtual disk may be that, after the virtual disk is created, the correction service system may read and write the virtual disk as reading the local disk, and further read the system file on the migration target machine.
In specific implementation, referring to fig. 3, fig. 3 is a schematic diagram of a mapping process of a migration target machine in a first embodiment of the complete machine migration method according to the present invention, for example, when an application program in a correction service system reads data of a virtual disk, a virtual disk drive can capture a read request, the read request carries information such as a disk offset and a size of a read data volume, the virtual disk drive forwards the read request to a mapping listener, the mapping listener forwards the read request to a mapping connector, and finally the mapping connector reads data of a corresponding size at the same offset of the disk of the corresponding migration target machine, and then returns the data to the mapping listener, and the mapping listener returns the data to the virtual disk drive, and finally the virtual disk drive completes the read request. For the write request, the operation principle is the same, and the data is finally written to the corresponding disk of the target host by the mapping connection program. The embodiment is not limited herein.
Further, the step S20 may include: reading data in the disk data through the virtual disk to obtain disk partition information; determining the type of the disk partition according to the disk partition information; organizing the disk data into a roll according to the type of the disk partition; system files are searched on the volume.
It should be understood that a partition is a portion of a physical disk that acts as a physically separate unit. A partition is typically referred to as a main partition or an extended partition. A volume is a storage area on a hard disk. The drive formats the volume using a file system (e.g., FAT or NTFS) and assigns a drive number to it. A hard disk includes multiple volumes, and a volume may span multiple disks.
It should be noted that the disk partition information may be disk partition information on the migration target machine. The disk type may be a GPT/MBR/RAW type or the like. The disk data may be organized into a roll in different ways according to the actual use of the disk partition. The volume is mounted, and a system file is searched for on the volume.
In a specific implementation, for example, when the correction service system starts to perform the correction operation, the disk type and the disk partition information on the disk of the migration target machine are first analyzed, where the disk type may be GPT/MBR/RAW, and the disk partition information may be obtained according to the disk type. For a disk that is not formatted, it is treated as a special disk. Then, analyzing the data in each disk partition, and identifying the actual use of the disk partition, where the actual use of the disk partition may include: the disk partition is used directly as an independent volume, the disk partition is only one of the members of a virtual volume, and the disk partition is only one of the members of a group of disks. And organizing the volumes in different organization modes according to different practical purposes of the disk partitions, identifying the file system of each volume, and mounting the volumes. After all the volumes are identified and mounted, searching system files on all the volumes, wherein the system files comprise a boot device of an operating system (such as grub of linux, bootmgr of windows, and winload), a boot parameter file (such as grub of linux, cfg file of windows, and BCD file of windows), a system kernel (including an initial RAM disk), a device driver (such as a disk controller and a driver of a network card) required for system startup, system configuration (such as a configuration file under the/etc directory of linux, and a registry of windows), services, and the like, and the files are usually located on a boot partition and a system volume of the system, and a system type and a system version number of the migrated system can be known through the files.
Step S30: correcting the system file according to the hardware information;
step S40: and writing the corrected system file back to the hard disk of the migration target machine through the virtual disk.
It should be noted that, modifying the system file according to the hardware information may be searching for a target driver corresponding to the hardware information in a preset driver library, and adding the target driver to the system file.
In specific implementation, acquiring hardware information of a migration target machine, including acquiring the size of a physical memory of the migration target machine; acquiring hardware identifiers of all hardware on a bus of a migration target machine; and identifying the hardware platform type of the migration target machine, and identifying manufacturer information of the virtualization platform if the migration target machine is the virtualization platform.
It should be noted that the physical memory is a physical memory configured on the migration target machine, and system call query of the simplified system can be used to learn that, because the size of the physical memory affects the operation of the system after migration, the system configuration of the system after migration needs to be adjusted according to the size of the physical memory of the migration target machine, so as to ensure that the system after migration is normally started. The hardware identifier refers to a manufacturer ID and a device ID of the hardware device, and the driver that the device needs to use can be known according to the hardware identifier. For a Windows system, hardware identifiers of all hardware on a bus can be obtained through system call; for the linux system, the hardware identification of all hardware on the bus can be obtained by scanning files under the/sys directory. The hardware platform type refers to whether the migration target machine is a physical computer or a virtual computer, and can know that the migration target machine is a physical machine if the ACPI information of the migration target machine contains information of computer manufacturers such as DELL and association … …, and is a virtual machine otherwise. For the virtual machine, vendor information of the virtualization platform also needs to be identified, system correction needs to be performed subsequently according to the vendor information, and for the identification of the vendor information, the identification can be identified by the BIOS information of the migration target machine, the description information of the virtual hardware device, and the description information … … of the PCI bridge device, for example, the BIOS information of the vendor virtualization platform a has a "sancor" character string, the virtual machine on the Xen virtualization platform has a PCI device of "VEN _5853& DEV _ 0002" or "VEN _5853& DEV _ C000", the PCI bridge of the Vmware virtualization platform has a "Vmware" character string … …, and the vendor information of the virtualization platform where the target host is located can be known by combining the information.
It should be noted that, modifying the system file according to the hardware information of the migration target machine includes: searching a target driver corresponding to the hardware equipment information in a preset driver library, and adding the driver into the migration target machine; adding or deleting part of software programs according to the hardware information of the migration target machine; and adjusting the guide parameters of the system according to the hardware information of the migration target machine.
It should be noted that the target driver may be a special program that enables the migration target machine and the hardware device on the migration target machine to communicate with each other. The operating system can only control the operation of the hardware device through the interface equivalent to the hardware interface. In order to more conveniently obtain the target driver corresponding to the hardware device information, a driver library may be preset, which includes almost all hardware devices and their corresponding drivers. And when the driver is added, acquiring the corresponding driver from the driver library according to the system version information of the migration target machine and all hardware information on the bus of the migration target machine, and installing the corresponding driver into the migration target machine.
Further, after the business system is migrated from the source host to the target host, some device drivers installed on the source host are no longer needed, and these extra drivers on the system need to be deleted to optimize the boot speed of the operating system or to avoid software compatibility problems (some drivers may cause system crash when running on incompatible hardware platforms). In addition, for a virtual machine on a virtualization platform, a vmtools program is generally installed, so that the virtualization platform can manage the virtual machine conveniently, when a service system of the virtual machine is migrated from one virtualization platform to another virtualization platform or the service system is migrated from the virtual machine to a physical machine, the vmtools program of the original virtualization platform is not needed, and can be unloaded, and the phenomenon that the virtual machine runs after migration and occupies resources of the system is avoided. Similarly, after the service system is migrated to the virtualization platform, vmtools corresponding to the target virtualization platform needs to be installed, so as to facilitate management of the target virtual machine by the virtualization platform.
Furthermore, the system configuration needs to be adjusted according to the physical memory size of the target host, so as to avoid the problem of system startup failure. For example, the linux/etc/sysctl.conf file specifies the use mode of the memory (for example, specifies the number of used large pages) after the system is started, and if the specified memory in the configuration file is larger than the physical memory of the target host, the system after migration is failed to be started, and the business system after migration cannot be used. Therefore, the start configuration file of the system needs to be adjusted according to the physical memory of the target host, so as to ensure that the migrated system can be started normally.
Further, in order to make the correction service system also usable for correction of other migration target machines, after step S40, the method further includes: and informing the virtual disk drive to destroy the virtual disk.
It should be understood that after the system file of the migration target machine is modified, all the mounted volumes need to be unloaded, the virtual disk drive is notified to destroy the virtual disk, and all the modified data is written back to the disk of the migration target machine, so that the system after migration completes the modification, and after the migration target machine is restarted, the system after migration is started. The modified data can be a disk data block which needs to be changed and configured when the system file is modified.
In this embodiment, data (including operating system data and other service data) of all disks of a migration source machine is migrated to a target disk of a migration target machine; after the data migration is finished, mapping a target disk of the migration target machine to an existing correction service system; then analyzing partition and volume information of all mapped disks in a correction service system, and identifying a system volume and an operating system type to obtain a system file needing to be corrected after the operating system is migrated; acquiring hardware information of the migration target machine, and correcting the system file on the mapped disk according to the hardware information of the migration target machine; because the read-write operation on the mapped disk is equal to the disk operation on the migration target machine, the system file of the migration target machine is equivalently corrected; and finally, starting an operating system of the migration target machine to complete the complete machine migration.
The embodiment generates a virtual disk mapped by disk data on a migration target machine; determining a system file needing to be corrected in the disk data through the virtual disk to acquire hardware information of the migration target machine; and correcting the migrated operating system according to the hardware information, and writing the corrected disk data back to the disk of the target host, thereby finishing the correction of the migrated system. Since the disk data of the migrated target machine is mapped into other correction service systems (the system is a complete system and is provided with various tools for system correction, formats of various file systems and configuration files on operating systems of the same type can be correctly identified and corrected), and then the disk data after migration is corrected by using the correction service system, compared with the existing method for correcting the migrated target machine by using a simplified operating system, the method can more conveniently and flexibly correct the migrated target machine.
Referring to fig. 4, fig. 4 is a flowchart illustrating a complete machine migration method according to a second embodiment of the present invention.
Based on the first embodiment described above, in the present embodiment, the step S10 includes:
step S101: and receiving the disk mapping information sent by the migration target machine.
The disk mapping information may be disk data information and mapping request information of the migration target machine, which are sent by the migration target machine to the correction service system. The mapping connection program on the migration target machine sends the disk data information and the mapping request information to the mapping listener on the correction service system.
In a specific implementation, the correction service system receives, through the mapping listener, disk mapping information sent by the migration target machine through the mapping connection program, as can be seen in fig. 3.
Step S102: and acquiring the disk data of the migration target machine according to the disk mapping information.
It should be noted that the disk data may be information such as the number and size of the disks of the migration target machine, for example, the disk data indicates that there are 2 disks in the migration target machine, and the sizes are 500G and 1000G, respectively.
Step S103: and generating a virtual disk according to the disk data.
It should be noted that, the generating of the virtual disk according to the disk data may be generating virtual disks, the number of which is the same as that of the disks in the migration target machine, on the correction service system according to the number of the disks in the disk data. For example, there are two disks in the migration target machine, i.e., two disks are generated on the fix-up service system.
Further, for more conveniently and flexibly completing the migration of the data, the step S103 may include: acquiring the number of disks and the size of the disks on the migration target machine according to the disk data; and generating a virtual disk according to the number of the disks and the size of the disks.
It should be noted that the number of disks may be the number of disks on the migration target machine. The size of the disk may be a size corresponding to each disk on the migration target machine, for example, the size of the disk may be 500G or 1000G.
In a specific implementation, assuming that the mapping linker recognizes that the migrated system is a linux system, the mapping linker connects to the mapping listener of the linux correction service system through the network, and then reports all disk information to the correction service system (including the number and size of disks, assuming 2 disks, the size is 500G and 1000G, respectively). After receiving the information, the mapping monitor informs the virtual disk drive to create 2 virtual disks, the sizes of which are 500G and 1000G, respectively, and after the creation, the operating system can read and write the 2 virtual machine disks like a local disk.
The embodiment receives the disk mapping information sent by the migration target machine; acquiring the disk data of the migration target machine according to the disk mapping information; acquiring the number of disks and the size of the disks on the migration target machine according to the disk data; and generating a virtual disk according to the number of the disks and the size of the disks. In this embodiment, the virtual disk is generated on the correction service system according to the number of disks and the size of the disks by obtaining the number of disks and the size of the disks on the migration target machine, so that the correction service system can read and write the disk data on the migration target machine through the virtual disk. And then the correction work of the migration target machine is completed through the correction service system, so that the correction work of the migration target machine can be more convenient and flexible.
Based on the foregoing embodiments, in this embodiment, the adding the target driver to the migration target machine by the step may include: acquiring an operating system type corresponding to the disk data through the virtual disk; and selecting a corresponding adding mode according to the type of the operating system to add the target driver into the migration target machine.
It should be noted that the operating system type may be an operating system type of the migration target machine, and may be windows, linux, macos, aix, and the like. The adding mode may be a mode of adding a driver corresponding to the operating system type. Adding the target driver into the migration target machine further needs to be performed according to the adding position of the driver in the system file. For example, for windows systems, additions may be made by way of a command line; for a Linux system, a driver needs to be copied to a preset directory under a system volume mounting path, then the initrd (Linux initial RAM disk) corresponding to the system is decompressed, and then the driver is copied to the directory corresponding to the decompression path. The manner of adding the driver to the migration target machine may also refer to other existing manners of adding, and the embodiment is not limited herein.
It should be understood that, different operating systems, the way of adding the driver may be different, and therefore, the corresponding adding way needs to be selected according to the type of the operating system.
In a specific implementation, for example, a process of adding a driver to a windows system at a time may be: mounting an inf file of a Driver into a system disk mounting path/Add-Driver/Driver through a Dism command tool to Add the Driver; the process of adding the driver to the linux system at a time may be that the driver is copied to a corresponding directory of the/lib/modules/kernel version/kernel/drivers in the system volume mount path, then the corresponding initrd of the system is decompressed, the driver is copied to a corresponding directory of the/lib/modules/kernel version/kernel/drivers in the decompression path, then the demod is called to regenerate the modules.
In this embodiment, the operating system type corresponding to the disk data is obtained through the virtual disk; and selecting a corresponding adding mode according to the type of the operating system to add the target driver into the migration target machine. In this embodiment, the target driver is added to the migration target machine by acquiring the operating system type corresponding to the disk data and selecting a corresponding adding manner according to the operating system type, so that the technical problem that the driver cannot be correctly added to the migration target machine when the operating systems are different is solved.
Referring to fig. 5, fig. 5 is a block diagram of a first embodiment of the complete machine migration apparatus according to the present invention.
As shown in fig. 5, the overall machine migration apparatus according to the embodiment of the present invention includes:
the generation module 10 is configured to generate a virtual disk mapped by disk data on the migration target machine;
a system file determining module 20, configured to determine a system file in the disk data through the virtual disk;
an obtaining module 30, configured to obtain hardware information of the migration target machine;
a modification module 40, configured to modify the system file according to the hardware information;
and the write-back module 50 is configured to write back the modified system file to the hard disk of the migration target machine through the virtual disk.
The embodiment generates a virtual disk mapped by disk data on a migration target machine; determining a system file needing to be corrected in the disk data through the virtual disk to acquire hardware information of the migration target machine; and correcting the migrated operating system according to the hardware information, and writing the corrected disk data back to the disk of the target host, thereby finishing the correction of the migrated system. Since the disk data of the migrated target machine is mapped into other correction service systems (the system is a complete system and is provided with various tools for system correction, formats of various file systems and configuration files on operating systems of the same type can be correctly identified and corrected), and then the disk data after migration is corrected by using the correction service system, compared with the existing method for correcting the migrated target machine by using a simplified operating system, the method can more conveniently and flexibly correct the migrated target machine.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the parameter operation method provided in any embodiment of the present invention, and are not described herein again.
Based on the first embodiment of the complete machine transfer device of the present invention, a second embodiment of the complete machine transfer device of the present invention is provided.
In this embodiment, the generating module 10 is further configured to receive disk mapping information sent by the migration target machine; acquiring the disk data of the migration target machine according to the disk mapping information; and generating a virtual disk according to the disk data.
Further, the generating module 10 is further configured to obtain the number of disks and the size of the disks on the migration target machine according to the disk data; and generating a virtual disk according to the number of the disks and the size of the disks.
Further, the system file determining module 20 is further configured to read data in the disk data through the virtual disk, and obtain disk partition information; determining the type of the disk partition according to the disk partition information; organizing the disk data into a roll according to the type of the disk partition; system files are searched on the volume.
Further, the modification module 40 is further configured to search a preset driver library for a target driver corresponding to the hardware information, and add the target driver to the migration target machine; adding or deleting part of software programs according to the hardware information of the migration target machine; and adjusting the guide parameters of the migration target machine according to the hardware information of the migration target machine.
Further, the write-back module 50 is further configured to notify the virtual disk drive to destroy the virtual disk.
Other embodiments or specific implementation manners of the complete machine migration apparatus of the present invention may refer to the above method embodiments, and are not described herein again.
In addition, an embodiment of the present invention further provides a storage medium, where a complete machine migration program is stored on the storage medium, and when executed by a processor, the complete machine migration program implements the steps of the complete machine migration method described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., a rom/ram, a magnetic disk, an optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A complete machine migration method is characterized by being applied to a correction service system and comprising the following steps:
generating a virtual disk mapped by disk data on a migration target machine;
determining a system file in the disk data through the virtual disk;
acquiring hardware information of the migration target machine;
correcting the system file according to the hardware information;
writing the corrected system file back to the hard disk of the migration target machine through the virtual disk;
the step of generating the virtual disk mapped by the disk data on the migration target machine includes:
receiving disk mapping information sent by a migration target machine;
acquiring the disk data of the migration target machine according to the disk mapping information;
generating a virtual disk according to the disk data;
and the disk data is data migrated from the migration source machine to the migration target machine.
2. The whole machine migration method according to claim 1, wherein the step of generating the virtual disk according to the disk data includes:
acquiring the number of disks and the size of the disks on the migration target machine according to the disk data;
and generating a virtual disk according to the number of the disks and the size of the disks.
3. The complete machine migration method according to any one of claims 1 to 2, wherein the step of determining the system file in the disk data through the virtual disk comprises:
reading data in the disk data through the virtual disk to obtain disk partition information;
determining the type of the disk partition according to the disk partition information;
organizing the disk data into a roll according to the type of the disk partition;
system files are searched on the volume.
4. The complete machine migration method according to any one of claims 1-2, wherein the step of modifying the system file according to the hardware information comprises:
searching a target driver corresponding to the hardware information in a preset driver library, and adding the target driver to the migration target machine;
adding or deleting part of software programs according to the hardware information of the migration target machine;
and adjusting the guide parameters of the migration target machine according to the hardware information of the migration target machine.
5. The complete machine migration method according to any one of claims 1 to 2, wherein after the step of writing back the modified system file to the hard disk of the migration target machine through the virtual disk, the complete machine migration method further comprises:
and informing the virtual disk drive to destroy the virtual disk.
6. A complete machine migration device is applied to a correction service system and is characterized by comprising:
the generation module is used for generating a virtual disk mapped by the disk data on the migration target machine;
the system file determining module is used for determining a system file in the disk data through the virtual disk;
the acquisition module is used for acquiring the hardware information of the migration target machine;
the correction module is used for correcting the system file according to the hardware information;
the write-back module is used for writing back the corrected system file to a hard disk of the migration target machine through a virtual disk;
the generation module is also used for receiving the disk mapping information sent by the migration target machine; acquiring the disk data of the migration target machine according to the disk mapping information; generating a virtual disk according to the disk data;
and the disk data is data migrated from the migration source machine to the migration target machine.
7. A complete machine migration device, characterized in that the device comprises: a memory, a processor and a complete machine migration program stored on the memory and executable on the processor, the complete machine migration program being configured to implement the steps of the complete machine migration method according to any one of claims 1 to 5.
8. A storage medium, wherein a complete machine migration program is stored on the storage medium, and when executed by a processor, the complete machine migration program implements the steps of the complete machine migration method according to any one of claims 1 to 5.
CN202111417159.XA 2021-11-26 2021-11-26 Complete machine migration method, device, equipment and storage medium Active CN113835644B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111417159.XA CN113835644B (en) 2021-11-26 2021-11-26 Complete machine migration method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111417159.XA CN113835644B (en) 2021-11-26 2021-11-26 Complete machine migration method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113835644A CN113835644A (en) 2021-12-24
CN113835644B true CN113835644B (en) 2022-03-01

Family

ID=78971579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111417159.XA Active CN113835644B (en) 2021-11-26 2021-11-26 Complete machine migration method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113835644B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114296810A (en) * 2021-12-29 2022-04-08 上海英方软件股份有限公司 Operating system migration method, device, server and storage medium
CN115390996B (en) * 2022-10-28 2024-02-02 安超云软件有限公司 Virtual machine migration method and device, computing equipment and storage medium
CN116149802B (en) * 2023-04-20 2023-09-12 深圳市科力锐科技有限公司 Data pushing method, device, storage medium and apparatus
CN116185571B (en) * 2023-04-20 2023-07-21 深圳市科力锐科技有限公司 Data migration method, device, storage medium and apparatus

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1589412A3 (en) * 2001-11-13 2008-12-31 Hitachi, Ltd. Computer data migration system
CN103605561A (en) * 2013-11-28 2014-02-26 中标软件有限公司 Cloud computing cluster system and method for on-line migration of physical server thereof
US10966122B2 (en) * 2016-12-07 2021-03-30 Telefonaktiebolaget Lm Ericsson (Publ) Method and migration managing module for managing a migration of a service
CN106933517A (en) * 2017-03-17 2017-07-07 深信服科技股份有限公司 A kind of data migration method and device
CN112612417B (en) * 2020-12-24 2023-08-08 深圳市科力锐科技有限公司 Data migration method, device, equipment and storage medium
CN113326105B (en) * 2021-08-04 2021-11-05 深圳市科力锐科技有限公司 Hardware equipment configuration method, device and equipment based on host migration

Also Published As

Publication number Publication date
CN113835644A (en) 2021-12-24

Similar Documents

Publication Publication Date Title
CN113835644B (en) Complete machine migration method, device, equipment and storage medium
US9811369B2 (en) Method and system for physical computer system virtualization
CN1315042C (en) Method and system for creating and using operation system with optional functions
CN101650660B (en) Booting a computer system from central storage
JP4855714B2 (en) System and method for accessing computer files across computer operating systems
US20070061818A1 (en) Detection of devices during operating system setup
WO2008132032A1 (en) Remotely deploying and automatically customizing workstation images
US6718373B1 (en) Method and system for installing files in a computing system
CN113326105B (en) Hardware equipment configuration method, device and equipment based on host migration
CN112612417B (en) Data migration method, device, equipment and storage medium
JP2000222179A (en) Computer system and method for operating computer system
CN112527398A (en) Personalized installation method and system of operating system
CN114138405A (en) Virtual machine creating method and device, electronic equipment and storage medium
CN107291507B (en) Upgrading method for virtual hard disk of virtual machine and electronic equipment
CN110825419B (en) Firmware refreshing method and device, electronic equipment and storage medium
CN112596950A (en) Virtual machine data backup method, device, equipment and storage medium
JP4759941B2 (en) Boot image providing system and method, boot node device, boot server device, and program
CN113377445B (en) Method and device for starting multiple operating systems from online disk
CN113254089B (en) System boot method correction method, device, equipment and storage medium
CN114816491A (en) System upgrading method and device for multi-system mobile terminal and terminal
CN113485756A (en) Hardware equipment configuration method, device, equipment and storage medium
US20040243385A1 (en) Emulation of hardware devices in a pre-boot environment
CN109471665B (en) Method for automatically installing Windows operating system
US20120284500A1 (en) Abstraction of computer disk image cloning capabilities from bootable media
KR20170037017A (en) Memory Upgrade System And Method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant