VMware {code} Community
Ashwin89
Contributor
Contributor

VIXMntAPI and cleanup for symlink

Hello,

Is there any generic way\API to delete hanging symbolic links? Can we run some kind of cleanup process to delete the all the mounted symbolic links?

We dont have open handles to the disk in the cleanup process.

Any pointer will be helpful.

-AsHwIN

0 Kudos
8 Replies
admin
Immortal
Immortal

Hi Ashwin,

After invoking the vixmnt API, you can invoke dismount api to release the symbolic links, VixMntapi_DismountVolume().

0 Kudos
Ashwin89
Contributor
Contributor

For calling VixMntapi_DismountVolume() it needs to be in the same process context. I have mounted the VM in one process context and need to do the cleanup on the another process context. I have VM GUID and VM name only.

VixDiskLib_Cleanup() is also not useful here.

Any suggestion?

-AsHwIN

0 Kudos
Lakshmi_Gayatri
Enthusiast
Enthusiast

are you calling VixMntapi_Exit() ?

0 Kudos
Ashwin89
Contributor
Contributor

VixMntapi_Exit() API needs to get called in the same process context right?

I have 2 different process context here.

-AsHwIN

0 Kudos
Lakshmi_Gayatri
Enthusiast
Enthusiast

Ashwin,

yes, VixMntapi_Exit() API needs to get called in the same process and it is recommended to have the init, connect,open, read/write, close, disconnect,exit in the same process as it ensures complete cleanup and sucessful execution.

vmware-mount can cleanup symlinks that are created by VixMntApi. Can you please try?

0 Kudos
admin
Immortal
Immortal

Hi AsHwIN,

If you have a process that mounted the volume, this process needs to stay alive till the volume is dismounted. This is because one of the threads in that process handles read/write requests from Windows Kernel. Since this process needs to be around, you can simply direct the process to unmount - use any rpc mechanism that you like.

On the other hand if that process died and you are only looking to cleanup objects, you can take a look at http://support.microsoft.com/kb/235128 which shows how to remove Windows objects.

Hope that helps, thanks for using VDDK,

-Sudarsan

0 Kudos
Ashwin89
Contributor
Contributor

Thanks Sudarshan.

RPC will solve my problem. Thanks for your help.

-AsHwIN

0 Kudos
Lakshmi_Gayatri
Enthusiast
Enthusiast

Hi AsHwIN,

As your query is answered, please mark it accordingly.

Thanks

Lakshmi.

0 Kudos