Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

Adding and sharing RDM disk to multiple VMs in VMware step by step

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.

vmware vsphere raw device mapping, rdm, storage lun, datastore, rdm disk, shared, physical and virtual, esxi storage, raw lun diagram

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. 

Vmware vSphere web client, virtual machine, vm actions edit settings, add select new device, scsi controller, esxi vm. harddisk, virtual raid contorller vmware.png

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).

NoneVirtual disks cannot be shared by other virtual machines.
PhysicalVirtual disks can be shared by virtual machines on any Esxi server.
VirtualVirtual disks can be shared by virtual machines on the same Esxi server.

Click Ok to proceed.

 

vmware vcenter vsphere web client html, virtual machine vm edit settings Add select device, new scsi raid controller, scsi bus sharing..png

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.

vmware vsphere web client, vcenter, virtual machine Edit Settings, new device select add from list, RDM Disk, raw disk mapping add.png

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.

vmware vsphere web client add new device RDM Disk, raw device mapping, select target LUN, msft iscsi disk shared RDM

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.

 

vmware vsphere web client vcenter add new rdm hard disk, vm edit settings, disk location, compatibility mode Physical, sharing multi-writer, virtual device node scsi controller, raid controller

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)

vmware virtual machine vm, Server manager, storage disk management disk unknows, offline, online right click, hard disk unallocated

Next initialize the disk. select the disk from wizard and click Ok. Right click on the disk 1 to  create new simple volume.

VMware Virtual machine vm rdm initialize disk mbr, gpt guid partition table, master boot record, create new simple volume, harddisk setup windows server disk management

In the new simple volume wizard, specify volume size, assign drive letter, click next.

vmware vsphere web client, esxi server, new hard disk rdm disk, raw device mapping, windows server new simple volume wizard, voluem partition disk size, assign drive letter, NTFS folder mapping

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.

vmware vsphere web client, esxi new harddisk rdm disk, raw device mapping, windows server new simple volume wizard, voluem partition disk size, assign drive letter,folder mapping, quick format file system NTFS vs vmfs.png

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.

vmware vsphere web client, add ne device existing hard disk drive, virtual machine edit settings, windows servers to scsi controller

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.

vmware vsphere web client add existing hdd, hard disk, scsi controlle, lsi logic sas, datastore, sharing multi-writer, virtual vmdk disk, virtual machine edit settings

Login on the second server, go to disk management, right click and rescan disks, this will refresh, detect and show disk in list.

vmware vsphere web client, windows server disk management make disk online, virtual disk vmdk, server manager, manage disks, rescan disk storage, hdd, hard disk, vmdk, rdm raw device mapping

Next you have to just make the disk Online no need to format it, as it shared and already formatted by VM 001. 

vmware vsphere web client, windows server disk management make disk online, virtual disk vmdk, server manager, manage disks

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

Go Back



Comment

Blog Search

Page Views

11240346

Follow me on Blogarama