Using NSH scripts to customize Citrix XenServer guests

BMC Server Automation provides Network Shell (NSH) scripts that you can use to customize Citrix XenServer guests.

Platform and template support

Scripts are available for the following platforms:

  • Microsoft Windows 2003
  • Microsoft Windows 2008
  • Red Hat Enterprise Linux

Pre-requisites for using the customization scripts

The following pre-requisites must be met prior to running the scripts:

  • A licensed BMC Server Automation agent must be installed and running on the virtual guest
  • Xen-tools and Dynamic Host Configuration Protocol (DHCP) must be enabled on the virtual guest
  • Sysprep must be present on the virtual guest for Microsoft Windows 2003 and Microsoft Windows 2008

    Note

    The scripts do not provide feedback about Sysprep completion. The script schedules the sysprep command to be run one minute following invocation.

Location of the scripts

The scripts are located in the installDirectory/NSH/scripts folder on the BMC Server Automation Application Server.

The file names are:

  • w2k3_guest_cust.sh
  • w2k8_guest_cust.sh
  • linux_guest_cust.sh

To invoke the scripts

The input file for the customization parameters uses the standard Sysprep xml format for Microsoft Windows, as follows:

  • For a Microsoft Windows 2003 virtual guest, the input file to the NSH script is the standard sysprep.inf file.
  • For Microsoft Windows 2008 virtual guest, the input file to the NSH script is the standard sysprep.xml file.
  • For Linux platforms, the script expects the input in a specific format (expand to see sample input):
 Click here to expand...

SERVER_NAME=137.72.2.2

NEW_HOSTNAME=hostname

NEW_ROOT_PWD=rootpwd

NEW_USER_NAME=username

NEW_USER_PWD=userpwd

NEW_DOMAIN=domain

NIC_NAME=eth0,eth1,eth2,eth3,eth4

NEW_IPADDR=192.168.1.0,192.168.1.1,192.168.1.2,"",192.168.1.4

NEW_NETMASK=192.168.1.0,192.168.1.1,192.168.1.2,"",192.168.1.4

NEW_BOOTPROTO=static,static,static,dhcp,static

NEW_GATEWAY=192.168.1.0,192.168.1.1,192.168.1.2,"",192.168.1.4

NEW_DNSSERV1=192.168.1.1

NEW_DNSSERV2=192.168.1.2

NEW_DNSSEARCH_LIST="dnssearch1.com dnssearch2.com"

Note

The value of the SERVER_NAME field in the Linux Customization Input File must be the current IP Address of the VM. This value is required for multiple reasons while changing the different settings on the VM.

Execute the following command to use the Citrix XenServer customization scripts:

$ nsh \--norc \-c "cd //<Virtual Guest Name/IP Address> ;\"//<NSH path to
customization NSH script>\" \"//<NSH path to input file>\""

For example:

"C:/Program Files/BMC Software/BladeLogic/8.1/NSH/bin/nsh"--norc \-c "cd //10.128.112.40 ; \"//@/C/Program Files/BMC Software/BladeLogic/NSH/scripts//linux_guest_cust.sh\"\"//@/C/Customization
Inputs/linux-customization.properties\""

For more information on using NSH scripts, see Working with Network Shell.

Was this page helpful? Yes No Submitting... Thank you

Comments