flat-vmdk file remaining in datastore after vMotion

Esxi 6.0U3. Performed a storage vMotion on a vm to a different datastore.  After that was complete, I went to the old datastore and looked at the files. The flat-file.vmdk was still located in the OLD datastore. How can I move the flat-file or delete it? I am moving the vm to make better use of my SAN. I tried to copy it to the new location, but received an error from my vcenter. I don't understand why the flat-file.vmdk was even in with the vm files.

Please provide any guidance you can. The vm is a ldap server used with zimbra.

Thank you
LVL 1
Myles CapenNetwork AdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
Sometimes it's quite normal to discover left over orphaned files after a storage vMotion.

Is the file still in use, has the VM been moved to the new datastore...

Check the VM disk settings to confirm this.
Myles CapenNetwork AdministratorAuthor Commented:
The disk file on the vm itself points to the regular zldap.vmdk file in the new datastore location. How do I delete the orphaned flat-file.vmdk?

Thanks for your help
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
login via console, or SSH (shell prompt) and use rm

if it cannot be moved or deleted, because it's locked it's in use, or a process has it locked.
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Myles CapenNetwork AdministratorAuthor Commented:
Thanks Andrew,

Before I do that, can you take a look at the attached log? I still see references to the flat-file.vmdk. Im concerned if I delete it, I will lose the VM.

Previous logs show it using the flat-file.vmdk for quite some time, so I'm not sure my backups are any good either.
vmware.log
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
You will not be able to delete if it's in use.

have you checked both datastores.
Myles CapenNetwork AdministratorAuthor Commented:
Okay..logged in with ssh.....found the file in the datastore

rm zldap-flat.vmdk - received the following error

"no such file or directory"

Okay...now I'm stumped :)

Any advice?

Thanks
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
screenshots ?
Myles CapenNetwork AdministratorAuthor Commented:
Hi Andrew, I appreciate all your help....I've attached the screen shot as you requested. The Storage where the flat file is, is the Zimbra.Z20.0

Thanks


Myles
FlatFile.PNG
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
does it have any size, can it be deleted from the client ?

is this file in two places ?
Myles CapenNetwork AdministratorAuthor Commented:
Have to wait for a maintenance window.....probably this weekend....sorry for the delay..thanks!!!
Myles CapenNetwork AdministratorAuthor Commented:
okay...very weird...using vCenter, i was able to move the file to another Datastore. I confirmed that the file was present in the new Datastore, both using vCenter and the esxcli,  but it was still showing up in the OLD datastore. Again I tried to delete the file and I get the same error.

Any ideas?

Thanks

Myles
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
If you have restarted hosts, you will need to look at logs and check which process is holding a lock on the file, if the file is not being used or written to.
Myles CapenNetwork AdministratorAuthor Commented:
Tried to delete file from vCenter gui,  cannot delete file.

I'm going to call vmware support....don't really want to reboot the host if I can avoid it.

Since it's the only file in the datastore...was thinking of just re-formating the datastore to grow it larger...which was the original plan when this issue came up.

Thanks for all your help
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
no need to delete a datastore to grow a datastore!

The file is in use, or is locked. You will  need to use and find the process which has the lock, and then kill the process.

see here

https://kb.vmware.com/s/article/2110152

If the process cannot be killed, you will need to restart the host.

Sometimes it's easier to restart a host, then waste a day looking for a locked file, which ultimately you cannot kill!
Myles CapenNetwork AdministratorAuthor Commented:
Please see attached. I followed the documentation in the KB article you specified.

It says the file is NOT LOCKED....any ideas?

Thanks


Myles
flatfile_no_lock.PNG
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization ConsultantCommented:
Have you tried connecting to a host (directly) and checking if you can delete the file?

as for not locked, I did also specify...

"Sometimes it's easier to restart a host, then waste a day looking for a locked file, which ultimately you cannot kill!"

which results in not locked, but still cannot delete!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Myles CapenNetwork AdministratorAuthor Commented:
Eventually we had to restart/reboot the host. That enabled us to delete the file. We then deleted the datastore sucessfully. I'm in the process of re-allocating memory in my NAS for each of my datastores. It seems that my datastores were force mounted. VMware support is being very helpful in resolving this issue. The information you provided was invaluable!

Sorry it just took so long to get the project completed!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage

From novice to tech pro — start learning today.