Change PS Prompt Based on vCenter Connection

The Prompt of a Different Color

In my work environment we are undertaking a major infrastructure upgrade.  We are doing a total refresh of all of the virtual environment, and with this we are also setting up a new vCenter.  With this it can get confusing with having multiple PowerShell ISE apps open and which vCenter I’m currently connected. … 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 | Measure -Property numCpuCores -Sum).sum)
[/PS]

This will be a handy script that can be ran rather quickly. … Continue reading

PowerCLI to Update VMHost Name

What’s your (host)name?

While digging through Log Insight on a problem, I found a new one.  A large majority of VMhosts were not configured with a proper hostname.  This was also backup by the vCheck report that gets generated weekly.  The hosts were configured with ‘localhost’ as the hostname, which makes this a huge pain when trying to follow the logs.… 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 tool 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

Selected for vExpert 2018 Program

Selected for vExpert 2018 Program

On Monday, was I was excited to find that I received the notice I had been selected as a vExpert for 2018 from the VMware community leader.  This was very happy news as this is the 4th year in a row that I have been selected as a vExpert.  Its a great honor to be included in this program with the other prestigious members.… Continue reading

Use PowerCLI to Get Log File When Tools are Broken

Use PowerCLI to Get Log File When Tools are Broken

Over the past weekend we had a massive push of VMware Tools and VM hardware updates.  For the most part this push was smooth except for 2 machines.  Of course these 2 machines are high priority development machines and rebuild just won’t work.

Trying to get a log file off a machine that doesn’t allow for the drivers to  install becomes when trying to research the issue. … 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

PowerCli to Increase Hardware on Multiple VMs

The other night I had a task of upgrading 22 VMs with additional vCPUs and memory.  I also had a maintenance window of 60 minutes to get this completed.  So I wasn’t going to do this more than once, so I just wrote a simple PowerCli script that would handle this process for me.

So this script starts off identifying the servers that the work is going to be performed on.… Continue reading