How to list all the PowerCLI ESXCLI commands

PowerCLI logoLast week there was a question in the VMware VMTN Communities VMware vSphere PowerCLI forum from Papires who asked how you can convert the ESXCLI command ‘esxcli storage vmfs snapshot mount -l “DATASTORE”‘ into a PowerCLI command. I had not done very much with ESXCLI in PowerCLI, but I knew that it was something like ‘$esxcli.storage.vmfs.snapshot.mount’. However I was struggling with the ‘-l “DATASTORE”‘ part.

There is not much documentation available about the ESXCLI commands in PowerCLI. And also a search in Google did not help me very much. Finally I found the right answer using the PowerShell Get-Member cmdlet. Read more of this post

Advertisement

Use Performance Monitor to get VM performance statistics

PowerShell logoIn PowerCLI you can use the Get-Stat cmdlet to get performance statistics. But for Microsoft Windows virtual machines with the VMware Tools installed there is another way to get the statistics. Even without using PowerCLI. Read more of this post

Use PowerCLI to find the datastore from a disk name

PowerCLI logoRecently we get vSphere alarms in our environment that say for instance:

“[VMware vCenter – Alarm Host error] Issue detected on host in datastore: ScsiDeviceIO: 2368: Failed write command to write-quiesced partition naa.600a0b8000111155000021c53f97784e:1 (42:01:04:07.994 cpu7:5191)”

There seems to be a problem on a partition. But which datastore is on this partition? We can use PowerCLI to find the datastore involved. Read more of this post

Top Blog 2012 results

Today Eric Siebert announced the Top Blog 2012 results. When I nominated my blog for the Top Blog voting I was a little bit afraid that I might end up last. But I didn’t.

My results

Here are my results:

Category Place Votes
Overall 145 19
Favorite Scripting Blog 10 21
Favorite New Blog 12 38
Favorite Independent Blogger Not listed

Table1. My results at the Top Blog 2012 voting.

There were 187 blogs nominated in total. So I’m very happy with place 145.

This result stimulates me to try to write a lot of good blog posts this year. And I hope to do it even better in the Top Blog voting next year.

Thank you to all who voted for my blog!

Function to speed-up the execution of the first PowerCLI cmdlet

PowerCLI logo
Last year there was a post on the PowerCLI Team blog called How to speed-up the execution of the first PowerCLI cmdlet. That post showed commands you need to execute to pre-compile some of the PowerCLI code to prevent this from being done in every PowerCLI session.

Running these commands will speed-up the execution of the first PowerCLI cmdlet you run in your session. The blog post was made before PowerCLI 5.0 was released and didn’t show the commands to speed-up PowerCLI 5.0. Later there was a post at the vNugglets blog Speed Up First PowerCLI 5 cmdlet — Precompile XMLSerializers that shows the commands needed for PowerCLI 5.0.

But what happens when PowerCLI 5.1 or 6.0 is released? Of course we can try to find the new commands needed to speed-up PowerCLI every time a new version is released. But would it not be easier if we have a function that will do this for you?

The Install-PowerCLIXmlSerializer function presented in this post will show you a PowerShell function that you need to run once after you install a new PowerCLI version to speed-up the execution of the first cmdlet every time you run PowerCLI. Read more of this post

PowerCLI 5.0.1 Connect-VIServer repaired

PowerCLI logo
PowerCLI up to version 5.0.1 showed the connected servers in the title bar of the window. I found this very handy. Unfortunately though VMware has removed this feature in version 5.0.1. In this blogpost I present you a script that returns this feature. Read more of this post

Speed up your PowerCLI cmdlet typing with aliases

PowerCLI logoIf you are like me and managing a VMware vSphere environment is your daily job, and you want to automate your job as much as possible, you probably always have a PowerCLI session open. PowerCLI cmdlet names are sometimes pretty long. Of course you can use tab completion. But wouldn’t it be nice if you had short aliases for the PowerCLI cmdlets? Read more of this post

How to find VMware ESX(i) servers that need a reboot using PowerCLI

If you install patches to your ESX(i) servers you will probably have to reboot them. But if you don’t reboot them right after installing the patches, how can you find the servers that are patched and waiting for a reboot? Read more of this post

Using PowerShell to install the WDDM video driver

PowerShell logoYesterday we discovered that the system hangs, we sometimes have on our Windows Server 2008 R2 systems are caused by the video device driver. Because we don’t want to install another video driver manually in all our Windows 2008 R2 systems, we needed a script to do this. Read more of this post

Check your vSphere cluster hosts patch level with PowerCLI

PowerCLI logoIt is a best practise to keep all the hosts of a VMware vSphere cluster at the same patch level. That means that all the hosts need to have the same patches installed. But how do you easily check if this is the case? This is where PowerCLI will help you. Read more of this post