I have multiple servers that need to be configured for SSH, is there anyway to script it? Any ideas how to make this process automated or easier to execute on multiple vSphere hosts?
I suspect you are running this against an ESXi server ?
On ESXi you can enable "unsupported" SSH but there I'm afraid it's not possible with a cmdlet.
See VMware ESXi – How to enable SSH Connectivity. for instructions.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can do this with the Set-VMHostFirewallException cmdlet.
Get-VMHost | Get-VMHostFirewallException | where {$_.Name -eq 'SSH Server'} | Set-VMHostFirewallException -Enabled $true -Confirm:$false
You can use the regular name masking on the Get-VMHost cmdlet, or you can insert another Where-Object cmdlet after the Get-VMHost cmdlet, if you want to select specific hosts.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for the quick response
so I tried to first run the command against one host
Get-VMHost -Name Myhost.Domain.com | Get-VMHostFirewallException | where {$_.Name -eq 'SSH Server'} | Set-VMHostFirewallException -Enabled $true -Confirm:$false
But I get error
7/23/2010 9:21:37 AM Get-VMHostFirewallException 668C7891-9D8A-4E88-ABC4-7A36F9DD144E Couldn't obtain reference to the firewall system of host with id: HostSystem-host-18045.
Is this becuase it's ESXi vSphere 4 ? I'm not able to view the current Firewall Exception either 😕 Get-VMHost -Name Myhost.Domain.com | Get-VMHostFirewallException
I suspect you are running this against an ESXi server ?
On ESXi you can enable "unsupported" SSH but there I'm afraid it's not possible with a cmdlet.
See VMware ESXi – How to enable SSH Connectivity. for instructions.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I have the instructions how to do it manually 😕 There is no document for cmdlets that only work for ESXi correct? should we really be looking at not using ESXi?
Thanks for expressing your oppinion
Hi,
http://kb.vmware.com/kb/1023990 provides a comparison between ESX and ESXi 4.x, review all the features and you have to take the call. There are pros and cons on using both the version all what I can say is that the future is with ESXi
If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
That discussion is already going on for some time and will probably continue for some time to come.
If we reverse the question in "Why would you need to SSH to ESXi ?", there aren't (m)any real reasons left.
I think that VMW will have an alternative for all the tasks for which we need SSH by the time ESX will disappear.
If we like the alternatives, from a PowerCLI point of view, is another matter
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Well.... Not everyone is the team likes to script or use powerCLI also VMware support does not feel confortable using it for troubleshooting ... They where the ones that ask for SSH to be turn on so they can look at logs quickly instead on changing to unsupported mode then look at logs
Thank you both for you assistanse on this discussion.