WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / New method of enabling Multiwriter VMDK flag in vSphere 6.0 Update 1 (UI + API)

New method of enabling Multiwriter VMDK flag in vSphere 6.0 Update 1 (UI + API)

10.19.2015 by William Lam // 22 Comments

Prior to vSphere 6.0, in order for multiple Virtual Machines to share a VMFS-backed VMDK, the Multiwriter VMDK flag must be enabled, which is accomplished by adding a specific VM Advanced Setting as shown in this VMware KB 1034165. For customers who were accustomed to this old method, you may have found that this option no longer works. This was true regardless if you had used the vSphere Web/C# Client or the vSphere API to apply the configuration.

To provide for a better user experience, this behavior was changed in vSphere 6.0 and a new API was introduced for enabling and disabling the Multiwriter VMDK flag. In vSphere 6.0, there is now a new sharing attribute on the Virtual Disk backing property which accepts one of two values: sharingMultiWriter or sharingNone for specifying the Multiwriter flag. In my opinion, this is a positive change as we too often rely on the VM Advanced Setting as a generic "catch all" for enabling or configuring various settings versus adding proper APIs to a VM.

Although there is now a proper API which will can help enable new Automation use cases, one thing that was still lacking was an easy way to enable the Multiwriter VMDK flag using the UI. In vSphere 6.0 Update 1, we have now introduced a new UI dropdown option called "sharing" in the vSphere Web Client for configuring the Multiwriter VMDK flag which can be found in the Virtual Disk section when editing a VM as shown in the screenshot below.

Screen Shot 2015-10-16 at 10.19.05 AM
Note: The new Sharing property is only available in the vSphere Web Client UI and is not available in the vSphere C# Client. If you need to configure the Multiwriter VMDK flag and do not have access to the vSphere Web Client, you can use the vSphere API to help automate this configuration change.

UPDATE (06/27/16) - Created two scripts which now cover scenarios where VM is online and/or offline.

For those interested in Automating the Multiwriter VMDK flag, I have created two PowerCLI scripts called: configureMultiwriterVMDK.ps1 (offline VM configuration) and addMultiwriterVMDK.ps1 (online VM configuration) which demonstrates this new vSphere API.

The first script configureMultiwriterVMDK.ps1 allows you enable the Multiwriter Flag for an existing VMDK that has already been added to a VM. This operation must be done while the VM is powered off and to use the script you will need to specify the name of the VM as well as the label of the VMDK in which you wish to enable the Multiwriter VMDK flag (e.g. Hard disk 2). Below is an example of running the script.

Screen Shot 2015-10-16 at 8.24.46 PM
The second script addMultiwriterVMDK.ps1 allows you to hot-add a new VMDK and enables the Multiwriter Flag to a VM. This operation is done while the VM is powered on which is a common workflow for customers needing to hot-add storage to an existing Cluster solution such as Oracle RAC for example all while the system is running. To use the script, there are a few variables you will need to edit:

  • vmName - The name of the VM you wish to perform th operation on
  • vmdkFileNamePath - This is the full datastore path to the name of the underlying VMDK. See the script for more information but the syntax will look like "[datastore-name] vm-home-dir/vmdk-name.vmdk"
  • diskSizeGB - The capacity of the VMDK to add (GB)
  • diskControllerNumber - The SCSI controller number (0-3)
  • diskUnitNumber - The Unit number (0-16)

More from my site

  • PowerCLI script to help correlate vCenter, ESXi & vSAN build/versions w/o manual VMware KB lookup
  • An update on how to retrieve useful information from a vSphere login?
  • Automating Cross vCenter vMotion (xVC-vMotion) between the same & different SSO Domain
  • Erasing existing disk partitions now available in the vSphere Web Client (vSphere 6.0 Update 1)
  • Using latest PowerActions 1.5.0 to issue VMFS UNMAP API in vSphere 6.0 Web Client

Categories // Automation, vSphere 6.0, vSphere Web Client Tags // multiwriter, vmdk, vSphere API, vsphere web client

Comments

  1. *protectedchopper3 says

    10/19/2015 at 3:13 pm

    Does this still only support just 8 hosts in v6.0u1?

    Reply
    • *protectedJayaraghavendra (Jai) says

      08/04/2017 at 9:43 am

      Hi William

      Thanks for the scripts, it helped a lot for me.

      How can we modify the sharing from multi-writer to no sharing.

      I am looking for a disabling the multi-writer flag for the entire VMs and its shared Disks. To facilicate the Storage Migration of the Disks. The vCenter 6.5 does not allow the storage migration if a disk is configured with multi-writer flag.

      Thanks in advance

      Jai

      Reply
  2. *protectedPual Rhines says

    10/22/2015 at 1:29 am

    Hi William! Thanks for this better information. I find it very useful for my research. Good Luck.

    Reply
  3. *protectedVinoth kumar Natarajan says

    10/28/2015 at 6:20 am

    Hello William,

    Thank you very much for sharing this information. this is very much helpful.

    The script is not working if the disk type are "Thin Provision" and "Thick Provision Lazy Zeroed" in vCenter server 6.0 build#2559268.

    If the disk type is "Thick Provision Eager Zeroed" the script is working perfect.

    Any suggestions ?

    --Vinoth

    Reply
    • William Lam says

      10/28/2015 at 7:04 am

      Vinoth,

      The Multiwriter VMDK Flag requires that you have a VMDK provisioned EZT (Eager Zeroed Thick), the other types are not supported. Please refer to the KB mentioned for more details

      Reply
      • *protectedVinoth kumar Natarajan says

        10/28/2015 at 9:15 am

        Thank you for your clarification !

        Reply
  4. *protectedalf says

    01/18/2016 at 8:10 am

    hi

    this script only work for me with VM power off

    why???

    Reply
  5. *protectedsdb says

    03/09/2016 at 7:28 am

    hi
    I active multi-writer between 2 vms but just write from VMs and can't see another data untill reboot or offline&online Disk.
    Can you help me?

    Reply
    • *protectedsdb says

      03/09/2016 at 7:30 am

      I need read & write share with RDM

      Reply
  6. *protectedMike says

    06/21/2016 at 12:16 pm

    In 5.5, updating the multi-writer flag was an online change that we could perform via command line. With 6.0 update 1, the server(s) now need to be powered off to make the change. I see this as a negative enhancement for customers running production Oracle RAC databases like myself.

    It would be beneficial to enhance the API to allow online multi-writer flag changes again.

    Reply
    • *protectedJai says

      04/29/2018 at 1:17 pm

      Hi Mike

      The script works for online also.

      Reply
  7. *protectedmaciej says

    09/07/2016 at 4:45 am

    What happens to existing multi writer flags on VMDKS when you upgrade vcenter 5.1 u3 to vcenter 6 u2.

    Reply
  8. *protectedExplorer says

    10/20/2016 at 10:10 pm

    In 5.5, I could use 'get-advancedsettings' to check the Multi-writer setting, but in 6.0, 'get-advancedsetting' doesn't pull 'multi-writer' settings. Any idea how to get this through PowerCLI? I can see the values remain in vmx file.

    Reply
    • *protectedVamshi Meda says

      06/27/2017 at 6:43 am

      Try This. (get-vm $vm |get-harddisk).extensiondata.backing.sharing

      Reply
  9. *protectedAhmad says

    01/30/2017 at 4:27 am

    Thanks for the valuable information, but what is the use cases other those mentioned in VMware article. can be used for MSCS across box CAB?

    Reply
  10. *protectedDavidDAVE says

    03/16/2017 at 4:03 am

    Hi there!

    First of all, thanks a lot for the info, it's quite usefull. I have a question: do we still need to change the new disks controller's SCSI bus sharing setting to "Physical".? Or is the method "enabling multiwriter" a substitute?

    Thanks in advance!

    Reply
  11. *protectedfreeking says

    07/07/2017 at 12:40 am

    Why in my vsphere 6.5 did not find this option, My ISO is VMware-VMvisor-Installer-6.5.0-4564106.x86_64-Dell_Customized-A00.iso. Please . 🙂

    Reply
  12. *protectedMike Kartoon says

    04/22/2018 at 3:53 am

    Lets say I have main server running on VM1 handling file storage in the datastore.
    Lets say I now want to raise (from vSphere API) two VMs and each one to have access only to subset of these files, readonly.
    Can this be done in some way?

    Reply
  13. *protectedStephen McKay says

    11/11/2020 at 4:52 pm

    Does any version of vCloud Director support the multi-writer flag on VMDKs?

    Reply
    • *protectedStephen McKay says

      01/26/2021 at 3:37 pm

      In case you have the same question, the answer is "no" - at least as of this writing.

      Reply
  14. *protectedNitin Subramanian says

    01/14/2021 at 8:41 am

    Need help on below scenario:
    I have used addMultiwriterVMDK.ps1 to create and add multi-writer disk "[Testbed] MWDisk/MWDisk-1.vmdk" to TestMWvm-1.
    How can I add the same disk, i.e., "[Testbed] MWDisk/MWDisk-1.vmdk" to TestMWvm-2 (another VM) as a multi writer disk while the VMs are powered on?

    Reply
  15. *protectedsenthil says

    09/23/2021 at 8:04 am

    how to do for multiple disk for single vm with this script

    Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...