VMware

VMware ESXi 5.5 zero touch builds – part 3 – storage

A note on storage

I won’t spend any time on NFS storage – it’s relatively straight forward, using a VMK with appropriate uplinks and failover. 

As hinted at in the previous post (interface vmmic override) ISCSI storage does however require additional configuration as per the ESXi storage guide http://pubs.vmware.com/vsphere-55/topic/com.vmware.ICbase/PDF/vsphere-esxi-vcenter-server-55-storage-guide.pdf (page 84). In short this boils down to a vmkernel interface having to be attached to a single vmnic  in a one-to-one configuration to be compatible with iSCSI port binding.

This can be achieved in two different ways:

  • Two separate vSwitches with a single VMkernel interface each and a single vmnic each. In this scenario the two VMkernel interfaces need to be configured on separate subnets to ensure no connectivity issues. As most storage platforms are presented on the same subnet this is not normally a viable option.
    iscsinetworking1
  • A single vSwitch uplinked with two vmnics and configured with two VMkernel interfaces. The vmnic adapter binding is overridden for each VMkernel interface with one active and one unused vmnic. This is more easily achieved and is in most situations the natural choice.  Read More
VMware

VMware ESXi 5.5 zero touch builds – part 2 – network configuration

Some notes on dynamic variables

Creating pointers / variable variables is required to loop through any number of vSwitches listed in the host configuration file. The easiest way is to normally use the “${!ReferenceVariable}” syntax, or arrays/associative arrays, but as mentioned in part 1 these simply don’t work in the Busybox Ash shell. The only way I’ve managed to get this to work is “$(eval echo “\${ReferenceVariable”)” – this seems to work OK, and I’ll stick with it until I come across something better.

vSwitches

All fairly straight forward – loop through the vSwitch variables set in the host configuration file and configure accordingly. I’ve set these up with standard vSwitches with

  • Uplinks
  • Failover / failback
  • Switch notify
  • Loadbalancing
  • Number of ports
  • MTU
  • etc

but this can be expanded to include any config required.

Read More

VMware

VMware ESXi 5.5 zero touch builds – part 1 – basics

Basics

I won’t go into too much detail about the ESXi automated build process – VMware do a good job of that in the ESXi 5.5 installation guide, on top of this the default kickstart file /etc/vmware/weasel/ks.cfg is a good starting point.

Creating dynamic zero touch builds is possibly overkill for most SME environments, but can be useful in it large scale estates like service provider environments. Ideally these should tie into proper CMDB / inventory databases, source control, continuous integration environments, etc., but this all depends on how much time/manpower/money you have available.

GitHub

All files – including apache license – can be found on https://github.com/dagsonstebo/VMware-ESXi-5.5-zero-touch-build-scripts.

Host specific PXE boot process

The standard VMware build PXE menu configuration is roughly as follows:

Read More

VMwareXenserver

Host config file export VBA script

Quick followup on the previous build script posts. In short the following will write host specific config files based on spreadsheet data, writing to files based on hostname in column 1 – in the following example “xs62cn1.cfg”.  

So, in short, a spreadsheet with the following entries:

CFG_HOSTNAME CFG_MANAGEMENTIP CFG_MANAGEMENTNETMASK
xs62cn1.mylab.lcoal 192.168.0.30 255.255.255.0

will result in a new config file xs62cn1.cfg with the following entries:

CFG_HOSTNAME="xs62cn1.mylab.local";
CFG_MANAGEMENTIP="192.168.0.30";
CFG_MANAGEMENTNETMASK="255.255.255.0";

VBA script:

Sub CreateHostConfigFiles()
'Exports spreadsheet data to config files

Dim intCol, intRow, arrHeaders(), intMaxcols, strOutputbuffer, objFSO, strFilename, arrFilename, objFile
    
    intRow = 2
    intCol = 1
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    
    'Find headings
    ReDim arrHeaders(0)
    While Cells(1, intCol) <> ""
        ReDim Preserve arrHeaders(UBound(arrHeaders) + 1)
        arrHeaders(intCol - 1) = Cells(1, intCol)
        intCol = intCol + 1
    Wend
    intCol = intCol - 1
    intMaxcols = intCol
    
    'Write config
    While Cells(intRow, 1) <> ""
        strFilename = Left(Cells(intRow, 1), InStr(Cells(intRow, 1), ".") - 1) & ".cfg"
        Set objFile = objFSO.CreateTextFile(strFilename, True)
        For intCol = 1 To intMaxcols
            strOutputbuffer = strOutputbuffer & arrHeaders(intCol - 1) & "=" & Chr(34) & Cells(intRow, intCol) & Chr(34) & ";" & Chr(10)
        Next
        objFile.write strOutputbuffer
        objFile.Close
        strOutputbuffer = ""
        
        intRow = intRow + 1
    Wend
    
MsgBox "All done"
   
End Sub
CloudStackXenserver

Citrix Xenserver 6.2 zero touch build scripts

Basics

Scripted builds for Xenserver 6.2 is outlined in http://support.citrix.com/servlet/KbServlet/download/34970-102-706044/installation.pdf. Xenserver build scripts run in the bash shell so are a bit more flexible than in ESXi. The following scripts allow for host specific dynamic zero touch builds – mainly for larger environments but can be used for any number of hosts.

All files discussed in this post can be found on https://github.com/dagsonstebo/Citrix-Xenserver-6.2-zero-touch-build-scripts.

PXE boot process

The PXE boot process for Xenserver builds is as follows:

  1. Host is PXE booted from pxelinux.cfg menu, each host specific menu entry specifies host specific  XML answer file.
  2. Host specific XML answer file specifies hostname and post build script.
  3. Post build script preloads actual build script, patches and drivers as well as host specific configuration file.
  4. Upon reboot build script configures host.

I.e. for each host we require a XML answer file and a host configuration file.

The menu config for Xenserver 6.2 is as follows:

LABEL XS62CN1 Xen 6.2
kernel mboot.c32
append xenserver62/xen.gz dom0_max_vcpus=1-2 dom0_mem=752M,max:752M \
com1=115200,8n1 console=com1,vga --- xenserver62/vmlinuz xencons=hvc \
console=hvc0 console=tty0 answerfile=http://192.168.0.100/xs62cn1.xml \
-answerfile install --- xenserver62/install.img

Answer file

The answer file specifies (see install guide for all options):

  • Install location
  • Keyboard mapping
  • Install file location
  • Root password
  • Post install script
  • NIC used during installation
  • Timezone
  • Hostname

Read More