Thursday, August 6, 2015

How to Share Disk between multiple VMware Virtual machines

Problem : How to Share Disk between multiple VMware Virtual machines

Scenario : 

This solution will give user flexibility to share the Disks between multiple VMware virtual machines.
This will be helpful if you are going to create Windows level Cluster which requires Shared Disks.

Solution : 

Note : Don't deviate from the RED marked steps ;)

Enabling Virtual Disk Sharing

To configure a shared virtual disk by setting the multi-writer flag:
  1. Create a virtual disk to be shared using any acceptable approach. For example, through the vSphere Client:
    1. Create a new disk for a virtual machine on a VMFS data store:



    2. In the Create a Disk window, for ESX/ESXi versions earlier than 5.0, click Support clustering features such as Fault Tolerance to create the new virtual disk in the required format, eager zeroed thick.



      In ESXi 5.x versions, the Create a Disk window provides Thick Provision Lazy Zeroed, Thick Provision Eager Zeroed, and Thin Provision options under Disk Provisioning. Be sure to select Thick Provision Eager Zeroed. Also, note that the documentation may refer to this as Flat pre-initialized.


    3. Choose a Virtual Device Node setting, such as SCSI (1:0). Make a note of it, as it is required later.


  2. Add the multi-writer flag to configure sharing.

    Note: Do not change the SCSI Controller's SCSI Bus Sharing options. Keep the default selection, None.

    To enable SCSI bus sharing for a particular disks, apply one of these options:

      1. Power off the virtual machine.
      2. In the . vmx file that defines the virtual machine, add an entry similar to:
        scsiX:Y.sharing = "multi-writer"

        where X is the controller ID and Y is the disk ID on that controller. The setting screen of a virtual machine shows these values.

        Add this setting for each virtual disk that you want to share. For example, to share four disks, the configuration file entries look like this:
        scsi1:0.sharing = "multi-writer"
        scsi1:1.sharing = "multi-writer"

        scsi1:2.sharing = "multi-writer"

        scsi1:3.sharing = "multi-writer"
      3. Save the .vmx file and power on the virtual machine.
    1. In the vSphere Client, power off the virtual machine, navigate to Edit Settings > Options > Advanced > General > Configuration Parameters. Add rows for each of the shared disks and set their values to multi-writer.

  3. Add this disk to another virtual machine:

    1. In the vSphere Client inventory, right-click the virtual machine and click Edit Settings.
    2. Click the Hardware and click Add.
    3. Select Hard Disk and click Next.
    4. Select Use an Existing Virtual Disk.

      Note: You do not need to create a disk because the disk is already created.
  4. Enable sharing on this virtual machine, using one of the approaches listed in step 2.
Happy Clustering!

1 comment:

Solved : The user profile failed to attach. The process cannot access the file becase it is being used by another process

Issue :  The user profile failed to attach. Please contact Support. Status : 0x0000000B, Message: Cannot open virtual disk Error Code: 0x000...