VMware Cloud Community
imcooltanmay
Enthusiast
Enthusiast
Jump to solution

Issue with the Orphaned VMDKs size on Datastore.

I have orphaned VMDK 's location. My query is how we can find size of that.

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

With the DatastoreBrowser, see for example Orphaned Files Revisited

Or with the PSProvider, and filter the output on the path you want to check

$dsName = 'MyDatastore'

$ds = Get-Datastore -Name $dsName


New-PSDrive -Location $ds -Name DS -PSProvider VimDatastore -Root "\" | Out-Null

Get-ChildItem -Path DS:\ -Recurse | Select DatastoreFullPath,Length

Remove-PSDrive -Name DS -Confirm:$false

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

3 Replies
a_p_
Leadership
Leadership
Jump to solution

Depending on the ESXi version, and the vSphere Client you may be able to see the size from the Datastore Browser.

Other than this, enable SSH on the host, and use putty to connect to it. Then go to the folder that contains the orphaned .vmdk file(s), and run ls -lisa.

Please allow me a quick question. How did you find out that the file(s) is orphaned? There are only rare cases when this happens, so ensure that it's really not in use anymore, before you consider to delete it!

André

LucD
Leadership
Leadership
Jump to solution

With the DatastoreBrowser, see for example Orphaned Files Revisited

Or with the PSProvider, and filter the output on the path you want to check

$dsName = 'MyDatastore'

$ds = Get-Datastore -Name $dsName


New-PSDrive -Location $ds -Name DS -PSProvider VimDatastore -Root "\" | Out-Null

Get-ChildItem -Path DS:\ -Recurse | Select DatastoreFullPath,Length

Remove-PSDrive -Name DS -Confirm:$false

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

imcooltanmay
Enthusiast
Enthusiast
Jump to solution

It will take more time to login into ESXi and fetch VMDK details as i have huge list of VMDK's and I have found orphaned file from RV Tools report

0 Kudos