Script to backup your vCenter DRS Rules

I was thinking yesterday, I have a script that I run on a monthly basis to backup my vDS configs…  Shouldn’t I also have something that does the same for my DRS rules?  So, I wrote a script that I can schedule to run on a weekly/monthly basis to backup my DRS rules. I have multiple vCenter servers, so I…

Share This:
Read More

PowerCLI Script to create new vDS Portgroups

We deployed new hosts into one of our office locations.  Because these hosts would have different number of uplinks as well as use a LAG group instead of normal dvUplinks, we decided to create a new vDS Switch.  Then, we needed to re-create all the portgroups as well.  I figured, instead of manually adding 15-20 portgroups, I’ll automate it.  I…

Share This:
Read More

Disabling FCOE on vSphere 10gb NICs per VMware KB 2130092

So, we recently had an issue with some of our Dell blade vSphere hosts.  Seems they all crashed (PSOD) at the same time (6 nodes across 2 different clusters).  After submitting the log bundles and Dell TSRs, support recommended, along with upgrading drivers & firmware (the support go to!) that we remove FCoE from the NICs (as it’s not being…

Share This:
Read More

Creating shortcuts for PowerCLI that automatically log you in.

So, I started a new job a couple of months ago and we have multiple vCenter environments.  My friend & temporary co-worker, Brian Spagna (@bspagna) and I both wanted to have shortcuts to launch PowerCLI windows and have a different background color for each to easily identify which environment we were in.  We thought it would be cool to have…

Share This:
Read More

Patching VMware ESXi Hosts via PowerCLI!

*** Updated 5/17/2017 – See below *** This year, I’m trying something new…  Anything that I have to do more than 2-3 times, I’m going to attempt to automate it! In keeping with this mantra, I recently had a task come across my plate to patch the 20+ ESXi Hosts in one of my production environments.  Along with installing the…

Share This:
Read More

Display list of Multiple vCenter Servers to connect to in your PowerCLI Scripts

If you’re company anything like mine, you probably have multiple vCenter servers in your environment.  They may be linked, they may not.  In my environment, we have 4 vCenter servers we consider Production, even though one is for QA, and we have a lab environment. Normally, I just connect to vCenter manually in PowerCLI before I run a command/script to…

Share This:
Read More

Migrating Roles & Privileges from an old vCenter to a new vCenter using PowerCLI

So we’re finally upgrading an old environment running vCenter 4.0 to a new vCenter running 5.5.  Instead of attempting an upgrade, we’re building new.  As it’s a new build, we had to find a way to migrate the roles & privileges to the new vCenter. I have done this in the past utilizing the “Cheap Disaster Recovery” scripts from Gabe’s…

Share This:
Read More

Place a vSphere Host into Maintenance Mode via PowerCLI

So, we had two different vSphere hosts, in two different environments, have hardware faults this week.  One had a bad memory module, and the other a bad FAN.  As I launched the VI client for each environment and placed the problem host into maintenance mode, I started to think… “I bet I can automate this!” Depending on how complex your…

Share This:
Read More

You should backup your VDS Configs with PowerCLI

So, another vExpert that I follow on twitter (@h0bbel) recently had an issue in his home lab where he cut power to his lab, and his vDS lost all the portgroup names.  Seeing this post made me think, “I should probably backup MY vDS configs too, as my backups were pretty old! Here are some PowerCLI commands that I found…

Share This:
Read More

PowerCLI Script to list VMs not specifically set to Thick Eager Zeroed

First, I’ll start with a little back story. We recently deployed an EMC XTremIO All-Flash storage appliance.   The recommendation we got from EMC, for the best deduplication ratios, was to use the Thick-Eager Zeroed disk format.  No matter how many times I tell my coworkers to make sure to use this format when deploying VMs to the xTremIO LUNs, once…

Share This:
Read More