Generating VM Tags with PowerCLI

Generating VM Tags with PowerCLI

With the our new infrastructure upgrade it also included an upgrade to our backup solution.  So we now have EMC Avamar for backups, and with this it means a chance to architect the backup solution the best possible way.  So during the initial stage, I worked closely with our storage team to get the method that they chose to work. … Continue reading

Cisco UCS PowerTools and PowerShell

Cisco UCS PowerTools and PowerShell

As I mentioned in a previous post, we are upgrading our infrastructure and we are using Dell EMC VxBlock.  So far this upgrade is going fairly smooth, but we are still at the very beginning of the process.  So once I found out that the VxBlock was configured to contain UCS hardware, I began looking to see what Cisco had to offer for PowerShell modules to help manage the new hardware that we are getting. … Continue reading

PowerCLI to get Virtual to Physical CPU Ratio

PowerCLI to get Virtual to Physical CPU Ratio

I was in a meeting today, and was asked, “What is the current virtual to physical CPU ratio?”  I didn’t have an answer for this question, so I asked PowerCLI for the answer.

[PS]
(get-cluster $ClusterName | Get-vm | Where Powerstate -eq “PoweredOn” | Measure NumCpu -sum).sum / (((Get-cluster $ClusterName | Get-vmhost).extensiondata.summary.hardware… Continue reading

Removing Snapshots with PowerCLI

Snapshots for Maintenance or Maintenance for Snapshots…

During our last maintenance window for our VMware environment, my team updated VMware Tools, hardware and aligned vNUMA.  So before we started this work we took snapshots of all of the VMs there were getting the updates.  Fast forward a few days, and now we have 600+ snapshots that need to be deleted.… Continue reading

PowerCLI to Change Default Multipathing Policy

PowerCLI to Change Default Multipathing Policy

As it would seem in my environment the default multipathing policy changes with the seasons.  We have become very accustom to making these changes based on the newest whitepaper from the storage vendor.

To change the default multipathing policy, you will need to know the name of the Storage Array Type Plugin (SATP) that you need to change the Native Multi-Pathing (NMP) policy for.… Continue reading

PowerShell to gather Lenovo Warranty information

Lenovo Warranty Information Lookup

To continue with the theme of my last post, I’m going to show how to gather the warranty information for Lenovo Servers.  This was a bit tricky as this isn’t an API call, but more of a website parsing.

Getting the Lenovo Server information

To be able to perform this warranty lookup, the server information will need to be retrieved, and what a better way than getting it from the VMhosts themselves.… Continue reading

Issues with PowerShell Modules and Duplicate Cmdlets

At the end of the day I always take my laptop with me as I never know when I’ll get a call about server issues.  So my PowerShell sessions remain open all of the time, with all of the modules loaded.  Granted I do save my scripts that I work on frequently, and I had a problem before losing a few scripts without having a recent save.  … Continue reading

Using PowerCli to gather NIC settings

We had some changes recently in the environment, and the old DNS and WINS servers were decommissioned.  So I was tasked with getting all of the NIC settings of the virtual machines so we can see how many were using the old settings.  So I started with a simple WMI call to gather the settings from the NICs.… Continue reading

Setting up VMware Tools Shared Product Locker with PowerShell

With the changes to how VMware Tools will be released, we finally decided to setup Product Locker. These changes were released in September 2015 VMware decided that the tools would be no longer depended on vSphere releases or ESXi builds.

Download VMware Tools here

One of our other VMware engineers found a script (link here) that could do this task, but it was seemed like it was wrote for a smaller environment than what we work with.  … Continue reading

Get free space of all Datastores with PowerCLI

Before I spin up a new VM, I like to check which datastore has the most free space.  This can be completed with a PowerCLI command.

The problem with this, it it is too broad. This gets all of the datastores in vSphere, they are not in any sort of order, and it is also getting datastores that i wouldn’t normal use to put a VM on.  … Continue reading