HP Insight Control server provisioning Capturing and Installing Linux System Images

15
2. Create the script content or copy and paste the script content from an external application. For example, the
script would contain:
#!/bin/bash
tar jxf /mnt/images/LinuxImages/$1.tar.bz2 -C /mnt/target
where the image name will be passed in as a parameter to the script step and the Media Server is mounted on
/mnt/images.
3. Click OK to save the script.
Fixup Linux Deployment Script
Create a new script that adjusts for any new hardware or partition changes after the image has been deployed to the
target server. The sample script provided takes care of writing a new MBR on the disk and fixing the network adapters.
To create a new script to adjust for new hardware and partitioning:
1. On the IC server provisioning appliance, create a new script of Unix type and name it for the appropriate
function.
2. Create the script content or copy and paste the script content from an external application. For example, the
script for SLES 11 SP3 would contain:
#!/bin/bash
# Mount devfs
mount -t devtmpfs dev /mnt/target/dev
# Remove old device.map file because it referred to old drive by UUID
rm -f /mnt/target/boot/grub/device.map
# write new MBR
chroot /mnt/target /usr/sbin/grub \
--device-map=/boot/grub/device.map << EOF
root (hd0,2)
setup (hd0)
quit
EOF
# clean up installation.
# Change network configuration/setup - Remove physical anchor
# settings.
sed -i -e '/^HWADDR/d' -e '/^UUID/d' \
/mnt/target/etc/sysconfig/network/ifcfg-eth0
rm -f /mnt/target/etc/udev/rules.d/70-persistent-net.rules
#
# Hostname
exit 0
3. Click OK to save the script.
Re-Install HP SA Agent Script
Create a new script that sets up the target server to re-install the HP SA Agent after the server has rebooted for the first
time into production. It is a fairly complicated script and requires that it be passed the Deployment IP address. The
script runs once on the server during the image deployment and then again when the server reboots.
To create a new script that re-installs the HP SA Agent after deployment: