pablo legorreta william elvington brian tannous xenserver master class automated end-to-end...
TRANSCRIPT
Pablo LegorretaWilliam ElvingtonBrian Tannous
XenServer Master ClassAutomated End-to-End Deployment of XenServer
© 2013 Citrix | Confidential – Do Not Distribute
Cisco
• Size and timelineᵒ 1000+ XenServer Host Designᵒ Three weeks
• Cisco’s vision for UCS
• Created scripting cookbookᵒ Framework of scripts
© 2013 Citrix | Confidential – Do Not Distribute
Applied Materials
• Size and timelineᵒ 200+ XenServer w/HDX 3D Pro Design & Build ᵒ Three weeks
• Automated process needed
• Installed & configured servers in < 2 weeks!
© 2013 Citrix | Confidential – Do Not Distribute
Agenda
• Business Cases for Automation• Simple XenServer Deployment• Advanced XenServer Deployment• Automating XenServer Deployments• Demonstration
Business Cases for Automation
© 2013 Citrix | Confidential – Do Not Distribute
Manual Deployment Process
Host powered
on
Boot via installation
media
Configure initial
settings
Install hotfixes
Configure post-install
settings
XenServer deployed
© 2013 Citrix | Confidential – Do Not Distribute
Manual Installation Pain Points
• Prone to human error and inconsistencies• Increased installation times at scale• Increased patching and configuration times• Manual rollback of installation• Manual media management
© 2013 Citrix | Confidential – Do Not Distribute
Business Cases for Automated Installation
• Rapid deployment of XenServers ᵒ Scaling out productionᵒ Deploy sandbox environmentsᵒ Scaling disaster recovery sites
• Introducing new configurations and maintaining uniformity• Rolling back new configurations• Reduce human error
Simple XenServer Deployment
© 2013 Citrix | Confidential – Do Not Distribute
Installation Method: From CD
• Process:ᵒ Mount and boot to ISO ᵒ Configure initial settings via wizardᵒ Install hotfixes via consoleᵒ Configure post-install settings via console
• Pros:ᵒ Simplest method to implement
• Cons:ᵒ Prone to human error and inconsistenciesᵒ Slowest method to install at scale
© 2013 Citrix | Confidential – Do Not Distribute
Initial Settings
• Boot disk• Root password• DOM0 vCPU and memory• Hostname• Management IP and interface• DNS name• NTP server• Time zone
© 2013 Citrix | Confidential – Do Not Distribute
Post-installation: Host Configurations
• XenServer hotfixes• Driver updates• Networking• Storage• Virtual machines
© 2013 Citrix | Confidential – Do Not Distribute
Post-installation: Resource Pool Creation
• Requirementsᵒ Homogeneous serversᵒ Static IPᵒ NTP serverᵒ No running VMs
• Lengthy processᵒ Join servers seriallyᵒ Server reboot recommendedᵒ Members receive pool configuration
Advanced XenServer Deployment
© 2013 Citrix | Confidential – Do Not Distribute
Installation Method: From Network
• Process:ᵒ Boot from network: DHCP/PXE/TFTP/HTTPᵒ Configure initial settings ᵒ Install hotfixesᵒ Configure post-install settings
• Pros:ᵒ Centralized installation repositoryᵒ Positioned to automate installation process
• Cons:ᵒ Requires networking components
© 2013 Citrix | Confidential – Do Not Distribute
Installation From Network: Boot Requirements
• DHCP Serviceᵒ Provide IP configuration to hosts
• Boot Image Deployment:ᵒ DHCP option 66 and 67ᵒ PXE Service: Port 67,68, or 4011
• TFTP Service: Port 69ᵒ PXELINUX boot environment
• HTTP Service: Port 80 and 443ᵒ XenServer installation mediaᵒ unattend.xmlᵒ Automation scripts
© 2013 Citrix | Confidential – Do Not Distribute
Installation From Network: PXELINUX
• Used to network boot Linux: pxe + linux (Xen)• Boot file: pxelinux.0• XenServer PXELINUX
ᵒ Copy all to TFTP root directoryᵒ Location:
• XenServer Install Media\boot\pxelinux
© 2013 Citrix | Confidential – Do Not Distribute
Installation From Network: PXELINUX Configuration
• Configuration: pxelinux.cfg/defaultᵒ Create this directory and file in TFTP rootᵒ Provides initial installation configurations
• unattend.XML location (optional)• DOM0 configuration
- CPU- Memory
• Default installation configuration (console, boot file, install, etc.)
AutomatingXenServer Deployments
© 2013 Citrix | Confidential – Do Not Distribute
Automating XenServer Deployments
• Utilize network installation method
• Automation Opportunities:ᵒ Silent installᵒ XenServer updatesᵒ Driver updatesᵒ Create and configure virtual machinesᵒ XenServer resource pool creationᵒ Scaling outᵒ Server can be reimaged
© 2013 Citrix | Confidential – Do Not Distribute
Automated Deployment Process
Host powered on
Boot via network
installation
Silent install provided by
unattend.xml
Post install script
First boot script
XenServer deployed
© 2013 Citrix | Confidential – Do Not Distribute
Installation Automation: Unattend.XML
• Referenced via pxelinux.cfg/default• Configurations
ᵒ Primary diskᵒ Guest diskᵒ Keymapᵒ Root passwordᵒ Installation source locationᵒ Driver source locationᵒ Post installation scriptᵒ Admin network interfaceᵒ Time zoneᵒ Name serverᵒ Hostnameᵒ NTP server
© 2013 Citrix | Confidential – Do Not Distribute
Automated Deployment Process
Host powered on
Boot via network
installation
Silent install provided by
unattend.xml
Post install script
© 2013 Citrix | Confidential – Do Not Distribute
Installation Automation: Post Install Script
• Referenced via unattend.xml• Runs at end of installation before first reboot• Purpose
ᵒ Downloads first boot scriptᵒ Sets first boot script to execute on each boot
© 2013 Citrix | Confidential – Do Not Distribute
Automated Deployment Process
Host powered on
Boot via network
installation
Silent install provided by
unattend.xml
Post install script
First boot script
© 2013 Citrix | Confidential – Do Not Distribute
Post-Installation Automation: First Boot Script
• Referenced via post install script• Purpose
ᵒ Run during each bootᵒ Perform post-installation configuration via xe and shell commandsᵒ Clean up after itself
• Potential post installation configurationsᵒ Specify license and license serverᵒ Perform hotfixesᵒ Driver updatesᵒ Configure network settingsᵒ Import virtual machinesᵒ Configure resources poolsᵒ Anything that can be done via xe
© 2013 Citrix | Confidential – Do Not Distribute
Automated Deployment Process
Host powered on
Boot via network
installation
Silent install provided by
unattend.xml
Post install script
First boot script
XenServer deployed
XenServerAutomated Installation
© 2013 Citrix | Confidential – Do Not Distribute
Demonstration:Start Installation
© 2013 Citrix | Confidential – Do Not Distribute
Automated Install Process: Installation Process
Reboots
Download and runspost-script.sh
Installs XenServer using HTTP repository
Connects to TFTP server for PXELINUX and unattend.xml
Host Powers on and boots via network
© 2013 Citrix | Confidential – Do Not Distribute
Automated Install Process: first-boot-script.sh
Reboot
Download and runs hostname.shUses inventory CSV file: hostname, IP address, and pool master address
Configure license server and license edition
Download XenServer updates from HTTP server
Runs upon each XenServer reboot. Begins by checking if first run:Yes: first run
© 2013 Citrix | Confidential – Do Not Distribute
Automated Install Process: first-boot-script.sh
Cleanup
Create resource poolUsing inventory CSV file
Download, clone, and configure virtual machines
Install XenServer updates
Runs upon each XenServer reboot. Begins by checking if first run:No: second+ run
© 2013 Citrix | Confidential – Do Not Distribute
XenServer Deployed!
© 2013 Citrix | Confidential – Do Not Distribute
How to Get Started
• Download package to Windows Server: http://bit.ly/XSAIM
• Execute XSAIMunpack.exe
• Copy required files(details in appendix):ᵒ XenServer 6.1 installation mediaᵒ XenServer hotfixesᵒ Virtual machine template
• Configure environment specificsᵒ XSPools.csvᵒ Get creative!
SCAN THIS!
Questions
Work better. Live better.Work better. Live better.
Appendix
© 2013 Citrix | Confidential – Do Not Distribute
Documentation
• http://docs.vmd.citrix.com/XenServer/6.1.0/1.0/en_gb/
• http://support.citrix.com/article/CTX134586
© 2013 Citrix | Confidential – Do Not Distribute
PXE Setup/pxelinux Documentation
• http://www.syslinux.org/wiki/index.php/PXELINUX
• http://support.citrix.com/article/CTX116021
• http://support.citrix.com/article/CTX137332
© 2013 Citrix | Confidential – Do Not Distribute
XSAIM Tool details: Directory template• Root directory
ᵒ NWA_PXE• XS61
- XenServer installation media copied here- boot
- pxelinux • mboot.c32• menu.c32• pxelinux.0• pxelinux.cfg
• default• XSScripts
- Scripts go here (First boot, post install, ect.)• XSTemplates
- VM template exported from XenServer goes here• XSUpdates
- xsupdate files go hereᵒ Serva.chmᵒ Serva.evcᵒ Serva.iniᵒ Serva32.exe
© 2013 Citrix | Confidential – Do Not Distribute
XSAIM Tool details: TFTP Server Directory
• The TFTP server root directory is configured to serve from the ROOT\NWA_PXE\XS61 directory. The TFTP server root directory contains a copy of the following files listed below:ᵒ XenServer 6.1 install image filesᵒ XenServer 6.1 install image\boot\pxelinux\pxelinux.cfgᵒ XenServer 6.1 install image\boot\pxelinux\mboot.c32ᵒ XenServer 6.1 install image\boot\pxelinux\menu.c32ᵒ XenServer 6.1 install image\boot\pxelinux\pxelinux.0
© 2013 Citrix | Confidential – Do Not Distribute
XSAIM Tool details: HTTP Server Directory
• XS61. The contents of this directory are described in the TFTP Server section above.
• XSScripts. This directory contains the scripts required for the XenServer automated installation. These files are as follows:ᵒ first-boot-script.sh ᵒ hostname.shᵒ post-script.shᵒ XSPool.csv
• XSTemplates. This directory contains the virtual machine template required for virtual machine creation.
• XSUpdates. This directory contains the XenServer update files, which are applied in alphabetical order.
• unattend.xml. Used for unattended installation configuration
© 2013 Citrix | Confidential – Do Not Distribute
XSAIM Tool details: XSScripts details
• default file. The XenServer default is a configuration file that allows for an unattended installation of XenServer. The pxe boot configuration as well as a location to the unattend.xml file.
• unattend.xml answer file. The XenServer unattend.xml is a configuration file that allows for an unattended installation of XenServer. This file contains the keymap settings, local storage configuration, root password, installation media and post-installation locations, as well as network time configurations. A full list of the unattended.xml configurations can be found at: CTX130421.
• post-script.sh. The post-script.sh script runs at the very end of the XenServer installation. This script is only used to download and configure the first-boot-script.sh to run at startup of the XenServer host. Note: This file must be saved using UNIX format line endings (LF).
© 2013 Citrix | Confidential – Do Not Distribute
XSAIM Tool details: XSScripts details• first-boot-script.sh. The first-boot-script.sh script runs after the newly imaged
XenServer’s first boot. This script is used to automatically configure a newly imaged XenServer host. Firstly, the XenServer host will download XenServer update files from the HTTP server, assign a license, and set the hostname. After a reboot, the host will continue by patching itself using updates downloaded in the previous step in order by file name. If a given update requires a reboot or a XAPI restart the required action will be preformed and the host will continue where it left off. After patched, the host will then download a virtual machine template from the HTTP server, clone two virtual machines from the template, and assign the appropriate networks to these virtual machines. Next, the XenServer host will join its pool by using the information assigned within the XSPools.csv inventory file. Finally, the host will preform a cleanup of the installation method. Note: This file must be saved using UNIX format line endings (LF).
© 2013 Citrix | Confidential – Do Not Distribute
XSAIM Tool details: XSScripts details
• hostname.sh. The hostname.sh script downloads the XSPools.csv inventory file and searches for the host’s hostname. If the host’s management IP address matches a machine in the inventory, the hostname and name-label of the XenServer host will be configured as per the inventory file. Note: This file must be saved using UNIX format line endings (LF).
• XSPools.csv. The XSPools.csv inventory file is a list of XenServer hostnames, management IP addresses, and it’s pool master’s IP addresses. Note: This file must be saved using UNIX format line endings (LF).