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 [...]
Posts under ‘Scripts’
$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 [...]
Export and import customization profiles using Powershell
One great thing in the automation of VM deployments is the use of customization profiles. These profiles are stored inside the vCenter Server database. However, when you loose the database, you also loose your customization profiles. Having customization profiles exported as xml files is always useful as a backup and luckily you can export and [...]
Reconnect ESX hosts using PowerShell
This week I ran into problems with vCenter server and almost all of my VMs were orphaned in vCenter. To resolve this issue I needed to disconnect/connect each ESX host. Because I hate doing repetitive tasks I created a little PowerShell script that I wanted to share with you.
# Variables
$VCServer = “vcserver.yourdomain.local”
$password = “rootPassword”
#Connect to [...]
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 [...]
Unattended upgrade of HP management agents
After upgrading to ESX 3.5 to update3, I found out that the HP management agents needed to be upgraded to version 8.1.1, since this version supports ESX3.5 update3. So I downloaded the new agents and decided to install the latest HBAAPI libraries from Qlogic too. These HBA libraries are not part of the HP agents [...]




