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
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
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
Have you been wanting to learn PowerCLI but don’t have a test environment to practice with out the fear of breaking live production? That is where this hands-on-learning (HOL) lab from VMware can come in handy. I personally worked through this HOL and found that the information that was provide to be very thorough to help with beginners wanting to start with PowerCLI. … Continue reading
This is a continuation of my last post, Using PowerCli to Build multiple VMs.
After automating the building of VMs, what’s the sense of having to manually add the IP information or updating the VMware tools? It’s pointless. So we need to add the IP information to the CSV file that was used to build the VMs.… Continue reading
My first script that I ever wrote was a script to build VMs. I was the newest member on the team, and i was giving the task of building 50 VMs for a new project that was getting started. It was a very daunting task, due to the completion date to have these 50 VMs to be completed.… Continue reading
In my environment at work we have a policy that we thin provision all new VMs. We had an issue with a datastore that was running out of space, so I starting looking into it and found that several of the VMs on this datastore were set with thick provisioning on the hard drives.
This outputs a list of VMs with the storageformat that is set to thick. … 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.
This is now how to properly get the unused RDM LUNs from your VM 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