VMware Cloud Community
Procyonn
Contributor
Contributor

Is it possible to use physical SATA drives with an ESX4i Virtual Machine?

With VMware Workstation I can add physical hard drives to the virtual machine. I can't find a way to do this in ESX yet, does anyone have insight?

Here's my situation:

I had a physical Linux server with a software RAID 5. One 74GB boot drive, and 4x 500GB drives configured as a raid inside Linux, and LVM on top (so I can add drives and expand the LVM and partition later). I imaged the boot drive to my workstation, installed ESX onto a 160GB drive that's replacing the 74GB, and now have the Linux server's boot drive restored to a virtual hard drive. It boots up just fine, but the problem is that I can't get access to the 4 physical hard drives from inside the virtual machine. I can see them in the vSphere Client, but in order for me to add them to my virtual machine it looks like I'd have to format each of them VMFS, losing all my data.

I don't have any other storage to back up everything I have on there. Please don't waste your time or mine with rants on the importance of backups, I have a backup that's sufficient for irreplacable data, but I'd rather not have to waste the time re-aquiring the data on those drives that aren't backed up.

Thanks in advance!

0 Kudos
3 Replies
Procyonn
Contributor
Contributor

Okay, so I got some help from VMware support, and here's how to do it. This is an unsupported method, so if you do this and it doesn't work, or breaks anything, you're on your own.

To map a physical device to a virtual machine, you need a RDM (Raw Device Mapping) file, which looks like a small .vmdk file that tells the virtual machine how to interface with the drive.

The command used to generate the RDM file is:

vmkfstools -r <vml file> <destination file>

To find the <vml file>

1. SSH into the ESX box

2. ls /vmfs/devices/disks

3. Notice the symbolic links, find the one that looks like the drive being added

4. The vml.0100---etc (bunch of numbers) identifier pointing to that device is the vml file to be used in the command

Destination path should usually be the directory the Virtual Machine is

stored in, then the file can be named anything but needs the extension

.vmdk

As an example:

vmkfstools -r

/vmfs/devices/disks/vml.0100000000202020202057442d574d414e5331333332343535574443205744

/vmfs/volumes/Storage1/myVM

Once you've generated the file, just edit the Virtual Machine's

settings, add a hard drive, select Use Existing Virtual Disk and browse to the .vmdk file generated.

That worked for me, hope this helps someone else.

0 Kudos
Procyonn
Contributor
Contributor

VMware Support answered the question, hope this information will prove useful to others too.

0 Kudos
kobiegr
Contributor
Contributor

Thanks a lot for this info. I had an existingbox running Solaris 10 with 5 hard disks running ZFS filesystem which I migrated over to VMWare Esxi , and for ZFS to work Solaris needs access to the physical disks.Also please make it clear that the file extension needs to be added to the end of the file name in your example as the drives will not show up if it is not added.

0 Kudos