I’ve wrote a PowerShell script to set basic settings on a new installed ESXi or check these settings against running systems.

If you don’t have host profiles licensed you can config a small set of basic settings to your whole cluster.

The script could set:

  • Timeserver
  • activate SSH and open port on firewall
  • set power management
  • create satp rule and MaxIO settings for Datacore

Prerequirements:

You will need some packages installed on your workstation:

Setup:

After all prerequirements are installed you can open the script.

In the first section you enter your VMware environment data

psscript_install_01

  • vCenter Server Name
  • Clustername (I use this script against several Cluster and don’t want to change the whole bunch of ESXi servers controlled by vCenter Server everytime.)

 

The second section is for the values you want to set

psscript_install_02

  • NTP Server
    enter your IPaddress / DNS name of your NTP server / if you set this value to $null no change would be made
  • SSH activation
    set value to ‘1’ an the scripts activates and starts the SSH server and opens the firewall ports / leave ‘0’ an no change wil be made
  • PowerPolicy
    To set the ESXi energy management set the value to 1 to get ‘HighPerfomance’, 2 for ‘Balanced’ and 3 for ‘LowPower’.
    I wrote an artice (ESXi host performance vs. power consumption) a few month ago in which I compared the pro’s and con’s which comes with ‘HighPerformance’ setting.
  • ALUA settings (DataCore)
    Actually I have only the settings for DataCore SANsymphony V. I’ve used the settings from DataCores Host Configuration Guide. If someone would test settings with his storage and best practises I could add more systems to my script.

You can run this script severall times against you Cluster. The script gives you response that everthing is set fine.

psscript_install_03