Objective 8.1 - ESX Server Scripted Installation Print E-mail
Written by Matthijs van den Berg   
Tuesday, 07 April 2009 15:08

KNOWLEDGE

 

  • Explain the usage of the Scripted Installation wizard
    Scripted Installation can minimize the administrative effort needed for the installation and configuration of VM ware ESX server. Though you should always consider the time it takes to create a unattended installation vs the benefits of fast deployment and error free configuration (for example of the Virtual Switches that are always named in the same way!). Typical environments where an unattended installation is used are large enterprises and lab environments.
    When you enter a ESX server via the web interface you can select a installation script wizzard in the right pane.
  • Describe the various methods of automated deployment
    • CD Rom
      You can boot from CD and use a installation script from a separate media for a automated installation
    • HTTP/FTP
      Is is possible to boot a server from CD of PXE and define a FTP server for the Installation files and a HTTP server for the configuration files
    • NFS
      You can use NFS as network source for your installations files.
  • Define the directives contained in the installation script
    The installation scripts should exist of a couple of sections:
    • Command
    • %packages
    • %pre
    • %post
    • %vmlicense_text

 

 

SKILLS AND ABILITIES

  • Set up hardware and various connections
    • Boot from SAN
      To enable boot from SAN you need a few hardware part to support this:
      • SAN (duh!)
      • HBA’s that support boot from SAN (bios on HBA)
      • BIOS that allows you to set the HBA a boot device
    • Layout of local drives in various raid configurations
      Wow, not really VMware knowledge, but who cares. There are several RAID configurations possible for the ESX boot device:
      • RAID 1+0 / disk mirror – most used, fast and protects against disk failure. Requires twice the space that is usable.
      • RAID 5 (or 6) – Allows for more net. Disk space / less disk space wasted, but less performance and minimum of three disks needed. 
  • Create an install script and verify the following sections
    • Command
      The first part of the script. This part contains items like:
      • Installation Method
      • Root Password
      • Bootloader
      • Timezone
      • Installation mode (text / graphical)
      • Network settings during install
      • Languages
      • Firewall settings
      • Disk partitioning
      • License agreement
    • %packages
      The second part of the script contains the packages that will be installed. For a standard install this is ony:
      • @base
    • %pre
      This optional part can include commands that will be executed pre install
    • %post
      This optional part can include commands that will be executed post install. Some examples are:
      • Configuring the correct IP (based on hostname?)
      • Installing hardware support packages
      • Installing management agents
      • Configuration of Virtual Switches, firewall etc.
    • %vmlicense_text
      Used for host based licensing. Put this and the licensing information in you kickstart script to enable en configure host based licensing.
  • Configure Service Console components of an ESX server
    • Network Time Protocol (NTP)
      NTP syncs the host time with a time server in the internet. 
    • VMware has an article on their site on how to configure the NTP server via the CLI. You can find it here: http://kb.vmware.com/
    • In script this can look like:
    • ln -sf /usr/share/zoneinfo/Europe/Amsterdam 
      /etc/localtimeesxcfg-firewall -e ntpClient
      /etc/init.d/ntpd stop
      ntpdate <ntpserver> 
      hwclock --systohc --localtime 
      mv -f /etc/ntp/step-tickers /etc/ntp/step-tickers.BKU
      touch /etc/ntp/step-tickers
      echo 'server 127.127.1.0' >> /etc/ntp/step-tickers
      echo 'server '<ntpserver>'' >> /etc/ntp/step-tickers
      mv -f /etc/ntp.conf /etc/ntp.conf.BKU
      touch /etc/ntp.conf
      echo 'restrict kod nomodify notrap noquery nopeer' >> /etc/ntp.conf
      echo 'restrict 127.0.0.1' >> /etc/ntp.conf
      # echo 'server 127.127.1.0' >> /etc/ntp.conf
      echo 'server '<ntpserver>'' >> /etc/ntp.conf
      echo 'driftfile /var/lib/ntp/drift' >> /etc/ntp.conf
      chkconfig --level 345 ntpd on
      /etc/init.d/ntpd start
    • DNS
      If you would like to script this you need to adjust the resolv.conf
    • rm -f /etc/resolv.conf
      touch /etc/resolv.conf
      echo nameserver <dns_server_1> >> /etc/resolv.conf
      echo nameserver <dns_server_2> >> /etc/resolv.conf
      echo nameserver <dns_server_3> >> /etc/resolv.conf
      echo search <FQDN> >> /etc/resolv.conf
    • SNMP
      The SNMP configuration is saved in the file: /etc/snmp/snmpd.conf. An example configuration:
    • mv -f /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.BKU
      touch /etc/snmp/snmpd.conf
      echo '# Custom SNMP configuration' >> /etc/snmp/snmpd.conf
      echo 'dlmod cmaX /usr/lib/libcmaX.so' >> /etc/snmp/snmpd.conf
      echo 'rwcommunity <smnp_rw_string>  127.0.0.1' >> /etc/snmp/snmpd.conf
      echo 'rocommunity <smnp_ro_string>  127.0.0.1' >> /etc/snmp/snmpd.conf
      echo 'rocommunity <smnp_ro_string>' >> /etc/snmp/snmpd.conf
      echo 'trapcommunity <smnp_ro_string>' >> /etc/snmp/snmpd.conf
      echo 'trapsink localhost <SNMP Servers space separated>' >> /etc/snmp/snmpd.conf
      echo 'syscontact <e-mail address>' >> /etc/snmp/snmpd.conf
      echo 'syslocation <location>' >> /etc/snmp/snmpd.conf
      echo '# VMware MIB modules. To enable/disable VMware MIB items' >> /etc/snmp/snmpd.conf
      echo '# add/remove the following entries.' >> /etc/snmp/snmpd.conf
      echo 'dlmod SNMPESX            /usr/lib/vmware/snmp/libSNMPESX.so' >> /etc/snmp/snmpd.conf
      service snmpd restart
  • Install supported third party agents according to the design plan
    Depending on the hardware or management tools you are using you can install agents and hardware support packages like the HP Proliant  Support Pack or Altiris Agents on the ESX host. This can be done afterwards via the Remote Shell or during install by putting this installations in the %post section on your installation script.

    To do so make sure you transfer the software to a temp dir on the ESX host via FTP of NFS and use a single line command or a created script to start the installation. There are many examples available on the internet.

 

Additional Information

There are a couple of free Deployment solution you can use:

 

  • ESX Deployment Appliance
    • Tool used soly to deploy VMware ESX. Helps creating kickstart script
  • ESX Deployment Appliance (EDA) http://www.vmware.com/
  • Ultimate Deployment Appliance
    • (seems to abandoned??) For multiple OSes including ESX (templates).
  • Ultimate Deployment Appliance (UDA) http://www.ultimatedeployment.org/

 

TOOLS

 

  • VI client
  • CLI