Last active
February 20, 2016 17:58
-
-
Save vMarkusK/8099c8fd693661987f5a to your computer and use it in GitHub Desktop.
ESXi Basis-Konfiguration mit HP 3PAR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ESXiHostList = Get-VMHost | |
$syslog = "udp://syslog.test.lan:514" | |
$NTP1 = "192.168.2.1" | |
$NTP2 = "192.168.2.2" | |
foreach ($ESXiHost in $ESXiHostList) | |
{ | |
#Enable SSH and disable SSH Warning | |
$SSHService = $ESXiHost | Get-VMHostService | where {$_.Key -eq 'TSM-SSH'} | |
Start-VMHostService -HostService $SSHService -Confirm:$false | |
Set-VMHostService -HostService $SSHService -Policy "Automatic" | |
$ESXiHost | Set-VMHostAdvancedConfiguration -Name "UserVars.SuppressShellWarning" -Value 1 | |
Write-Host $ESXiHost ": SSH, configured." | |
#Config NTP | |
$ESXiHost | add-vmhostntpserver -ntpserver $NTP1 -confirm:$False | |
$ESXiHost | add-vmhostntpserver -ntpserver $NTP2 -confirm:$False | |
$ntpservice = $ESXiHost | get-vmhostservice | Where-Object {$_.key -eq "ntpd"} | |
Set-vmhostservice -HostService $ntpservice -Policy "on" -confirm:$False | |
$hosttimesystem = get-view $ESXiHost.ExtensionData.ConfigManager.DateTimeSystem | |
$hosttimesystem.UpdateDateTime([DateTime]::UtcNow) | |
start-vmhostservice -HostService $ntpservice -confirm:$False | |
Write-Host $ESXiHost ": NTP, configured." | |
#Remove PG | |
$defaultPG = $ESXiHost | Get-VirtualSwitch -Name vSwitch0 | Get-VirtualPortGroup -Name "VM Network" | |
Remove-VirtualPortGroup -VirtualPortGroup $defaultPG -confirm:$False | |
Write-Host $ESXiHost ": Default PG Removed." | |
#Configre Static HighPower | |
$view = ($ESXiHost | Get-View) | |
(Get-View $view.ConfigManager.PowerSystem).ConfigurePowerPolicy(1) | |
Write-Host $ESXiHost ": PowerPolicy Configured" | |
#configure Syslog | |
$ESXiHost | Get-VMHostFirewallException |?{$_.Name -eq 'syslog'} | Set-VMHostFirewallException -Enabled:$true | |
$ESXiHost | Set-VMHostAdvancedConfiguration -NameValue @{'Syslog.global.logHost'=$syslog} | |
Write-Host $ESXiHost ": Firewall for Syslog Configured" | |
#Configure HP 3PAR SATP/PSP Rule | |
$SATPesxcli = $ESXiHost | Get-EsxCli | |
$SATPesxcli.storage.nmp.satp.rule.add($null,"tpgs_on","P 3PAR custom rule",$null,$null,$null,"VV",$null,"VMW_PSP_RR","iops=100","VMW_SATP_ALUA",$null,$null,"3PARdata") | |
Write-Host $ESXiHost ": HP 3PAR SATP/PSP Rule, configured." | |
#Disable ATS HB (http://kb.vmware.com/kb/2113956) | |
Get-AdvancedSetting -Entity $ESXiHost.name -Name VMFS3.UseATSForHBOnVMFS5 | Set-AdvancedSetting -Value 0 -Confirm:$false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment