At my current assignment, I got busy with the replacement of an existing vCenter Server and migration of all linked objects. This included migrating the vSphere Distributed Switch Port Group objects, settings and permissions.
Exporting the vSphere Distributed Switch configuration is an easy-to-do job using the GUI. However permissions are not included. This post is dedicated to the script I wrote to export and import these permissions.
Some time ago I had to find out the configured IP addresses of all VMkernel ports of all ESXi hosts in an environment because of a new IP subnet that had to be implemented.
Are you setting up a new greenfield environment with VMware vSphere? Or did you introduce a new NTP server in your environment? Read on how to bulk configure this on your ESXi hosts!
Today I stumbled upon an issue where I couldn’t power on a particular VM without triggering a PSOD (Exception 14) on the ESXi host the machine was registered on. This article describes the reason for the PSOD and how I solved it using PowerCLI.
My first scheduled session was with Alan Renouf and Luc Dekens, the PowerCLI gurus of VMware and always busy writing scripts and code to make the life of a VMware professional easier.
Alan Renouf and Luc Dekens slicing the PowerCLI cake.
During this session, Alan and Luc were sharing their best practices when using PowerCLI 5.5 Release 1 and PowerShell v3. I basically wrote down a list of these best practices and specifically the ones that come in handy during my activities. Hopefully it will come to good use for others.
- Use tags (introduced in vSphere 5.1). Tags can be read and written, which was not possible in earlier releases of PowerCLI
- vDS support. Now you can configure distributed switches
- Open your VM console using PowerCLI and share the URL with administrators to enable them to directly login to the VM console without logging into vSphere Web Client.
- vCloud Director 5.5 support
- Configure ESXi host licenses
- Make sure when processing data, that you filter the search before filtering the results to speed up the processing of your command or script.
- Don’t use Write-Host, instead use Write-Verbose or Write-Warning
- Use venter Alert Actions to automate in a very easy way. Let’s say after deploying a VM, you want to automatically run a script in the VM that installs AntiVirus software, or your CMDB gets updated automatically. There are numerous amount of alerts available in vCenter which you can use out-of-the-box
- WebCommander, a VMware fling which presents PowerCLI scripts, for any kind of product (View, vCloud Director, vSphere etcetera) in a web-based view available to you, the scripter/programmer and also your users. It’s even possible to give users a direct link to your scripts. Looks like an App store for PowerCLI scripts 🙂
- Check out PS-Remoting to re-use PowerCLI sessions open to your vCenter Server. This decreases load on your vCenter server and increases the speed of your scripts, since the initial load only happens once, when you open up the session.
WebCommander, a fling by VMware
Thanks to Alan and Luc for their session and dose of humour 🙂