Sunday, September 13, 2009

vmware raw disks

Here's an odd setup... but I want to have only one computer turned on 24/7 in my house, this is what I'm doing:

Hardware:
  • Asus P5Q3 with 4gb RAM & Intel core 2 duo
  • 4 x 1.5TB drives (1.36 REAL terrabytes... damn you harddrive industry)

Vista 64-bit on "bare metal"... why Vista? because of the TV Tuner cards (Windows 2003 is no good for this task).

Responsibilities:
  • MediaPortal TV server
  • Printer Server
  • VMware host (VMware Server 2.0)

On this I run 3 x OpenSuSE 11 systems hosted in VMware server, each for a different purpose:
  • Asterisk PBX
  • Fileserver
  • General use host for fun

The crazyness of this system comes about through use of Vista as the base OS, and the fileserver as Linux. I want the linux fileserver to have direct access to each drive.

The drives are partitioned like so:

64gb NTFS partition
1333gb Data partition (ext3) (md software raid5)


Annoyingly VMware server 2 'apparently' removes the feature of raw disks... that is, drives that show up in the VMware without the need to create an intermediate VMware file-based disk.

To get around this, I installed the demo of VMware Workstation 6.5 and created the VMware machines.

Here's the definition of the rawdisk's in the .vmdk files:

# Disk DescriptorFile
version=1
encoding="windows-1252"
CID=a1a071cd
parentCID=ffffffff
createType="fullDevice"

# Extent description
RW 2930277168 FLAT "\\.\PhysicalDrive0" 0

# The Disk Data Base
#DDB

ddb.toolsVersion = "7458"
ddb.adapterType = "lsilogic"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "16"
ddb.geometry.cylinders = "16383"
ddb.uuid = "60 00 C2 9a 4e e3 4f 90-5f 74 f9 c8 0f 2b c1 f0"
ddb.virtualHWVersion = "7"


That makes the drive appear as a SCSI drive in the VMware, despite it being an IDE drive.


To give another example:

# Disk DescriptorFile
version=1
encoding="windows-1252"
CID=b362ecc3
parentCID=ffffffff
createType="fullDevice"

# Extent description
RW 2930277168 FLAT "\\.\PhysicalDrive3" 0

# The Disk Data Base
#DDB

ddb.toolsVersion = "7458"
ddb.adapterType = "lsilogic"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "16"
ddb.geometry.cylinders = "16383"
ddb.uuid = "60 00 C2 9b 2f e0 b6 75-8a da b5 7c 6c eb 0a 96"
ddb.virtualHWVersion = "7"



Then in the .vmx file:

scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"

scsi1:0.present = "TRUE"
scsi1:0.fileName = "vm_fileserver_d0.vmdk"
scsi1:0.deviceType = "rawDisk"
scsi1:1.present = "TRUE"
scsi1:1.fileName = "vm_fileserver_d1.vmdk"
scsi1:1.deviceType = "rawDisk"
scsi1:2.fileName = "vm_fileserver_d2.vmdk"
scsi1:2.present = "TRUE"
scsi1:2.deviceType = "rawDisk"
scsi1:3.present = "TRUE"
scsi1:3.fileName = "vm_fileserver_d3.vmdk"
scsi1:3.deviceType = "rawDisk"