How To – Manage Disks & Datastores in vSphere

As a VMware Administrator, from time to time you will need to manage disks & datastores in vSphere. The following post is a quick reference guide on how to complete some common datastore and local disk management tasks in a VMware environment:

Pre-Requisites to remove a Datastore from vCenter:

Before removing a datastore (local or not) ensure the following criteria has been met:

If the LUN is being used as a VMFS datastore, all objects (such as virtual machines, snapshots, and templates) stored on the VMFS datastore are unregistered or moved to another datastore

The datastore is not used for vSphere HA heartbeat

The datastore is not part of a datastore cluster

The datastore is not managed by Storage DRS

Storage I/O Control is disabled for the datastore

No third-party scripts or utilities running on the ESXi host are or can access the LUN

If the LUN is being used as an RDM, remove the RDM from the virtual machine

The datastore is not configured as a diagnostic coredump partition (see below on how to remove a coredump partition)

The datastore is not being used as a scratch partition (see below on how to move the scratch partition)

How To – Remove a coredump partition from a datastore:

To remove one or more coredump partition from a datastore, complete the following:

How To – Unmount a Datastore

Prior to being able to deleting or removing a datastore, you need to unmount it. To do so, complete the following:

Launch the vSphere Client

ESXi Host >> Configuration >> Hardware >> Storage

Select the datastore

Right-Click >> Unmount

Click OK to error (if it appears)

Reboot Host

How To – Delete a Datastore

Once you have unmounted the datastore, you can delete it by completing the following steps:

Launch the vSphere Client

ESXi Host >> Configuration >> Hardware >> Storage

Select unmounted datastore

Right-Click >> Delete

Marking a local disk as SSD

Sometimes VMware doesn’t correctly detect an SSD disk and therefore you will need to mark it as SSD manually, especially when you require an SSD for a particular feature such as vSphere Flash Read Cache (VFRC) or Host Cache.

For the disk you want to mark as an SSD, take a note of the Device ID and the SATP (Storage Array Type), similar to the example below:

Device ID = naa.6006016015301d00167ce6e2ddb3de11
SATP = VMW_SATP_CX

Run the following command to mark the device as an SSD (replacing <SATP_TYPE> and <DEVICE_ID> with the details noted above): esxcli storage nmp satp rule add --satp=<SATP_TYPE> --device <DEVICE_ID> --option "enable_ssd"