Correct procedure to reduce the size of a VMFS datastore
search cancel

Correct procedure to reduce the size of a VMFS datastore

book

Article ID: 344718

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides correct steps to reduce the size of a VMFS datastore.


Environment

VMware vSphere ESXi 6.7.x
VMware vSphere ESXi 7.0.x
VMware vSphere ESXi 8.0.x

Cause

VMFS datastores cannot have their capacity reduced without destroying the original datastore.

This is because data is not always sequentially written, in other words, the blocks used are not sequential, so reducing the available space for the VMFS datastore could leave used blocks outside the new size, which would cause data loss and filesystem corruption.

Resolution


To effectively reformat a VMFS datastore:
  1. Backup or evacuate the content of the VMFS datastore. If hosts are running ESXi and storage vMotion is possible. Otherwise, a cold migration is necessary.
  2. Perform a rescan of the storage from the datacenter level, make sure that all of the ESXi hosts were rescanned. See Performing a rescan of the storage on an ESX/ESXi host.
  3. unmount the LUN and then un-present the LUN from all of the connected hosts. See How to detach a LUN device from ESXi hosts.
  4. Present a new LUN of the desired size to the hosts requiring access to it and then rescan all hosts. See Performing a rescan of the storage on an ESX/ESXi host.
  5. Create a new VMFS datastore with the desired size. See Create a VMFS Datastore.
  6. Migrate/copy the data from the backup VMFS datastore to the newly created one.
  7. If the new datastore is not visible on all hosts, perform a rescan. See Performing a rescan of the storage on an ESX/ESXi host.


Additional Information