0 out of 1 rated this helpful - Rate this topic

How to Create a Virtual Machine Template

Updated: January 23, 2013

Applies To: System Center 2012 - Virtual Machine Manager, System Center 2012 SP1 - Virtual Machine Manager

You can use the following procedure to create a virtual machine template. Virtual machine templates help you create new virtual machines and configure tiers in a service template. For more information about service templates, see Creating Service Templates in VMM.

noteNote
When you create a virtual machine template, you can customize IP address settings. Static IP address settings are available only when you deploy a virtual machine from a virtual machine template.

You can create a virtual machine template based on an existing virtual machine template or based on an existing virtual hard disk that is stored in a library. Alternatively, you can create a virtual machine template based on an existing virtual machine that is deployed on a host. This option requires that the existing machine has been stopped.

noteNote
The option to create a virtual machine template that is based on an existing virtual machine that is deployed on a host is not applicable for Linux-based virtual machine templates.

If you base your new virtual machine template on an existing virtual machine template or on a virtual hard disk that is stored in the library, you can configure hardware settings, guest operating system settings, application installations, and the installation of instances of Microsoft SQL Server. You can configure each of these settings manually, or you can import the settings from an existing profile. For more information about creating profiles, see Creating Profiles and Templates in VMM.

If you create a virtual machine template that is based on the Linux operating system, some of the Linux-specific settings, such as operating system specialization, work only if you deploy the Linux-based virtual machine on Hyper-V. For more information about creating Linux-based virtual machines, see Requirements for Linux-Based Virtual Machines.

ImportantImportant
Application deployment, SQL Server deployment, and configurable service settings apply only when you deploy the virtual machine as part of a service.

To create a virtual machine template that is based on an existing virtual hard disk or virtual machine template

  1. Open the Library workspace.

  2. On the Home tab, in the Create group, click Create VM Template.

    The Create VM Template Wizard opens.

  3. On the Select Source page, click Use an existing VM template or a virtual hard disk stored in the library, and then click Browse.

  4. In the Select VM Template Source dialog box, click the appropriate virtual hard disk or virtual machine template, click OK, and then click Next.

  5. On the VM Template Identity page, provide a name for the virtual machine template, and then click Next.

  6. On the Configure Hardware page, configure the hardware settings. If you have an existing hardware profile that you want to use, in the Hardware profile list, click the desired hardware profile. After you have configured the hardware settings, click Next.

    When you configure hardware settings, consider the following:

    • If you intend to deploy the virtual machine to a private cloud, under Capability you must select a cloud capability profile that is supported by the private cloud.

    • If you configure a network adapter to use static IP addresses, you must also set the media access control (MAC) address to static.

    • In System Center 2012 (without Service Pack 1 (SP1)), it is a known issue that the Enable spoofing of MAC addresses check box does not actually change the setting. You must enable spoofing of MAC addresses if you want to deploy a service to a Windows Server 2008 R2–based Hyper-V host (with or without SP1) with Network Load Balancing (NLB) enabled. To enable MAC spoofing, you must first create the template and then use the Virtual Machine Manager (VMM) command shell to configure the setting either in the template or in the hardware profile that you use for the template. For more information, see the Windows PowerShell commands in How to Configure NLB for a Service Tier.

    • If you are running System Center 2012 SP1 and the virtual machine will be on a host cluster, you can configure virtual machine priority for the virtual machine. For more information, see How to Configure Priority for a Virtual Machine on a Host Cluster in System Center 2012 SP1.

  7. On the Configure Operating System page, configure the guest operating system settings. If you have an existing guest operating system profile that you want to use, in the Guest OS profile list, click the desired guest operating system profile.

    The Guest OS profile list contains default guest operating system profiles for Windows and for Linux. Your choice of a profile determines the settings that are displayed for configuration.

    Configure the guest operating system settings, and then click Next.

    When you configure operating system settings, consider the following:

    • Under Identity Information:

      • For the Computer name you can provide a pattern to generate computer names. For example, if you enter server####, the computer names that are created are server0001, server0002, and so on. The use of a pattern ensures that the scaling out of a service generates unique computer names for the virtual machines and that the computer names that are generated are related and identifiable. If you use this method to specify the computer name, you cannot use it in combination with a name prompt parameter (@<name>@). You can use one method or the other, but not both.

      • DNS domain name is a Linux-specific option. Enter the domain name portion of the FQDN.

    • The Roles and Features settings apply only for Windows, and only if you use the virtual machine template in a service template. Also, if you want to use these settings with Virtual Machine Manager (VMM) in System Center 2012, the source virtual hard disk must have the Windows Server 2008 R2 operating system installed. With VMM in System Center 2012 SP1, the source virtual hard disk can have either Windows Server 2008 R2 or Windows Server 2012 installed.

    • The RunOnce commands apply only to Linux-based virtual machine templates. These commands will run in the specified order during deployment after the operating system has been configured. If shell conventions such as pipes are used, it is recommended to wrap each command with an explicit invocation of the shell. For example, /bin/sh –c “<your command>” . In this example, double quotes in the command must be escaped.

    • Under Root Credentials, Public SSH key is a Linux-specific option. This option sets the content of a specified public Secure Shell (SSH) key as an authorized key for authentication of the root user. Enter the name of a public key file that is stored in the VMM library, and that has the extension .sshkey.

    • To use the virtual machine template in a service template, under Networking, configure the settings as follows:

      noteNote
      Active Directory domain settings do not apply to Linux-based templates.

      • With VMM in System Center 2012: You must configure Active Directory domain settings. Use the fully qualified domain name (FQDN). For example, enter contoso.com as the domain name. The domain must have a two-way trust relationship with the domain of the VMM management server.

        To use the virtual machine template in a service template, under Admin Password, do not use the No local administrator credential required option. You can either specify the password of the local administrator account or select a Run As account.

      • With VMM in System Center 2012 SP1: You can specify Active Directory domain settings by using the FQDN or by using @ signs before and after (for example, by entering @Domain@). Using the @ sign in this way makes it possible for the necessary information to be entered when the virtual machine is deployed as part of a service. A trust relationship is not necessary between the domain where the service is deployed and the domain of the VMM management server.

        You can use the virtual machine template in a service template regardless of which option you choose under Admin Password.

  8. On the Configure Applications page, if necessary, configure the applications to install. If you have an existing application profile with settings that you want to use, select that application profile from the Application profile list. After you have configured the application settings, click Next.

    noteNote
    Application deployment settings do not apply if you use the template for stand-alone virtual machines that are not part of a service.

  9. On the Configure SQL Server page, if necessary, configure the installation of an instance of SQL Server. If you have an existing SQL Server profile that you want to use, in the SQL Server profile list, click the SQL Server profile. After you have configured the SQL Server settings, click Next.

    noteNote
    SQL Server settings do not apply if you use the template for stand-alone virtual machines that are not part of a service.

  10. On the Summary page, confirm the settings, and then click Create.

To create a virtual machine template from an existing virtual machine that is deployed on a host

  1. Open the Library workspace.

  2. On the Home tab, in the Create group, click Create VM Template.

    The Create VM Template Wizard opens.

  3. On the Select Source page, click From an existing virtual machine that is deployed on a host, and then click Browse.

  4. In the Select VM Template Source dialog box, click the desired virtual machine, click OK, and then click Next.

  5. On the VM Template Identity page, provide a name for the virtual machine template, and then click Next.

    WarningWarning
    A warning message advises you that creating a template will destroy the source virtual machine, and that any user data on the source virtual machine may be lost. To continue, click Yes.

  6. On the Configure Hardware page, click Next.

  7. On the Configure Operating System page, configure the guest operating system settings. If you have an existing guest operating system profile that you want to use, in the Guest OS profile list, click the desired guest operating system profile. After you have configured the guest operating system settings, click Next.

  8. On the Select Library Server page, click the library server for the virtual machine, and then click Next.

  9. On the Select Path page, click Browse, click a library share and optional folder path, click OK, and then click Next.

  10. On the Summary page, confirm the settings, and then click Create.

See Also

-----
For additional resources, see Information and Support for System Center 2012.

Tip: Use this query to find online documentation in the TechNet Library for System Center 2012. For instructions and examples, see Search the System Center 2012 Documentation Library.
-----
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.