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
To XML install or not to XML install
For as long as I know, I have used PowerShell to install Internet Information System (IIS). The method of which I use PowerShell to install the features have changed, but its still PowerShell.
Originally I was given an XML file that was generated, and I would use that to install the features, but once my scripting skills advanced I learned that there were other ways to do it. … Continue reading
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
Gateway to PowerShell Scripting
One of the admins on my team asked the question to me, “How would I get the gateway information from a list of servers?”
I stopped to ponder this issue, and immediately said, “WMI queries is the way I would do this.”
The Thought Process to Select WMI
In my environment PowerShell remoting isn’t configured everywhere, so it wouldn’t be a good option.… 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
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
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
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 Module for Detecting Vulnerabilities to Speculative Execution
Microsoft today (Jan. 4th, 2018) provided a PowerShell module to detect vulnerabilities related to Speculative Execution side-channel attacks. This vulnerability affects Intel, AMD and ARM processors, along with operating systems. You can review the Microsoft security advisory ADV18002 here.
This will install the module to your local machine
*if you are having issues with install the module via the command above you can find the module on my github here.… Continue reading
How to Enable SSH for VMhost with PowerCli
To enable SSH:
Get-VMHost <HostName> | Get-VMHostService | Where Key -EQ "TSM-SSH" | Start-VMhostService
To disable SSH:
Get-VMHost <HostName> | Get-VMHostService | Where Key -EQ "TSM-SSH" | Stop-VMHostService -Confirm:$False
– Stuart… Continue reading