3.7 Preparing Shared Storage

  1. Ensure that your shared disks are visible to the VMware hosts. You can use the vSphere Client or the command line interface.

    • vSphere Client: In the vSphere client, go to Host > Configuration > Storage > Devices.

      For example, Figure 3-9 shows an example list of devices as viewed from the vSphere client:

      Figure 3-9 List of Shared Devices on the ESXi Host as Viewed in the VSphere Client

    • Command Line Interface: As the root user, launch a terminal console, then enter

      ls -lSh /vmfs/devices/disks/* | grep -v '^l\|:[0-9]\+$'

      For example, Figure 3-10 shows the example output from this command:

      Figure 3-10 List of Shared Devices on the ESXi Host as Viewed in the ESXi Shell

  2. For each disk that you want to use with the virtual machines, create a virtual compatible Raw Disk Mapping (RDM). Store the RDMs outside of the virtual machines.

    It is faster to use the command line when mapping the devices. If you use the vSphere Client, you must create the RDMs when you add the first virtual machine on each host. Using the client is time-consuming and error-prone.

    If your virtual machines reside on multiple hosts, you can generate a script to perform the preceding steps on one host, then run it on all the hosts.

    1. Create the location where you will store the RDMs. At a command prompt, enter

      mkdir -p /vmfs/volumes/<datastore_name>/sharedDisks

      Replace datastore_name with the name of the datastore you are creating.

      For example, enter

      mkdir -p /vmfs/volumes/datastore1/sharedDisks
    2. Map each disk to the RDM location. At a command prompt, enter the following command for each disk:

      vmkfstools -r <disk_name> <RDM_location>

      For example, enter

      vmkfstools -r /vmfs/devices/disks/naa.60060160b6561601dedf0855331de211 /vmfs/volumes/datastore1/sharedDisks/VM-SAN-512G-NSS.vmdk

      Figure 3-11 Commands to Map Disks to the RDM Location

    3. Repeat this process for each virtual node in the cluster.

  3. Eager-zero the SBD devices. At a command prompt, enter

    vmkfstools –k sbd_rdm 

    Eager-zero writes zeroes to all allocated blocks on the device. This allocates all required space for the virtual disk at this time. It might take several minutes to zero-out the devices.