In short, I want the Microsoft iSCSI Software Target to expose a physical disk (from the OS' perspective) as an iSCSI unit, instead of using a file (a Microsoft-proprietary "virtual disk") as the backing storage. I'll explain why:
I have an ESXi 5 box and one of the VMs on it I am interested in testing out bare-metal on another server. (Notwithstanding the usual caveats about moving an OS installation onto different hardware - it's running Windows, which in my experience can usually tolerate being transplanted to different hardware.)
The spare server I want to bare-metal run this VM on has a NIC that supports iSCSI boot, so I figured I could get another VM in the ESXi box - call it diskserver - to expose the VM's disk image to the bare-metal server via iSCSI. In principle this should make it fairly easy to move the VM back and forth between running under ESXi and running bare-metal. When it runs bare-metal, it would be running off the same VMDK that was originally attached to it under ESXi.
I'm trying to use Windows Server on the diskserver to expose the VM's disk under iSCSI using the Microsoft iSCSI Software Target. I've tried both Server 2012 and 2008 R2. My idea was to attach a virtual HDD to the diskserver's VM which is backed by the same VMDK as the VM of interest uses. (Naturally they can't both be powered on at the same time.) I can do that no problem, but the problem is getting the MS iSCSI Software Target to use the attached drive.
The drive comes up fine in disk manager on the diskserver and it sees the partitions on it, even assigning a drive letter to the NTFS partition. The problem is that the iSCSI Target seems to have been designed under the assumption that we always want to expose storage backed by files, not by physical disks. (In reality it's not a physical disk, but the diskserver will see it as such.)
To clarify, I don't need the MS iSCSI Software Target to understand the VMDK format, since diskserver is running under ESXi and I'm making the VMDK appear to Windows Server as a physical disk.
I'm pretty sure STMF (SCSI Target Mode Framework) in Solaris would be able to do what I want, so worst-case I could spin a Solaris VM for this, but that's a bit tedious and I was hoping the MS iSCSI Software Target would be easier. Is there no way to make the MS iSCSI target back a target by a physical disk?
The Microsoft iSCSI target only supports using VHD files for storage. There is no support in any shipping version of Microsoft's iSCSI target to use a physical device or volume as the storage.