VMware Cloud Community
insearchof
Expert
Expert
Jump to solution

Unable to delete file on Data Store

VMware ESXI 6.5

I just migrated all my VM's from internal data stores to NAS NFS datastores all went well.

Now I went thru all the local data stores and I found folders of some of the VMS's I moved still lingering.

I had six of 60 VM's

I was able to verify non of the files are required and deleted the files and folder and they are all clear except for one file I can not delete

pastedImage_0.png

This VM is up and running and the new location has a vmdk  and this server only has one disk drive assigned.

File locked maybe?

Any ideas?

Thank you

Tom

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

I don't see any arguments when you call rm -rf, so the command doesn't know what to delete.

Invoke it with a parameters, eg. something like:

  rm -rf *

the above will delete everything in the current folder.

View solution in original post

0 Kudos
9 Replies
dbalcaraz
Expert
Expert
Jump to solution

Hi,

Did you try to access via SSH from an ESXi host and delete the file from it?

You should be able to see who is locking that file and hence, you can't delete it.

-------------------------------------------------------- "I greet each challenge with expectation"
0 Kudos
insearchof
Expert
Expert
Jump to solution

No do not use ssh option that often.

What is the command line I need to use ?

0 Kudos
insearchof
Expert
Expert
Jump to solution

Also

How do I find this using powercli?

0 Kudos
yemyat
Contributor
Contributor
Jump to solution

He means manually deleted as my perspective ( rm -rf ). If VMs vmdk is on another datastore, it will be Ok.

Enter ssh. Then /vmfs/volumes then you need to enter your datastore where it was exist.

Cheers.

0 Kudos
insearchof
Expert
Expert
Jump to solution

How about using powercl?

0 Kudos
insearchof
Expert
Expert
Jump to solution

Guys

I enabled SSH on the Host.

SSH'd into the host using ROOT account and password.

[root@TGCSESXI-4:~] /vmfs/volumes

-sh: /vmfs/volumes: Permission denied

0 Kudos
insearchof
Expert
Expert
Jump to solution

I had to use cd\vmfs  now I can see the datastores   the rm -rf did not remove the file either    see below.

[root@TGCSESXI-4:/vmfs/volumes] cd Datastore-SSD-480

[root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5] ls

[root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5] cd TGCS003-2

012R2

[root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R                                                                                                              2] ls

TGCS003-2012R2-000001.vmdk~  TGCS003-2012R2-000001.vmdk~

[root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R                                                                                                              2] rm -rf

[root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R                                                                                                              2] ls

TGCS003-2012R2-000001.vmdk~  TGCS003-2012R2-000001.vmdk~

[root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R 2] ls -ltr

total 0

-rw-------    1 root     root           420 Jan 11 02:02 TGCS003-2012R2-000001.v                                                                                                              mdk~

-rw-------    1 root     root           420 Jan 11 02:02 TGCS003-2012R2-000001.v                                                                                                              mdk~

[root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R2] rm -rf

[root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R2] ls

TGCS003-2012R2-000001.vmdk~  TGCS003-2012R2-000001.vmdk~

[root@TGCSESXI-4:/vmfs/volumes/5a80e634-c674e092-3fbc-d4ae52776cb5/TGCS003-2012R2]

Any ideas on why I ca not delete this file

Thank you

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

I don't see any arguments when you call rm -rf, so the command doesn't know what to delete.

Invoke it with a parameters, eg. something like:

  rm -rf *

the above will delete everything in the current folder.

0 Kudos
insearchof
Expert
Expert
Jump to solution

Thanks adding the * deleted the files

Stange how you could not delete the same file using the GUI

0 Kudos