Hello !
i spent some thoughts on this and like to have some discussion about the pro`s and con`s about some (for now completely theoretical) Linux kernel feature which could probably be helpful regarding handling of physical/raw disk mappings and virtual disks.
Currently, i know of the following two disk related "issues" with vmware hosted products on Linux:
\- VMware Workstation/Server/Player can not handle devices besides /dev/hd... and /dev/sd...., so if you want to use raw disks on /dev/cciss/...., LVM, loopback, cryptoloop, SAN, iSCSI,SATA...whatever, the only reasonable way to go is using the vmware-bdwrapper "hack", which needs to be build separately and may be tricky to setup for the unexperienced user. This issue may be probably easy to fix in VMWare products, but nobody knows if or when VMware will do this. I don`t expect this happen in the near future since this may not only be a technical issue.
\- vmware-mount.pl also looks a little bit like a "hack" and having reported stability issues. It`s closely tied to NBD (Network Block Device). Sending all the data trough the network layer is rather weird method to map/mount a
file on your local system. It`s like opening a shell on your local GUI by doing ssh-login via localhost. So maybe it`s just time for a (better) replacement.
For some time, linux has a "device-mapper" subsystem which is a real mighty part of the kernel.
The idea which came to my mind is, to combine both vmware-bdwrapper and vmware-mount.pl into a common kernel module, probably some device-mapper related one called "dm-vmware", to provide a generic/all-purpose alternative to the tools mentioned above.
Things could look like this (adding some "vmware-mode" to dmsetup, communicating with dm-vmware):
"dmsetup -vmware -fakedisk /dev/sdvm\{##}|/dev/hdvm\{##} GenericBlockDeviceName|/path/to/RawDiskImageFilename" would create a device out of "GenericBlockDeviceName" or "RawDiskImageFilename" which VMware could use (and recognize) as a physical SCSI or IDE disk. That means, adding the necessary ioctls as bdwrapper does. Mind that VMWare built`in limitation where it checks for device names being named /dev/sd* or /dev/hd*.
"dmsetup -vmware -mountvmdk /dev/vmdk\{##} /path/to/VMdir/VmwareVirtualDiskFileName" would create a linear mapping
like vmware-mount.pl, so we could do "mount /dev/vmdk1p1 /mnt" and could access the contents of a virtual disk in a more perfomant and more stable way. We could even access the whole disk besides single partitions, which is not possible for now,AFAIK. Vmdk specification is available for the public and also being told to be GPL compatible.
I didn`t yet disgrace myself by posting this to lkml or dm-devel ,so i`d like to hear your comments.
regards
roland