ADVERTISE HERE

PowerCLI: Return Datastore name by Canonical name

Title: PowerCLI: Return Datastore name by Canonical name
Author(s): (ICT-Freak.nl) Arne Fokkema
Target Audience: Technical - Intermediate
Current Revision:
First Published: 3 March 2010
Products: PowerCLI, VMware
UID: XD10208

Find out which datastore belongs to the Canonical name mentioned in the VMKERNEL log

Punchy Text: 

Find out which datastore belongs to the Canonical name mentioned in the VMKERNEL log

By Arne Fokkema - ICT-Freak.nl


EcoShell PowerCLI

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

 

VMKERNEL Warning

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!!

Return Datastore Name

The output will look like this:

vSphere PowerCLI

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.

EcoShell

Give the folder a name. I used the name Personal scripts:

New Node

The next step is to add a new script node:

Return Datastore Name

The last step is to paste the following code into the new created script node:

Script

Download Script HERE

If you want to run this script, you have to connect to vCenter first. Open VMware – Managed Hosts:

Managed Hosts

Click on Add managed host… to add a server:

Add managed host

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.

Parameters

And the script will return the Datastore name:

Return the Datastore Name

Now you are able to convert the Canonical name to the Datastore Name.

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

Technology Exchange: