Creating Generation 1 Virtual Machine Templates on SCVMM
Use the following instructions to create Virtual Machine Templates that you can use for Guest Customization of Virtual Machines on the System Center Virtual Machine Manager (SCVMM) for Microsoft Hyper-V.
The exact instructions depend on the operating system; instructions are provided for templates for Windows 2003, Windows 2008 and Windows 2012, and Red Hat Enterprise Linux.
- Before you begin
- Creating templates on SCVMM for Windows 2003 (x86 and x64)
- Creating templates on SCVMM for Windows 2008 or Windows 2012 (x86, x64, and R2)
- Creating templates on SCVMM for Red Hat Enterprise Linux
- Creating Linux templates on SCVMM 2012
Before you begin
Ensure that you have reviewed the requirements for setting up a Microsoft Hyper-V environment, and have added the SCVMM server to TrueSight Server Automation.
Creating templates on SCVMM for Windows 2003 (x86 and x64)
- On the SCVMM Admin Console, create a new Virtual Machine and install Windows 2003 on it.
- Set the Guest OS of the VM to Windows 2003.
Depending upon your installation, select 32-bit or 64-bit. - Install Virtual Guest Services (Microsoft Tools) on the VM, after ensuring that your Windows 2003 is patched with at least SP2.
- From the OS Installation disk, extract the files in Support/Tools/Deploy.cab, and copy the extracted files to the newly created VM to the following folder: C:\winsysprep
- Within the VM, open a command prompt and browse to the C:\winsysprep directory.
Run the following command: sysprep.exe /reseal /quiet /shutdown
The VM reboots and undergoes sysprep and will ultimately shut down.
- Right click on the VM and select Properties. Ensure that there are no floppy disks or DVDs connected to VM.
- Right click the VM and select New Template.
During the process, do not make any hardware changes to the VM. During the Template creation process, a panel for Guest Customization appears.
From the drop down menu, select the Customization not requiredoption.
After the job has finished running, the template is ready for use.
Creating templates on SCVMM for Windows 2008 or Windows 2012 (x86, x64, and R2)
- On the SCVMM Admin Console, create a new VM and install Windows 2008 or Windows 2012 on it.
- Set the Guest OS of the VM to Windows 2008 or Windows 2012, as applicable.
Depending on your installation, select 32-bit or 64-bit or R2. - Install Virtual Guest Services (Microsoft Tools) on the VM.
- Within the VM, open a command prompt and browse to the C:\Windows\system32\sysprep directory.
Run the following command: sysprep.exe /oobe /generalize /quiet /shutdown
The VM reboots and undergoes sysprep and will ultimately shut down.
- Right click on the VM and select Properties. Ensure that there are no floppy disks or DVDs connected to VM.
- Right click the VM and select New Template.
During the process, do not make any hardware changes to the VM. During the Template creation process, a panel for Guest Customization appears.
From the drop down menu, select the Customization not requiredoption.
After the job has finished running, the template is ready for use.
Creating templates on SCVMM for Red Hat Enterprise Linux
- Ensure that you have added the Linux OS ISOs to the Library Server.
- On the SCVMM Admin Console, create a virtual machine on a Linux Guest OS.
- Install the Linux Integration Services on the virtual machine.
- Turn off the virtual machine.
- Right click the VM and select New Template.
During the process, do not make any hardware changes to the VM. During the Template creation process, a panel for Guest Customization appears.
From the drop down menu, select the Customization not requiredoption.Select the Library Server where you want to store this template and step through all other wizard steps.
The virtual machine is converted to a template. After the job has finished running, the template is ready for use.
Creating Linux templates on SCVMM 2012
This section describes how to create a Linux template for Hyper-V SCVMM 2012.
Configuring a VHD
Configuring a VHD for use in a Linux VM template involves the following steps:
Create a virtual machine (or use an existing one) and install your Linux operating system. For more information, see Creating a VM Template.
- Install or update the latest Hyper-V Linux Integration Services. For more information, see Installing the Hyper-V Linux Integration Services.
- Install the VMM Agent for Linux - the VMM Agent for Linux is a small agent that receives incoming configuration from VMM and applies the OS configuration. Following a successful VM deployment, the agent removes itself. For more information, see Installing the VMM Agent for Linux.
- To make this prepared VHD available for templates, shut down the VM, and copy the VM to a VMM Library share and refresh the VMM Library.
Creating a VM Template
The steps to create a VM Template are:
- In the Library pane of the VMM console, launch Create VM Template
- Select Use an existing VM template or virtual hard disk stored in the library, click Browse, and select your template VHD.
- Provide a name for the VM template and click Next.
- Select an existing hardware profile, or configure a new one. The Hardware Profile configuration is common to both Windows and Linux Virtual Machines. Click Next.
- On the Configure Operation System page, select Create new Linux operating system customization settings. Alternatively, you can create a Linux OS Profile before launching the VM template wizard and select it here.
Installing the Hyper-V Linux Integration Services
Please download the installer from: http://www.microsoft.com/en-us/download/details.aspx?id=34603
To install Linux Integration Services Version 3.4:
- Open Hyper-V Manager: Click Start, point to Administrative Tools, and then click Hyper-V Manager.
- Create a new virtual machine where you will install Linux: In the Actions menu, click New, and then click Virtual Machine.
- Specify the Linux installation media: Right-click the virtual machine that you created, and then click Settings. In IDE Controller, specify one of the following:
- An image file in ISO format that contains the files required for installation
- A physical CD/DVD drive that contains the installation media
- Turn on the virtual machine: Right-click the virtual machine that you created, and then click Connect.
- Begin installing Linux.
When prompted, restart the virtual machine and complete any first-boot configuration tasks.
- Log on to the virtual machine.
- In Hyper-V Manager, configure LinuxICv34.ISO (located in the directory where you extracted the downloaded files) as a virtual CD/DVD drive on the virtualmachine.
Once configured, the LinuxICv34.ISO should appear mounted under /media/CDROM if automount is enabled.
If automount is not enabled, use the following command to mount the ISO file:
# mount /dev/cdrom/media - As the root user, change to the directory relevant to your distribution: and run the command:
/install-rhel57.sh
Installing the VMM Agent for Linux
- On the VMM management server, open a command prompt session, with administrative rights.
- Go to the C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\agents\Linux folder.
- Copy all the agent installation files from that folder to a new folder on the virtual machine, and then, on the virtual machine on which Linux is running as a guest operating system, open the new folder.
- Run the following command:
chmod +x install Run either of the following commands, as appropriate:
./install scvmmguestagent.1.0.0.544.x64.tar
./install scvmmguestagent.1.0.0.544.x86.tar