Enable SSH across all vmHosts

I had the need to enable SSH on all my hosts to make configuration changes.  Instead of manually going to each host and enabling the service I searched for a powercli command.  I was able to find the following little snipit – and it did exactly what I wanted

Get-VMHost | Get-VMHostService | Where { $_.Key -eq “TSM-SSH”} | Start-VMHostService

This rolled through each host in the cluster and turned on the service.

When I was done I changed start to stop and turned off SSH across all the hosts.


Powershell to the rescue – Setting MTU size on a vmkernel port

During an implementation of Cisco UCS – one of the vmkernel ports on a standard switch was acting funny – it wasn’t getting set to the desired  MTU of 9000.  What made it odd is other kernel ports on that same switch were setting themselves correctly.  To resolve this – PowerShell to the rescue.  A quick search of google lead me to a post by Martijn Smit.  His blog post came in very handy as it provided the context of setting MTU for either a port group a vSwitch  or a standard switch.  In my case I was only worried about setting it on a VMKernel port.

From your vcenter you can capture the appropriate vmk port you need to set.  From PowerCLI

$vmkernel = GetVMHostNetworkAdapter Name vmk0 VMHost (GetVMHost Name esxi01.lab.local)
SetVMHostNetworkAdapter VirtualNic $vmkernel MTU 9000