I had a requirement to configure Two node Microsoft failover clustering on VMware VMs in my office, The plan was to configure clustered file server. Virtual machines has to be separated from each other and should be located on different esxi servers, My first task was to provide my colleague wintel engineers to provide shared disk from vmware, so they can start configuring clustering. For this I have achieved it using RDM - Raw Device Mapping disk. RDM is recognized as a pass-thru disk, and is a mapping file that performaces as a proxy for a physical device such as a LUN. When you choose to use RDM over VMDK datastore you get little bit better performance.
Before starting with RDM I have setup and prepared my Storage server and Esxi server, Created new 2 new Luns on Storage device, then configured VMKernel adapters on Esxi server, and rescaned hba adapter to list disk, at this point I didn't added and formatted datastores as VMFS. For more info on configuring storage and esxi check my below blog articles.
Warning: Windows iSCSI is not listed on VMWare HCL as Esxi iSCSI datastore. I am using it to show as a demo purpose.
MICROSOFT WINDOWS 2012 R2 ISCSI TARGET STORAGE SERVER FOR ESXI AND HYPERV
VMWARE ESXI CONFIGURE (VSWITCH) VMKERNEL NETWORK PORT FOR ISCSI STORAGE
To start, I have listed my 2 VMs, Select the first virtual machine 001, click Actions then Edit Settings from the list. In the bottom of edit settings wizard, Click select on the new device, choose SCSI Controller and click Add. Here I am adding Raw device mapping disk luns to separate SCSI controller. You can add total 4 virtual SCSI controllers and each controller can have 15 disks attached.
Expand New SCSI controller settings, on SCSI Bus sharing choose Physical, by doing this Virtual disks can be shared by virtual machines on any Esxi server. Keep setting for controller type to default (LSI Logic SAS).
None | Virtual disks cannot be shared by other virtual machines. |
Physical | Virtual disks can be shared by virtual machines on any Esxi server. |
Virtual | Virtual disks can be shared by virtual machines on the same Esxi server. |
Click Ok to proceed.
Next, Click on VM 001 again go to actions and select Edit Settings. Now from in the select list, choose RDM Disk and click Add.
This lists and pops upSelect Target Lun wizard, Select one of the Lun from list (Choose correct one by verifying correct NAA id). Click Ok.
Expand New hard disk, Select the location, and keep it on shared VMFS datastore. Make sure this datastore is visible on other esxi server where second VM is located. Compatibility mode should be physical.
Two compatibility modes are available for RDMs. Physical compatibility mode allows direct access of the SCSI device for those applications that need lower level control. Physical mode is useful to run SAN management agents or other SCSI target-based software in the virtual machine. Physical mode also allows virtual-to-physical clustering for cost-effective high availability. Virtual compatibility mode allows Raw Device Mapping to act precisely like a virtual disk file, including the use of clone and snapshots. You can realize the benefits of VMFS such as advanced file locking for data protection and snapshots for streamlining development processes.
Next the multi-writer sharing option allows VMFS-backed disks to be shared by multiple virtual machines. This option is also used to support VMware fault tolerance, which allows a primary virtual machine and a standby virtual machine to simultaneously access a .vmdk file.
Virtual Device Node is the option of selecting SCSI controller, where this new RDM disk will reside, I am selecting SCSI controller path 1:0 created earlier. Press Ok to get it added.
RDM Disk is added to first virtual machine successfully. Next Login to VM, open server management, collapse Storage then under Disk management, from the list right click Disk 1, click online, (I have 2 disks now disk 0 is OS, RDM is Disk 1, so this might differ and depend on how many disk you have already on VM)
Next initialize the disk. select the disk from wizard and click Ok. Right click on the disk 1 to create new simple volume.
In the new simple volume wizard, specify volume size, assign drive letter, click next.
In the Format Partition, perform a quick format. and Finish the wizard. Configuration for first VM is completed, It should be listed in my computer.
Next select second VM 002, right click and in the VM Edit Settings, Create a new physical SCSI controller as shown for VM 001, Under select new device, click Existing Hard Disk. and Add it.
This opens the Select file wizard, and opens datastore browser, select the Shared-Disk01 then select the folder and choose vmdk under contents (Here on this datastore and path I created RDM disk for vm 001 earlier, verify folder path). Click ok to proceed.
Choose the sharing option to multi-writer, and virtual device node should be SCSI controller 1.0 as created earlier. Ok to proceed with adding.
Login on the second server, go to disk management, right click and rescan disks, this will refresh, detect and show disk in list.
Next you have to just make the disk Online no need to format it, as it shared and already formatted by VM 001.
At this point it is Virtual machines are ready to get further Microsoft failover clustering role and feature configured.
Useful articles
POWERCLI: VMWARE ESXI CONFIGURE (VSWITCH) VMKERNEL NETWORK PORT FOR ISCSI STORAGE
POWERCLI VMWARE: CONFIGURE SOFTWARE ISCSI STORAGE ADAPTER AND ADD VMFS DATASTORE
POWERCLI: VIRTUAL MACHINE STORAGE MIGRATE/SVMOTION AND DATASTORE PORT BINDING MULTIPATHING
Emulate HDD as SSD flash disk on Esxi and VMware workstation