PowerCLI: Return Datastore name by Canonical name
By Arne Fokkema - ICT-Freak.nl

When you are troubleshooting an ESX host, you can see a lot off warnings in the VMKERNEL log:

But which datastore belongs to the Canonical name mentioned in the VMKERNEL log??
The following script will return the Datastore name. Thanks @Lucd22 for the help!!

The output will look like this:
Ok, this is a nice script to have in you toolbox, but I hear you think, how do I add it to the VESI?.
First you need to create a new folder, if you don’t use any other Powerpack.
Give the folder a name. I used the name Personal scripts:
The next step is to add a new script node:
The last step is to paste the following code into the new created script node:

Download Script HERE
If you want to run this script, you have to connect to vCenter first. Open VMware – Managed Hosts:
Click on Add managed host… to add a server:
To connect to the new added vCenter server, press the connect under actions. To run the script click on the new create script node and enter a Canonical Name.
And the script will return the Datastore name:
Now you are able to convert the Canonical name to the Datastore Name.
- xtravirt's blog
- Login or register to post comments
Spotlight:
VMware Documentation Downloader v11.08.30
Updated for vSphere 5 - A free tool for those on the move who need information FAST
vSphere 5 License Entitlement Changes
See what has changed in the license entitlement in vSphere 5?
Thin Client vs Zero Client
The differences between Thin and Zero desktop clients for VDI








