My vSphere guest VMs refused to share a raw device mapped LUN that we use for in-band management of HDS arrays. My current version (4.0.0 build 261574) refuses to even allow me to present the same raw LUN to multiple VMs, something I know prior versions allowed me to do so long as only one of them used it at a time. While this works, it's a pain to manage in a dynamic lab environment where anyone might need to use one.
Enter SCSI Bus Sharing, allowing multiple VMs to um, share a SCSI bus. This feature is more traditionally used for clustering VMs, but it turns out to suit my needs quite well.
There are two modes for SBS: virtual sharing and physical sharing. Virtual sharing means VMs on the same host can share the SCSI bus; physical sharing means VMs across servers can share the bus.
Unfortunately, neither mode will allow VMotion of a running VM (or suspended; see below), hence I probably wouldn't recommend this for general production use.
But for lab use it makes a lot of sense. Here's how I recommend doing it.
- Remove the command device RDM from any guest OS configuration(s).
- In the VI Client Datastores view, browse to a shared datastore and create a folder (ie, "cci" or "cmd-devs")
- In the VI Client Hosts and Clusters view, browse to a host's Storage Adapter configuration and find the raw LUN to which you want to map. Right-click the LUN and select "Copy identifier to clipboard"
- Open an SSH session to an ESX host and cd into /vmfs/volumes/
'datastore'/'folder' - Create a raw device map: vmkfstools -createrdm /vmfs/devices/disks/
:
vmkfstools --createrdmpassthru /vmfs/devices/disks/naa.60060e800564a400000064a4000000ff uspvm_cmddev_00ff.vmdk - Back in the VI Client, go to VMs and Templates and select your first VM and "Edit Settings..."
- "Add..." a new hard disk. Select "Use existing virtual disk" and when prompted browse to the datastore and folder where the command device vmdk is located.
- Map the RDM to an unused SCSI node (X:Y where X is the SCSI controller and Y is the SCSI bus ID of the new hard disk). Most commonly 1:0 should be available, but you need something other than SCSI controller 0.
- Mark the new disk as Independent and select Persistent mode.
- Click OK to close the Virtual Machines Properties dialog.
- Re-open the VM Properties dialog box and select the new SCSI controller. On the right-hand side select the Physical bus sharing mode.
- Close the dialog box and restart your VM.
No comments:
Post a Comment