How to Configure Multi-Writer on VMware vSphere: Sharing VMDK Disks for Oracle RAC and Clusters

VMware tutorial - IT technology blog
VMware tutorial - IT technology blog

Quick Start: Configure Multi-Writer in 5 Minutes

Need to spin up an Oracle RAC lab quickly or test a two-node cluster? Simply follow these 4 quick steps:

  1. Create an Eager Zeroed Thick (EZT) virtual disk: Multi-Writer does not work on Thin or Lazy Zeroed disks. SSH directly into your ESXi host and execute the vmkfstools command:
# Access the SAN datastore and pre-allocate a 100GB EZT disk
cd /vmfs/volumes/san_production_lun01/
mkdir -p rac_shared_disks
vmkfstools -c 100G -d eagerzeroedthick /vmfs/volumes/san_production_lun01/rac_shared_disks/rac_asm_data01.vmdk
  1. Attach the disk to the first virtual machine (VM-01): Open Edit Settings > select Add Existing Hard Disk > browse to the rac_asm_data01.vmdk file. Assign the disk to a dedicated Controller, such as SCSI(1:0). Set the controller type to VMware Paravirtual. Change SCSI Bus Sharing to Physical if the two VMs reside on different ESXi hosts. If running on the same host for testing, select Virtual.
  2. Attach the disk to the second virtual machine (VM-02): Repeat the procedure on VM-02. Point to the same VMDK file you created and ensure it retains the exact same ID: SCSI(1:0).
  3. Enable the Multi-Writer flag: In vCenter, go to Edit Settings for each VM > select the VM Options tab > expand Advanced > click Edit Configuration. Add the following entry:
Key: scsi1:0.sharing
Value: multi-writer

Save the configuration on both virtual machines. You can now power on both nodes simultaneously without ESXi triggering file lock conflicts.

Under the Hood: SCSI Locking and the Role of Multi-Writer

By default, VMFS enforces strict data protection. When VM-01 accesses a VMDK disk, ESXi immediately places a distributed lock (Distributed Lock / ATS) on that file. This prevents VM-02 from concurrent writes that could corrupt the filesystem.

However, distributed systems such as Oracle RAC (using ASM) manage write streams at the application layer. The guest OS clustering stack provides its own arbitration mechanism (Cluster Arbitration / Voting Disk). Under this architecture, the hypervisor-level lock becomes an obstacle.

Enabling the multi-writer flag instructs ESXi to release this control: the virtualization layer bypasses its exclusive file-locking mechanism, allowing the clustered operating systems to coordinate data consistency on their own.

Important Note: Windows Server Failover Cluster (WSFC) requires SCSI-3 Persistent Reservations (SCSI-3 PR). Multi-Writer suppresses this feature, making it unsuitable for traditional WSFC unless RDM disks are used. Starting with vSphere 7.0, VMware introduced native Clustered VMDK support for WSFC instead of relying on Multi-Writer.

3 Mandatory Prerequisites Before Enabling

  • Disk Provisioning: Must be provisioned as Eager Zeroed Thick. Attempting to use Thin or Lazy Zeroed disks will cause the VM to fail at boot with the error Invalid configuration for device.
  • Dedicated SCSI Controller: Never attach shared disks to the primary OS controller SCSI(0:x). Always create a secondary controller (SCSI 1) or tertiary controller (SCSI 2).
  • Optimal Controller Type: Always prioritize VMware Paravirtual SCSI (PVSCSI). Compared to LSI Logic SAS, this controller cuts host CPU overhead by 12–15% and easily scales beyond 100,000 IOPS.

Automating with PowerCLI for Bulk Disk Attachments

A production Oracle RAC cluster typically requires 8–16 ASM disks (OCR, DATA, ARCHIVE, REDO). Configuring each entry manually through the vCenter web interface is tedious and error-prone. This PowerCLI script automates the entire process in seconds:

# Connect to vCenter
Connect-VIServer -Server vcenter.corp.local -User [email protected]

$vmList = @("PRD-ORARAC-NODE01", "PRD-ORARAC-NODE02")
# List of SCSI targets to enable (e.g., from disk 0 to disk 3 on controller 1)
$scsiTargets = @("scsi1:0.sharing", "scsi1:1.sharing", "scsi1:2.sharing", "scsi1:3.sharing")

foreach ($vm in $vmList) {
    $targetVM = Get-VM -Name $vm
    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
    
    foreach ($target in $scsiTargets) {
        $opt = New-Object VMware.Vim.OptionValue
        $opt.Key = $target
        $opt.Value = "multi-writer"
        $spec.ExtraConfig += $opt
    }
    
    $targetVM.ExtensionData.ReconfigVM_Task($spec)
    Write-Host "[OK] Multi-Writer configured for $($targetVM.Name)" -ForegroundColor Green
}

Physical Sharing vs. Virtual Sharing: Which to Choose?

The SCSI Bus Sharing setting determines the operational scope of your cluster:

  • Virtual Sharing: Intended for Cluster-in-a-Box deployments (both VMs running on the same physical ESXi host). This configuration is strictly suitable for lab environments; in production, a single host failure takes down the entire cluster.
  • Physical Sharing: Intended for standard Cluster-across-Boxes deployments (each VM hosted on a separate ESXi host). Always configure a DRS Anti-Affinity Rule to keep vSphere from placing both nodes onto the same physical server.

Production Lessons Learned from the Field

Our team currently manages 8 ESXi hosts running 4 active Oracle RAC clusters. Here are several critical pitfalls you should be prepared for:

1. Snapshots Are Hard-Blocked: Do Not Break Your Backups

Once Multi-Writer is enabled, vSphere strictly disallows VM snapshots across the entire virtual machine. Any attempt to click Take Snapshot will instantly fail in vCenter.

This renders hypervisor-level snapshot backup solutions (such as Veeam or Commvault) ineffective for shared disks. Recommended industry solutions:

  • For the OS disk (SCSI 0:x): Configure it as Independent-Persistent, or use standard hypervisor backup during scheduled node maintenance windows.
  • For database data on shared disks: Implement an in-guest backup agent. Stream backups directly to NAS/SAN using Oracle RMAN or deploy the Veeam Agent for Linux inside the guest OS.

2. Online Storage vMotion Is Not Supported

While vSphere 6.7 and later versions support live Host vMotion with Multi-Writer enabled, live Storage vMotion remains completely unsupported.

If the LUN housing your VMDK files runs out of space or requires storage array migration, you must schedule maintenance downtime. Every node in the cluster must be cleanly powered off before migrating the VMDK to another datastore.

3. Choose the Right Solution: Multi-Writer vs. Clustered VMDK

Since vSphere 7.0 Update 1, the boundaries are clear:

  • Oracle RAC (ASM): Multi-Writer remains the preferred option because ASM does not require hypervisor-level SCSI-3 PR handling.
  • Windows WSFC / SQL Server FCI: Avoid Multi-Writer. Use Clustered VMDK on VMFS-6 datastores (with native SCSI-3 PR support) instead. This guarantees seamless compatibility with Windows Failover Clusters without the operational overhead of traditional RDM disks.
Share: