VMware Cloud Community
cainics
Enthusiast
Enthusiast

Cannot delete a datastore

Situation -

I have a few datastores that are setup on each of the 5 ESX hosts in a cluster.

I wanted to change the block size of a datastore from 1Mb to 4Mb and migrated all VM's from that datastore. After that removed the datastore from 1st ESX host and refreshed the other ESX hosts. The datastore got deleted from all hosts except one.

Went into the datastore view and checked that the datastore had some old linkages. So did an SSH into the server and cleaned up that datastore. I still cannot get to remove the datastore and receive this error -

" destroyvmfsdatastore: can't delete partition"

I have rescanned the HBA's and refreshed all hosts many times. Since i have many VM's my cluster failover policy is not allowing me to reboot this ESX host at this time. I am in the process of adding more ESX hosts as well but it cannot be done immediately. A call with the vendor is in progress but taking too long.

Any suggestions ?

“Your intelligence is measured by those around you; if you spend your days with idiots you seal your own fate.”

0 Kudos
4 Replies
lamw
Community Manager
Community Manager

I've seen this in the past with NAS Datastore sometimes and you can also execute the destroy command from Service Console using vimsh, so long as you've migrated everything off and it's okay to destroy the datastore, try the following:

vmware-vim-cmd hostsvc/datastore/destroy <datastore_name>

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

If you find this information useful, please award points for "correct" or "helpful".

marcelo_soares
Champion
Champion

Besides the vimsh (which I think that can do the job) you can delete the partition directly with fdisk (discover it using esxcfg-vmhbadevs, do an fdisk /dev/sdX and use the "d" option). If the VMFS partition have some trouble being removed an error message will show up at this point.

Marcelo Soares

VMWare Certified Professional 310

Technical Support Engineer

Linux Server Senior Administrator

Marcelo Soares
cainics
Enthusiast
Enthusiast

Thanks for trying to assist.

VMWare came through by suggesting that i stop/start the mgmt services on the ESX host. That cleared the lock on the datastore while being connected through Virtual Center.

-Anil

“Your intelligence is measured by those around you; if you spend your days with idiots you seal your own fate.”

0 Kudos
marcelo_soares
Champion
Champion

haha... sometimes things can be so easy and we don't think about them... Smiley Happy

Cheers!

Marcelo Soares

VMWare Certified Professional 310

Technical Support Engineer

Linux Server Senior Administrator

Marcelo Soares
0 Kudos