Another method. Not the best, but in some cases also possible
This method can be used if the new hardware does not meet the minimum requirements for ESXi for some reason (for example, it has a single-core processor).
To implement this method, the following conditions must be met:
- The new hard drives should already be installed in the system and the old ones have not yet been removed.
- A USB flash drive or optical disk with Linux Live USB (CD) installed on it must be connected to the server. Live USB takes the convenient one.
When the top two points are met, do the following:
- Boot from Live USB.
- We display the list of available disks with the parted -l command. The output of this command must have at least two disks in it. Source disk (for example /dev/sda) with ESXi already installed on it and target disk (for example /dev/sdb).
- We look at what partitions are on the source disk using the sgdisk -p /dev/sda command. The output will be something like this:
Disk /dev/sda: 15679488 sectors, 7.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 3703B3D8-7FBE-4A3A-8526-FE24A6BF76DC
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 15679454
Partitions will be aligned on 32-sector boundaries
Total free space is 13836413 sectors (6.6 GiB)
Number Start (sector) End (sector) Size Code Name
1 64 8191 4.0 MiB EF00
5 8224 520191 250.0 MiB 0700
6 520224 1032191 250.0 MiB 0700
7 1032224 1257471 110.0 MiB FFFF
8 1257504 1843199 286.0 MiB 0700
- The next step is to rough copy the source disk to the target disk using the dd utility. Here you need to know how much to copy. Pay attention to the number of the last sector (in the example it is 1843199) and add one to it (because the sector numbering starts from zero).
Important! All information that was previously on the target disk will be deleted
dd =if/dev/sda of=/dev/sdb bs=512 count=1843200 This command clones all information from the source drive to the target drive.
- Next, we need to repair the partition table on the target disk. You can do this with the gdisk utility. The command looks like gdisk /dev/sdb and then: x (to enter the "expert menu"), e (to fix the disk layout), and w (to write the changes).
Congratulations. You should now have a working, absolute copy of your ESXi on the target drive.