khaliqamar
Enthusiast
Enthusiast

how to delete the inactive LUNS

i lost storage array and we rebuilt the datastores from scratch and restored my vms but as a result i have all the inactive datastores which are not connected to any ESXi and there is no file/VM inside those datastores.

How I can delete them from vcenter when delete option is grayed-out.

esxi rebooted but no affect.

any suggestion.

0 Kudos
2 Replies
RajeevVCP4
Expert
Expert

There could be 2 reason

Still some of vm have orphaned entry of previous data store , just check 2-3 vm ( edit setting --disk)

Or May be SIOC was enabled on previous DS

Rajeev Chauhan
VCIX-DCV6.5/VSAN/VXRAIL
Please mark help full or correct if my answer is use full for you
0 Kudos
Raj1988
Enthusiast
Enthusiast

  • Ensure that the datastore is not referenced by any virtual machine or template or any ISO mounted to any VM from that old datastore .

  • If that is not the case then you can delete the Datastore related entries from vCenter Database .

Run the below query to identify the datastore ID in the vCenter Server database:

select ID from VPX_ENTITY where name ='datastore_name';

Where datastore_name is the datastore to be removed. The query returns the ID of the datastore.

To remove the datastore from the vCenter Server database:

Run the below queries to delete the datastore. Where ID is the output from the first step above.

delete from VPX_DS_ASSIGNMENT where DS_ID=ID;

delete from VPX_VM_DS_SPACE where DS_ID=ID;

delete from VPX_DATASTORE where ID=ID;

delete from VPX_ENTITY where ID=ID;

0 Kudos