Posts Tagged ‘PowerCLI’

PowerShell / PowerCLI linkage

Since I started looking into PowerShell and PowerCLI, I gathered a couple of links which I found interesting and useful. I needed a way for them to be accessible anytime anywhere. Obviously the first thing that came across my mind was putting them on my blog somewhere.
I decided to dedicate a page on my blog [...]

PowerCLI: Get WMI info from isolated guests

A few weeks back I posted an article on matching Windows and VMware disks. Unfortunately this would work only if you could remotely query WMI information from that VM. If you have any VM that’s isolated or behind a firewall, you are out of luck. This bothered me, so I started looking for a uniform [...]

Match VM and Windows harddisks using PowerCLI

Today I was asked to extend a disk of a Windows virtual machine. Normally this is a standard procedure and finished within minutes. The hardest part of the procedure is to check the scsi id from within Windows and match the Windows disk to the corresponding virtual disk in the virtual machine’s hardware settings. Unfortunately [...]

$Null or Nothing?

When looking at a lot of PowerCLI scripts available I noticed that people tend to forget to validate their output. For example let’s look at the following piece of code:
$Vms = Get-VM
Although this command will return a collection in almost all cases, it can however return 3 different output types. It can return a collection, [...]

PowerCLI 4.0 Update 1- Another leap forward

Last week VMware released PowerCLI 4.0 Update1. According to the PowerCLI blog this new version contains over 60 new cmdlets as well as greatly improved performance.
One great thing is that they put the cmdlet reference online. I always like references online, because they are always at your disposal. When I ‘m working on my scripts, [...]

PowerCLI 4.0 U1 doesn’t reconnect to VIServer

When I was testing with the new PowerCLI feature to work with multiple VIServers, I ran into a bug. Whenever you disconnect from a VIServer you can’t reconnect to that server. You can however connect to another VIServer, but never to the same VIServer again.

As a workaround for this problem close your PowerCLI session and [...]

How big is my VM?

If you want to know the size of your vm, you probably first look at the size of the virtual disks in the vm’s settings, but there’s more to it. A virtual machine consists of the following set of files:

Config files (.vmx, .vmxf, .vmsd, .nvram)
Log files (.log)
Disk files (.vmdk)
Snapshots (delta.vmdk, .vmsn)
Swapfile (.vswp)

To make things more complicated, these [...]

List HBA WWPNs and LUNs using Powershell

Lately I’m moving around my VMs and storage luns between my ESX clusters a lot to accomplish a complete redesign of my Virtual Infrastructure. At some point I got lost and didn’t had the complete overview anymore. Which luns were attached to which cluster? To remove(unpresent) a lun from an ESX host/cluster on the storage [...]

Setting custom attributes with VMware PowerCLI

Last week I wanted to extend my vCenter with some extra custom attributes on my VMs. This would extend the usability of the Export List feature for reporting purposes. So together with Hal Rottenberg’s “Managing VMware Infrastructure with Windows PowerShell TFM” book in my hand, I took a dive into VMware PowerCLI (formerly known as [...]