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

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

How to use VMware vSphere PowerCLI to find the MAC addresses of a virtual machine

PowerCLI logoIn the search engine queries that bring people to my blog, I see that some people are looking for a PowerCLI script that finds the MAC addresses of one or more virtual machines. Read more of this post

How to use VMware vSphere PowerCLI to find a virtual machine by MAC address

PowerCLI logoSometimes you need to find a virtual machine by MAC address. This can be very time consuming if you have to do this by hand using the VMware vSphere Client. PowerCLI can do this task for you in only a few seconds. The script presented in this blogpost will retrieve the virtual machine that has a certain MAC address. Read more of this post

How to use VMware vSphere PowerCLI to find an ESX/ESXi server by MAC address

PowerCLI logoIn “Virtual machine failed to power on” Monique Vanmeulebrouk describes a problem where in one stage she needed to find an ESX server that has a certain MAC address. Of course you can log in to all your ESX servers and issue the “ifconfig | grep -i hw” command as described in the VMware Knowledge base article “Identifying the ESX Service Console MAC address”. But this method takes a lot of time. You can do this much easier with VMware vSphere PowerCLI. Read more of this post

Valid values for the ViewType parameter of the PowerCLI Get-View cmdlet

PowerCLI logoThe ViewType parameter of the PowerCLI Get-View cmdlet needs a Managed Object Type as value. A list of these Managed Object Types can be found in the VMware vSphere API Reference Documentation.

However not all the Managed Object Types are valid as a value for the Get-View -ViewType parameter. The Get-View documentation doesn’t show you which Managed Object Types you can use. But if you use a Managed Object Type that is not valid, like “Alarm”, you will get an error message that shows you the valid types. Read more of this post