Wednesday Tidbit: Two ways to force a disk to appear as an SSD

20150703 - VMwareThe other day I was installing a VSAN 6 Proof of Concept in the lab and needed a disk to appear as an SSD. There are two ways to do this, each with their own merits, although only one can be used if you plan on using nested ESXi on vCloud Air.

These methods are not only handy for trying VSAN, but for host cache and vFlash Read Cache too. For more information, please refer to and https://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.vsphere.resmgmt.doc%2FGUID-4505B56B-57B1-413F-ACE3-BA2A85C3EC88.html and http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2058983.

Note: if you’re a seasoned VMware administrator (or have sat the VCAP-DCA) then at least one (or both) of these will not be new to you. Indeed both of these tricks have been documented by William Lam in the past… this is merely a consolidation of his work.

Editing the VMX file

In the following example, nested ESXi is installed to an 8Gb disk, with two further disks of 100Gb and 500GB added:

20160120 - 1

In the CLI, use the following to verify:

esxcli storage core device list

This gives the following:

mpx.vmhba1:C0:T0:L0
Display Name: Local VMware Disk (mpx.vmhba1:C0:T0:L0)
Has Settable Display Name: false
Size: 8192

mpx.vmhba1:C0:T1:L0
Display Name: Local VMware Disk (mpx.vmhba1:C0:T1:L0)
Has Settable Display Name: false
Size: 256000

mpx.vmhba1:C0:T2:L0
Display Name: Local VMware Disk (mpx.vmhba1:C0:T2:L0)
Has Settable Display Name: false
Size: 512000

As VSAN 6 supports an all-flash configuration, we can edit the nested ESXi VMX file to modify the two largest drives. To do that, first access the host console (either using the shell or SSH). The second and third disks are the ones we want to modify, and they will be shown in the format scsiX:Y, as shown by using:

cat <name of VM>.vmx | grep scsi

In my example, these disks I want to modify are scsi0:1 and scsi0:2, so to set them as SSDs use:

echo "scsi0:1.virtualSSD = 1" >> <name of VM>.vmx
echo "scsi0:2.virtualSSD = 1" >> <name of VM>.vmx

Note: be sure to use two >> characters, as one will overwrite the entire configuration!

After a reboot, both disks should appear as SSDs:

20160120 - 2

Using claim rules

Sometimes editing the VMX file isn’t possible. For example if the host is physical (ie not nested), or you want to run nested ESXi on vCloud Air – where you are unable to access the underlying configuration files (even through vCD).

This is where claim rules come in.

For each disk, create a new Storage Array Type Plugin claim rule:

esxcli storage nmp satp rule add -s VMW_SATP_LOCAL -d mpx.vmhba1:C0:T1:L0 --option enable_ssd
esxcli storage nmp satp rule add -s VMW_SATP_LOCAL -d mpx.vmhba1:C0:T2:L0 --option enable_ssd

Reclaim each device using the following:

esxcli storage core claiming reclaim -d mpx.vmhba1:C0:T1:L0
esxcli storage core claiming reclaim -d mpx.vmhba1:C0:T2:L0

Both disks will now appear as SSDs.

Using claim rules for this sort of task or masking LUNs is something that is likely to be tested on the VCAP-DCA exam. If you plan on taking it at some point, then you will need to know commands like this off by heart.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s