PowerCLI: Testing your networks

If you are knee-deep in a troubleshooting session with a customer you want to be able to have some tools ready that do some tests for you. One of the things that in my case has happened quite a lot was that some network were connected but couldn’t communicate outside of the host. So in a HPE Blade Enclosure infrastructure this was most likely a forgotten VLAN tag in the server profiles.

In order to quickly eliminate this problem I have worked on a script that helps you test every network in your environment.

Read More »

PowerCLI: Find Zombie Files on Datastores

Everyone who works in our industry is familiar with RVTools. It’s a great tool that achieves a lot in short time in terms of infrastructure checks. I would not want to do my job without it.

One customer wanted to have a e-mail report that showed the “zombie” files on their datastores. After a RVTool check they saw that they wasted a lot of space for not removed snapshot delta disks that were not removed by their backup solution. This is a problem we see in almost every environment.

Read More »

PowerCLI: Report Empty LUNs

Once again I’m writing about a customer use-case. In this case the customer wanted to know if all of his many LUNs were actually being used or if there were any they could delete and save some storage space.

The customer has a very big environment so it would have been tedious to do this task by hand. PowerCLI comes to the rescue in form of this very short script that will basically just put together some information and send it to you by email.

Read More »

PowerCLI: Automating VMware Tools and Hardware Upgrades

A couple of years ago I struggled with VMware Update Manager in a large environment. The Use case was to update about a 1000 VMs to the latest VMware Tools and VM Version (hardware). The VUM did not do the job and froze in the middle of the job. Unfortunately due to the Shutdowns and reboots required to to achieve this we only had a small windows to achieve this in. After one unsuccessful attempt to do this with the VUM we decided to script it.

The original script was published in 2009 somewhere (source in the script) and we took that script and added some features (like doing a snapshot before installation on a linux-vm) and recently I have updated the script to work with the latest VM version (13 from vSphere 6.5).

Read More »

PowerCLI: Automating VM Skeleton Deployment

We recently had to write a script for a customer which would deploy a VM skeleton. The script would be called from an automated solution the customer was building and had the following requirements:

  • Use given service-account for interaction in vCenter Server
  • Do different configuration based on the vm name which is passed as a parameter
    • test servers need to be placed in the “test” resource pool
    • test servers get a thin provisioned disk
    • production server need to be placed in “production” resource pool
    • production server need to placed in “test” resource pool
  • return value needs to be the MAC address of the created VM
  • VM must not exceed two vCPUs
  • VM must no exceed 8 GB RAM
  • VM disk must not be greater than 100 GB

Read More »

PowerCLI: Find differences between DNS-Name and VM Display-Name

My boss asked me to create a report which shows all the VMs that have a difference in DNS-hostname and the displayname shown in the client. The reason is simple: our backup solution sometimes has troubles when those values differ. And in some rare occassion we cannot find the VM on which we should be doing support on because the client only knows the dns-name and we can only find VMs by displayname.
Read More »