# Physical => vmware ESXi conversion



## aamoruso (Oct 29, 2010)

Hi All,

I'm a Linux administrator, so I'm using the acquired knowledge so far to the FreeBSD environment: please be tolerant if I'm doing some mistakes here 

I have to convert a FreeBSD 6.4-based appliance from physical to a vmware ESXi image. The appliance is equipped with an IDE hdd, seen as ad0. Vmware offers SCSI drives seen as da0.

Following a howto found on Internet from the I was able to do the following steps:

1) Filesystem dump
Dumping the content of slices 1a, 1d, and 1f from the appliance, saving them as single files pa.dump, pd.dump and pf.dump on external storage.

2) Filesystem restore
Using the Fixit environment offered by the FreeBSD 6.4 CD I was able to run the following script on the target VM (/nfs is a NFS mounted dir hosting the dump files). The script is based on URL:

http://forums.freebsd.org/showthread.php?t=11680


```
#!/bin/sh
dd if=/dev/zero of=/dev/da0 count=4
fdisk -BI /dev/da0
bsdlabel -B -w da0s1
bsdlabel -R da0s1 /nfs/liveSPsizes
newfs -U /dev/da0s1a
newfs -U /dev/da0s1d
newfs -U /dev/da0s1e
newfs -U /dev/da0s1f

mount /dev/da0s1a /mnt
cd /mnt
restore -rvf /nfs/pa.dump

mount /dev/da0s1d /mnt/var
cd /mnt/var
restore -rvf /nfs/pd.dump

mount /dev/da0s1f /mnt/usr
cd /mnt/usr
restore -rvf /nfs/pf.dump

echo "Clean up"
sync
cd /
umount /mnt/usr
umount /mnt/tmp
umount /mnt/var
umount /mnt
sync
```

Where the file liveSPsizes


```
# /dev/ad0s1:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   524288        0    4.2BSD     2048 16384    94
  b:   526336   524288      swap
  c: 80292807        0    unused        0     0         # "raw" part, don't edit
  d:   524288  1050624    4.2BSD     2048 16384    94
  e:  2097152  1574912    4.2BSD     2048 16384    89
  f: 76620743  3672064    4.2BSD     2048 16384    89
```

Running it the filesystems get extracted without errors. When rebooting the VM and letting it proceed I get up to this on screen:


```
BTX loader 1.00 BTX version is 1.01
```

and after a while the sytem reboots.

In Linux the procedure for doing a physical => virtual conversion by hand is quite the same, but of course I'm missing something here which prevents the final process.

What am I doing wrong? Any ideas?

Thanks for your time and attention
    Angelo.


----------



## SirDice (Oct 29, 2010)

Why don't you take the opportunity to upgrade? At the end of november 6.4 will be EoL.

I'd make a list of the installed ports/packages on the old system and build a new 7.x on ESXi. Then transfer only the data.


----------



## aamoruso (Oct 31, 2010)

*Upgrading*

Hi,
porting to a more recent version of BSD is not a road I can take, for now.
I don't have BSD experience and the appliance is proprietary and not supported anymore from the supplier, so I cannot just extract the list of installed packages.

I need to port all the "physical appliance as a whole" to vmware environment, in order to be able to protect from hardware failures easily.


----------

