Creating VM templates
This topic describes the overview steps when creating a virtual machine (VM) template on VMware Virtual Center (vCenter). A VM template is a reusable image created from an existing VM.
You use these VM templates when creating a Virtual Guest Package (VGP) in BMC Server Automation.
Requirements and recommendations
Review the following requirements and recommendations for VM templates.
OS customization support
Before creating a VM template, ensure that your version of vCenter supports OS Customization for the specified guest OS. See the VMware vSphere online documentation regarding Operating System Compatibility for vCenter Server.
VMware Tools requirement
VMware Tools must be installed in all templates. Refer to the VMware online documentation for installation details.
Microsoft System Preparation (Sysprep) tool requirement
VMware vCenter uses the Microsoft System Preparation (Sysprep) tool to automate the deployment of various Microsoft operating systems. Sysprep must be present on the vCenter to support OS Customization for Microsoft Windows. If Sysprep is not present for a specific version of Windows, OS Customization will fail. This in turn causes the VirtualGuest create task to fail.
Recommendations
Adding a BMC Server Automation agent to the VM template
Before you use a VM template to create a VGP, use the following procedure to add a BMC Server Automation RSCD agent to the template:
- Convert the template to a VM.
- Install a BMC Server Automation RSCD agent on the VM (see Installing-only-the-RSCD-agent-Linux-and-UNIX and Installing-an-RSCD-agent-Windows).
- From a remote machine, use the BMC Server Automation agentinfo utility to ensure connectivity. Enter the following command:
agentinfo hostname
If the agent is not reachable, you may need to disable the firewall on the VM. - Delete the BladeLogicRSCD user before converting the VM to a template.
- Convert the VM back to a template.
Linux VM templates
Linux VM templates must include the following:
Modify the /etc/rc.d/rc.localscript to ensure successful DNS registration. See the following example for the recommended modification:
dhcpHostname=`grep "DHCP_HOSTNAME=.*" /etc/sysconfig/network`
dhcpHostname=`echo "$dhcpHostname" | sed "s/\s*//g"`
if [ -z "$dhcpHostname" ]; then
echo "DHCP_HOSTNAME=$HOSTNAME" >> /etc/sysconfig/network
reboot
else if [ "DHCP_HOSTNAME=$HOSTNAME" != "$dhcpHostname" ]; then
sed "s/DHCP_HOSTNAME=.*/DHCP_HOSTNAME=$HOSTNAME/g" /etc/sysconfig/network > /tmp/hostnamechange
mv /tmp/hostnamechange /etc/sysconfig/network
reboot
fi
fi- Distribute the UNIX Users custom object to the BMC Server Automation agent to validate users created on VMs. See the BMC Server Automation online technical documentation for details).