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.
(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)
This will be a handy script that can be ran rather quickly. … Continue reading
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
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
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
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
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
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.
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
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
After finishing the last post and starting to use it after limited testing I found that my script wasn’t filtering out the Datastores as expected. This information was presented to me via our storage team. So I have went back to the Integrated Scripting Environment (ISE) to resolved my issues.
$Cluster = "Cluster name here"
#This Line gets all of the LUNs that are connected to the first host in the cluster.
… Continue reading
This page has been updated. Please visit http://notesofascripter.com/?p=23 for the updated script.
Since my last post was about RDMs, lets continue the discusion. In my work environment we have been consolidating our VMware platform.
So we have been moving VMs with RDMs attached from one cluster to another. So its been a messy process, and we haven’t had the time to
clean up behind ourselves. … Continue reading