Sample Operating System Configuration Template Files

This chapter contains the following sections:

Sample Linux Configuration Template Files

Sample Kickstart Configuration Template File for Linux Operating Systems

The following example shows the Kickstart configuration template file (ks.cfg) that is required for Linux operating system images:

 
#platform=x86, AMD64, or Intel EM64T

# System authorization information
auth  --useshadow  --enablemd5

# System bootloader configuration
bootloader --append="rhgb quiet" --location=mbr --driveorder=sda

# Partition clearing information
clearpart --linux --initlabel

# Use text-based install
text

# Firewall configuration
firewall –-disabled

# Run the Setup Agent on first boot
firstboot -–disable

# System keyboard
keyboard us

# System language
lang en_US

# Installation logging level
logging --level=info

# Provide url/location of image over http.
url --url=http://$PXE_NATIVE_WEBSERVER/image_name

#Reboot after installation
reboot

# Network information
network --bootproto=static --device=eth0 --ip=$PXE_IP 
  --netmask=$PXE_NETMASK --gateway=$PXE_GATEWAY  
  --hostname=$PXE_NAME --onboot=on

#Root password
rootpw $PXE_PASSWD

# SELinux configuration
selinux --disabled

# System timezone
timezone --utc America/New_York

# Install OS instead of upgrade
install

# Disk partitioning information
part /  --fstype="ext3" --size=8000

#Install required packages
%packages --nobase
wget

%post
wget http://$PXE_WEBSERVER/$PXEID/notify.html
  

Sample PXE Configuration Template File for Linux Operating Systems

The following example shows the PXE configuration template file (pxe.cfg) that is required for Linux operating system images:

  
default linux

label linux
kernel vmlinuz

append initrd=initrd.img ramdisk_size=9216 noapic acpi=off ip=dhcp ks=$PXE_KS_URL

prompt 0
timeout 0
  

Sample VMware vSphere ESXi Configuration Template Files

Sample Kickstart Configuration Template File for VMware vSphere ESXi Operating Systems

The following example shows the Kickstart configuration template file (ks.cfg) that is required for VMware vSphere ESXi operating system images:

   
vmaccepteula

#Set passsword for ESXi server, "$PXE_PASSWD" will be filled in by UCSD
rootpw $PXE_PASSWD

#For Local boot, uncomment the following line
#install --firstdisk --overwritevmfs

#For SAN boot, uncomment the following line
install --firstdisk=remote --overwritevmfs

#Configures the mangement vmknic interface for the ESXi host. All items 
  starting with "$" are variables that will be replaced by UCSD during the 
  PXE boot process.
network --bootproto=static --ip=$PXE_IP --netmask=$PXE_NETMASK 
  --gateway=$PXE_GATEWAY --vlanid=$PXE_MGMTVLAN  
  --nameserver=$PXE_NS --hostname=$PXE_NAME

%pre --interpreter=busybox
hwclock -d %LIVE_VAR_DATE_1% -t %LIVE_VAR_TIME_UTC_1%
date -s %LIVE_VAR_DATE_TIME_UTC_1%
cd /tmp
wget http://$PXE_WEBSERVER/$PXEID/web/track/log1

%firstboot --interpreter=busybox
cd /tmp
wget http://$PXE_WEBSERVER_MGMT_VLAN_IP/$PXEID/web/track/log3

wget http://$PXE_WEBSERVER_MGMT_VLAN_IP/$PXEID/web/track/log4


#Enable & start remote ESXi Shell  (SSH)
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh

#Enable & start ESXi Shell (TSM)
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell

wget http://$PXE_WEBSERVER_MGMT_VLAN_IP/$PXEID/web/track/log5


%post --interpreter=busybox --ignorefailure=true

cd /tmp
localcli network firewall set --default-action true
localcli network firewall set --enabled false
wget http://$PXE_WEBSERVER_MGMT_VLAN_IP/$PXEID/web/track/log2
wget http://$PXE_WEBSERVER_MGMT_VLAN_IP/$PXEID/notify.html -O /tmp/notify.html
localcli network firewall set --default-action false
localcli network firewall set --enabled true

#Power down the ESXi server after installation
poweroff
   

Sample PXE Configuration Template File for VMware vSphere ESXi Operating Systems

The following example shows the PXE configuration template file (pxe.cfg) that is required for VMware vSphere ESXi operating system images:

  
default image_name/menu.c32
menu title PXE Boot Home
timeout 70

label image_name
menu label Install VMware image_name
kernel image_name/mboot.c32
append -c /web/ks-repository/$PXE_ID/boot.cfg  +++
IPAPPEND 1

Sample Windows Answer File

The following is an example of a Windows answer file, named AUTOUNATTEND.XML, that can be used to set up a Windows Server 2008 R2 OS image for use with Cisco UCS Director Bare Metal Agent.


<unattend>
 <servicing>
  <package action="configure">
    <assemblyIdentity name="Microsoft-Windows-Foundation-Package" version="6.1.7600.16385" 
    processorArchitecture="amd64" publicKeyToken="xxxf3856ad364xxx" language=""/>
    <selection name="IIS-WebServerRole" state="false"/>
    <selection name="IIS-WebServer" state="false"/>
    <selection name="Microsoft-Hyper-V" state="true"/>
    <selection name="Microsoft-Hyper-V-Management-Clients" state="true"/>
    <selection name="Microsoft-Hyper-V-Management-Clients" state="true"/>
    <selection name="MultipathIo" state="true"/>
    <selection name="TelnetClient" state="true"/>
   </package>
 </servicing>
<settings pass="windowsPE">  
 <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" 
   publicKeyToken="xxxf3856ad364xxx" language="neutral" versionScope="nonSxS">
  <ComplianceCheck>
 <DisplayReport>OnError</DisplayReport>
 </ComplianceCheck>
<Display>
   <VerticalResolution>600</VerticalResolution>
   <RefreshRate>60</RefreshRate>
   <HorizontalResolution>800</HorizontalResolution>
   <ColorDepth>32</ColorDepth>
 </Display>
 <EnableFirewall>false</EnableFirewall>  
<UserData>  
 <ProductKey>
  <WillShowUI>Never</WillShowUI>
  <Key>XXXXX-XXXXX-KQT8W-PMXWJ-XXXXX</Key>
 </ProductKey>
 <AcceptEula>true</AcceptEula>
 <FullName>Cisco</FullName>
 <Organization>CiscoUCSD</Organization>
 </UserData>
<DiskConfiguration>
 <WillShowUI>OnError</WillShowUI>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
 <Order>1</Order>
 <Type>Primary</Type>
 <Size>40000</Size>
 </CreatePartition>
 </CreatePartitions>
 <DiskID>0</DiskID>
 <WillWipeDisk>true</WillWipeDisk>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
 <Active>true</Active>
 <Extend>false</Extend>
 <Format>NTFS</Format>
 <Label>OS</Label>
 <Letter>C</Letter>
 <Order>1</Order>
 <PartitionID>1</PartitionID>
 </ModifyPartition>
 </ModifyPartitions>
 </Disk>
 </DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
 <DiskID>0</DiskID>
 <PartitionID>1</PartitionID>
 </InstallTo>
 <WillShowUI>Never</WillShowUI>
<InstallFrom>
<MetaData wcm:action="add">
 <Key>/IMAGE/NAME</Key>
 <Value>Windows Server 2008 R2 SERVERDATACENTER</Value>
 </MetaData>
 <Path>\\000.00.90.31\bits\sources\install.wim</Path>
 </InstallFrom>
 </OSImage>
 </ImageInstall>
 </component>
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" 
 publicKeyToken="nnnf3856ad364nnn" language="neutral" versionScope="nonSxS">
<SetupUILanguage>
 <UILanguage>en-US</UILanguage>
 </SetupUILanguage>
 <UserLocale>en-US</UserLocale>
 <UILanguage>en-US</UILanguage>
 <SystemLocale>en-US</SystemLocale>
 </component>
 </settings>
<settings pass="specialize">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" 
 publicKeyToken="nnnf3856ad364nnn" language="neutral" versionScope="nonSxS">
 <SystemLocale>en-US</SystemLocale>
 <UILanguage>en-US</UILanguage>
 <UILanguageFallback>en-US</UILanguageFallback>
 <UserLocale>en-US</UserLocale>
 </component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" 
 processorArchitecture="amd64" publicKeyToken="nnnf3856ad364nnn" 
 language="neutral" versionScope="nonSxS">
 <fDenyTSConnections>false</fDenyTSConnections>
 </component>
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" 
 publicKeyToken="31bf3856ad364nnn" language="neutral" versionScope="nonSxS">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
 <Description>Disable IPv6</Description>
 <Path>reg add HKLM\SYSTEM\CurrentControlSet\Services\tcpip6\Parameters /v DisabledComponents /t 
  REG_DWORD /d 255 /f</Path>
 <Order>1</Order>
 </RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
 <Description>Disable Shutdown Tracker</Description>
 <Path>reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Reliability" /v ShutdownReasonOn /t 
  REG_DWORD /d 0 /f</Path>
 <Order>2</Order>
 </RunSynchronousCommand>
 </RunSynchronous>
 </component>
<component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" 
 publicKeyToken="nnnf3856ad364nnn" language="neutral" versionScope="nonSxS">
 <DomainProfile_EnableFirewall>false</DomainProfile_EnableFirewall>
 <PrivateProfile_EnableFirewall>false</PrivateProfile_EnableFirewall>
 <PublicProfile_EnableFirewall>false</PublicProfile_EnableFirewall>
 </component>
<component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" 
 publicKeyToken="nnnf3856ad364nnn" language="neutral" versionScope="nonSxS">
 <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
 </component>
<component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" 
 publicKeyToken="nnnf3856ad364nnn" language="neutral" versionScope="nonSxS">
 <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
 </component>
<component name="Microsoft-Windows-powercpl" processorArchitecture="amd64" 
 publicKeyToken="nnnf3856ad364nnn" language="neutral" versionScope="nonSxS">
 <PreferredPlan>8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c</PreferredPlan>
 </component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" 
 publicKeyToken="nnnf3856ad364nnn" language="neutral" versionScope="nonSxS">
 <ComputerName>*</ComputerName>
 <ProductKey>XXXXX-XXXXX-KQT8W-PMXWJ-XXXXX</ProductKey>
 </component>
 </settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" 
 publicKeyToken="nnnf3856ad364nnn" language="neutral" versionScope="nonSxS">
<Display>
 <ColorDepth>32</ColorDepth>
 <HorizontalResolution>800</HorizontalResolution>
 <VerticalResolution>600</VerticalResolution>
 <RefreshRate>60</RefreshRate>
 </Display>
<OOBE>
 <HideEULAPage>true</HideEULAPage>
 <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
 <NetworkLocation>Work</NetworkLocation>
 <ProtectYourPC>3</ProtectYourPC>
 </OOBE>
<VisualEffects>
 <FontSmoothing>ClearType</FontSmoothing>
 </VisualEffects>
<WindowsFeatures>
 <ShowInternetExplorer>true</ShowInternetExplorer>
 </WindowsFeatures>
 <TimeZone>Pacific Standard Time</TimeZone>
 <RegisteredOrganization/>
 <ShowWindowsLive>false</ShowWindowsLive>
<UserAccounts>
<AdministratorPassword>
 <Value>987654321abc???=</Value>
 <PlainText>false</PlainText>
 </AdministratorPassword>
 </UserAccounts>
<AutoLogon>
<Password>
 <Value>123456abc???</Value>
 <PlainText>false</PlainText>
 </Password>
 <Enabled>true</Enabled>
 <LogonCount>1</LogonCount>
 <Username>Administrator</Username>
 </AutoLogon>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
 <CommandLine>cmd /c winrm quickconfig -quiet -transport:HTTP</CommandLine>
 <Description>Enable WinRS over HTTP to communicate with CPA</Description>
 <Order>1</Order>
 <RequiresUserInput>false</RequiresUserInput>
 </SynchronousCommand>
<SynchronousCommand wcm:action="add">
 <CommandLine>cmd /c winrm set winrm/config/client @{TrustedHosts="*"}</CommandLine>
 <Description>Adding trusted hosts value for winrm client</Description>
 <Order>2</Order>
 <RequiresUserInput>false</RequiresUserInput>
 </SynchronousCommand>
<SynchronousCommand wcm:action="add">
 <CommandLine>cmd /c net use R: \\000.00.90.31\bits /user:smbuser cisco123</CommandLine>
 <Description>Mapping the share to save the notification file</Description>
 <Order>3</Order>
 <RequiresUserInput>false</RequiresUserInput>
 </SynchronousCommand>
<SynchronousCommand wcm:action="add">
 <CommandLine>cmd /c ipconfig /all | findstr "Physical" >> R:\notifications\completed.html</CommandLine>
 <Description>Writing the completed notification log with MAC address at 
  Share mapped in previous step</Description>
 <Order>4</Order>
 <RequiresUserInput>false</RequiresUserInput>
 </SynchronousCommand>
<SynchronousCommand wcm:action="add">
 <CommandLine>cmd /c R:\notifications\completed.bat</CommandLine>
 <Description>executing powershell batch file like as wget</Description>
 <Order>5</Order>
 <RequiresUserInput>false</RequiresUserInput>
 </SynchronousCommand>
 </FirstLogonCommands>
 </component>
 </settings>
<settings pass="offlineServicing">
<component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" 
 publicKeyToken="nnnf3856ad364nnn" language="neutral" versionScope="nonSxS">
 <EnableLUA>false</EnableLUA>
 </component>
 </settings>
 <cpi:offlineImage cpi:source="wim:D:/win2k8r2x64sp1/sources/install.wim#Windows 
  Server 2008 R2 SERVERDATACENTER"/>
 </unattend>