VMware Cloud Community
nava_thulasi39

Orphaned vmdk is not listed using the script

Hi,

I am using this LucD's script to find the orpahed vmdks list. Script exists in the below URL.

http://communities.vmware.com/thread/266913

I ran this script on vCenter as well as directly on ESXi. The script runs successfully and list nothing except the Datastore.

But when i checked the Datastore, i found some of orphaned vmdks. Looking for help to get exact list.

For example I attached the screenshot.Orphaned vmdk.jpg

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
8 Replies
mattboren
Expert
Expert

Hello, nava_thulasi39-

I'd say that a hint as to why you are getting little/no output is contained in the PowerCLI session in your screenshot:  what is the error message shown there, that begins with, "Exception", a few lines after you presumably call the script?

0 Kudos
LucD
Leadership
Leadership

I agree with Matt, the error message you get would be useful to analyse the problem


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

0 Kudos
nava_thulasi39

Thanks for the reply.

When i ran this script in vCenter, I am getting the Except error. Again when i try to connect ESXi server directly, it runs without any error message but it didn't find any orphaned vmdks.

Orphaned vmdk1.jpg

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
LucD
Leadership
Leadership

That looks like you might have

  • a ghost datastore in your vCenter
  • a datastore with some special characters in it's name

Does

Get-Datastore -Name 'datastore1 (3)'

return anything ?

Is that name in the list when you do

Get-Datastore


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

0 Kudos
nava_thulasi39

Hi,

Thanks for the quick reply.

Datastore: datastore1 (3) is the local datastore of another host which was down when i ran the script earlier.

So this datastore is available. Now the output is attached..

Orphaned vmdk2.jpg

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
LucD
Leadership
Leadership

Did you run the script to find the orphaned folders/vmdk files again ?

Any errors this time ?


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

0 Kudos
nava_thulasi39

Yes. I ran the script again. Except the Datastore name it doesn't give any output.

The output exists in the previous screen shot itself.. Thanks

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
LucD
Leadership
Leadership

Is that a VMFS or a NFS based datastore ?

If it's a VMFS datastore you could try the newer script from Orphaned files and folders – Spring cleaning

Btw did you check the settings of that VM called winxp3 ?

Where are its VMDK files located ?


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

0 Kudos