continuum
Immortal
Immortal

Heavy weather approach for Coldclones to vSphere 7

As you probably have noticed  the old tools we used to coldclone to a vSphere environment are getting more and more outdated.
The old LiveCDs based on 2k3-32 will very likely fail to connect to vCenter because of outdated ssl-versions.
Another problems are outdated mouse-drivers ....

If you find yourself in a situation where you need to P2V old Windows-systems like NT, 2k3 or XP to a vSphere environment here is a procedure that will work.

I only explain the transport part of the job. For the patching part you would use a helper VM running a 2k3-VM with latest vmware-tools and eventually an old version of Converter ....

For the transport part of the job download this Linux LiveCD:
https://sanbarrow.com/livecds/moa64-nogui/MOA64-nogui-incl-src-111014-efi.iso

Boot the old Windows machine into it.
On a ESXi 7 host create a new empty directory and remember the full path: /vmfs/volumes/datastoreXY/directoryXY.
Enable SSH on the ESXi.

Once the LiveCD has finished booting you can log on to it as root with password sanbarrow.
SSH is enabled after boot so you can also log in via a putty session.

Figure out which drives need to be imported using fdisk -l.

Lets assume fdisk -l lists two physical drives sda and sdb.
To import both drives run the following commands:

sudo su
mkdir /esxi
sshfs root@ip-of-esxi:/vmfs/volumes/datastoreXY/directoryXY    /esxi   

# answer Yes to allow connection to an unknown host and enter the root-password of the ESXi

cd /esxi
ddrescue /dev/sda sda-flat.vmdk sda-copy.log
ddrescue /dev/sdb sdb-flat.vmdk sdb-copy.log

# if the ddrescue command reports lots of errors and does not finish as expected just rerun the commands in reverse order

ddrescue -R /dev/sda sda-flat.vmdk sda-copy.log
ddrescue -R /dev/sdb sdb-flat.vmdk sdb-copy.log

# if the network connection dies during the operation just restart using the same commands as before
# and the copy will proceed where it stopped/crashed last time
# this will only work if you tell ddrescue to create copy-logs
# so make sure to always launch the ddrescue-command from with the new directory you created in a datastore before

#When the copy is done run a quick check of the flat.vmdks
sgdisk -p sda-flat.vmdk # this should display the partition table of the disks/vmdks

Once the copy is done, create descriptor-vmdks for both flat.vmdks.
See https://communities.vmware.com/t5/VMware-vSphere-Discussions/Please-remove-https-kb-vmware-com-s-art...
or just use this sample:
------------------------------------------------------------------------------------------

###### sample descriptorfile for a basedisk
######
###### instructions:
###### 1. look up the name of the flat.vmdk
###### 2. look up the size of the flat.vmdk in bytes
###### use a calcular and do 2 calculations:
###### <size of the flat.vmdk in bytes> / 512 = XXX
###### XXX / 16065 = round down the result = YYY
###### now you have 3 parameters:
###### XXX - size in sectors
###### YYY - geometry value for cylinders
###### ZZZ - path of flat.vmdk
######
###### once you got those 3 parameters use the following
###### sample-file and replace XXX, YYY and ZZZ
###### with the values you figured out before
###### if the flat.vmdk was labelled "name-flat.vmdk"
###### store the small snippet as a plain textfile called "name.vmdk"
######
###### cut here:
# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=12345678
parentCID=12345678
createType="vmfs"

# Extent description
RW XXX VMFS "ZZZ"

# The Disk Data Base
#DDB

ddb.adapterType = "lsilogic"
ddb.geometry.cylinders = "YYY"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"

------------------------------------------------------------------------------------------


Next either add the boot-disk to a helper VM or create a new VM using the imported vmdks.
To do the patching you can now use Converter or manually patch the registry with a LiveCD using regedits loadhive function.

This procedure is very useful in unreliable network conditions and even more so in situations where the old disks are showing signs of corruption.
Drawback: no resize during the transport process

I recommend my own LiveCD just because it comes with ssh enabled after boot and because it already has sshfs installed - which is quite unusual for LinuxLiveCDs

Ulli

Do you need support with a recovery problem ? - send a message via skype "sanbarrow"
0 Kudos
0 Replies