ServTechXSAutomatedx
Download
Report
Transcript ServTechXSAutomatedx
XenServer Master Class
Automated End-to-End Deployment of XenServer
Pablo Legorreta
William Elvington
Brian Tannous
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
© 2013 Citrix | Confidential – Do Not Distribute
Business Cases for Automation
Manual Deployment Process
Host
powered
on
Install
hotfixes
© 2013 Citrix | Confidential – Do Not Distribute
Boot via
installation
media
Configure
post-install
settings
Configure
initial
settings
XenServer
deployed
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
© 2013 Citrix | Confidential – Do Not Distribute
Simple XenServer Deployment
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
© 2013 Citrix | Confidential – Do Not Distribute
Advanced XenServer Deployment
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.)
© 2013 Citrix | Confidential – Do Not Distribute
Automating
XenServer Deployments
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
Post install
script
© 2013 Citrix | Confidential – Do Not Distribute
Boot via
network
installation
First boot
script
Silent install
provided by
unattend.xml
XenServer
deployed
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
Post install
script
© 2013 Citrix | Confidential – Do Not Distribute
Boot via
network
installation
Silent install
provided by
unattend.xml
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
Post install
script
© 2013 Citrix | Confidential – Do Not Distribute
Boot via
network
installation
First boot
script
Silent install
provided by
unattend.xml
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
Post install
script
© 2013 Citrix | Confidential – Do Not Distribute
Boot via
network
installation
First boot
script
Silent install
provided by
unattend.xml
XenServer
deployed
XenServer
Automated Installation
© 2013 Citrix | Confidential – Do Not Distribute
Demonstration:
Start Installation
Automated Install Process: Installation Process
Host Powers on and boots via network
Connects to TFTP server for PXELINUX and unattend.xml
Installs XenServer using HTTP repository
Download and runs
post-script.sh
Reboots
© 2013 Citrix | Confidential – Do Not Distribute
Automated Install Process: first-boot-script.sh
Runs upon each XenServer reboot. Begins by checking if first run:
Yes: first run
Download XenServer updates from HTTP server
Configure license server and license edition
Download and runs hostname.sh
Uses inventory CSV file: hostname, IP address, and pool master address
Reboot
© 2013 Citrix | Confidential – Do Not Distribute
Automated Install Process: first-boot-script.sh
Runs upon each XenServer reboot. Begins by checking if first run:
No: second+ run
Install XenServer updates
Download, clone, and configure virtual machines
Create resource pool
Using inventory CSV file
Cleanup
© 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!
© 2013 Citrix | Confidential – Do Not Distribute
SCAN
THIS!
Questions
Work better. Live better.
Appendix
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-bootscript.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).
© 2013 Citrix | Confidential – Do Not Distribute