Tutorial: Getting Started Creating Virtual Machines in VMM

System Center Virtual Machine Manager 2007 (VMM) provides many methods for creating and configuring virtual machines, and several methods for creating standard configurations that you can use during virtual machine creation. However, if you understand three basic procedures featured in this tutorial, you will be able to apply the techniques using the methods that best meet your organization's needs.

To introduce you to virtual machine creation in VMM, this topic provides a tutorial in which you perform the following three basic procedures for creating virtual machines:

  1. Create a virtual machine with a blank virtual hard disk
  2. Create a template from the virtual machine
  3. Create a virtual machine from the template

During the course of this tutorial, you will be introduced to hardware profiles and guest operating system profiles, which you can use to import collections of settings into virtual machines and templates. You will also see how the host rating system recommends the most suitable hosts when you deploy a virtual machine.

Note

If you are not familiar with any of the concepts discussed in the procedures in this tutorial, see "Key Concepts: Creating Virtual Machines" (https://go.microsoft.com/fwlink/?LinkId=104141). These concepts include: virtual machine, virtual machine host, guest operating system, Virtual Machine Additions, virtual machine placement, host rating, virtual machine templates, hardware profile, guest operating system profile, virtual hard disk, virtual floppy disk, virtual DVD, virtual network.

TASK 1   Create a Virtual Machine with a Blank Virtual Hard Disk

Using the procedures in this section, you will create a virtual machine, install an operating system on the virtual machine, and then install Virtual Machine Additions on the virtual machine to enhance the performance of the user interface.

Create the Virtual Machine

When you create your first virtual machine, it is easiest to start with an existing virtual hard disk to get an overview of the process. The following procedure shows you how to create a virtual machine by using one of the two virtual hard disks that Setup downloads to the VMM server during installation. To demonstrate how host ratings work during virtual machine placement, you will deploy the virtual machine on a host.

Before You Begin

To perform these procedures, you must have added at least one virtual machine host to Virtual Machine Manager. If you have not done that, you can add the Virtual Machine Manager server as a host. For instructions, see "Adding and Configuring Hosts" (https://go.microsoft.com/fwlink/?LinkId=103440).

To create a virtual machine from a virtual hard disk

  1. Open the VMM Administrator Console. To do that, on the Start menu, click All Programs, point to Microsoft System Center, point to Virtual Machine Manager 2007, and then click Virtual Machine Manager Administrator Console.

  2. In the Actions pane on the right side of the console, click New virtual machine to open the New Virtual Machine Wizard.

  3. On the Select Source page, click Create the new virtual machine with a blank virtual hard disk, and then click Next.

  4. On the Virtual Machine Identity page, enter a virtual machine name and description for the virtual machine, and optionally specify the owner. The owner must have a domain account in Active Directory Domain Services (AD DS). All VMM administrators have access to the virtual machine in Virtual Machine Manager.

  5. On the Configure Hardware page, specify the hardware requirements for the virtual machine.

    This screen is used to specify memory and CPU requirements for a virtual machine, to configure a variety of "virtual" hardware to connect to physical hardware components on the host, to attach virtual hard disks to the virtual machine, to link to physical files such as image files, and to configure network connections.

    For now, you can accept the default configuration, which provides the processor capacity of a single 1.20 GHz Athlon MP processor and 512 MB of memory. You will need to configure the blank virtual hard disk that you will install the operating system on.

    Note

    Although the Processor entry does not actually specify hardware. The CPU type is used in calculating resource requirements for host ratings. Hosts with available CPU capacity equivalent to that of the specified CPU type receive a high rating.

    To configure the blank virtual hard disk for the virtual machine:

    1. Select the new blank virtual hard disk under IDE Devices.
      In the right pane, under Attachment, use the Channel field to select the channel on the IDE device to attach the virtual hard disk to. An IDE bus supports as many as four devices, including virtual hard disks and a virtual DVD drive.
    2. Under Type, select the type of virtual hard disk to configure -- Dynamic or Fixed. For more information, see "Creating Virtual Hard Disks" (https://go.microsoft.com/fwlink/?LinkId=104266).
    3. Under Size, specify, in megabytes (MB), either the size of a fixed virtual hard disk file or the maximum size to allow for a dynamically expanding virtual hard disk file.
    4. Under Destination file name, specify a file name for the virtual hard disk file.

    To configure additional hardware for the virtual machine, use the following procedures:

    • CPU Requirements -- Specify the processor resources on a host that you want a virtual machine to use. This entry does not actually specify hardware. The CPU type is used in calculating resource requirements for host ratings.
    • Amount of Memory -- Specify the amount of memory on a host that you want to allocate to any virtual machine created from the settings on this hardware profile.
    • Floppy Drive -- Specify the virtual floppy drive settings. The virtual floppy drive can read a physical floppy disk inserted into the physical floppy drive on the host or it can read a virtual floppy disk file.
    • DVD Drive or Virtual Hard Disk (IDE) -- Specify which IDE devices that you want to add and configure on a virtual machine.
    • Virtual Hard Disk (SCSI adapter) -- Specify one or more virtual SCSI adapters to a virtual machine. You can then attach a virtual hard disk to the SCSI adapter.
    • Network Adapters -- Configure one or more virtual network adapters to connect to virtual networks.
    • Virtual Machine Priority for Host CPU Resources -- Specify how CPU resources are allocated among virtual machines deployed on the same host.

    Note

    If you want to use these hardware settings in other virtual machines or templates, use the Save Profile button to save a hardware profile.

    To see the placement process for virtual machines, you will place the virtual machine on a host instead of storing it in the library.

  6. On the Select Destination page, select Place the virtual machine on a host.

  7. On the Select Virtual Machine Host page, select a host to deploy the virtual machine on.

    All hosts that are available for placement are given a rating of 0-5 stars based on their suitability to host the virtual machine. The host ratings are based on the virtual machine's hardware and resource requirements and anticipated resource usage. They are also based on placement settings that you can customize for VMM or for individual virtual machine deployments. The ratings are recommendations. You can select any host that has the required disk space.

    1. To see the placement settings that were used to rate the hosts, and optionally change those settings, click Customize Ratings to open the Customize Ratings dialog box.
      You can choose between two placement goals--either resource maximization on individual hosts or load balancing among hosts--and set the relative importance of the availability of CPU, memory, disk I/O capacity, and network capacity for the virtual machine. For more information, see "How Virtual Machine Manager Rates Hosts" (https://go.microsoft.com/fwlink/?LinkId=102852). If you change settings, the host ratings will be repeated to apply the new settings. When you finish reviewing settings, close the dialog box.
    2. To view additional information about a host rating, select the host in the list. The tabs in the details pane beneath the list provide the following information:
      Details --Displays the status of the host and lists the virtual machines that are currently deployed on it.
      Ratings Explanation--If a host receives a zero rating, this tab lists the conditions that caused the rating.
      SAN Explanation--If a SAN transfer cannot be used to move the virtual machine's configuration files to the host, this tab lists the conditions that prevent a SAN transfer.
  8. On the Select Path page:

    1. Select the path where you want to store the configuration files for the virtual machine on the host. A folder with the virtual machine name will be added to the path.

    2. If you plan to store other virtual machines on this path, select the Add this path to the list of host default paths check box to add the path to the default virtual machine paths on the selected host.

      Note

      The default paths are the only paths available during automatic placement of self-service virtual machines and drag-and-drop migration of virtual machines to a host group. For more information, see "About Virtual Machine Placement" (https://go.microsoft.com/fwlink/?LinkId=98982).

  9. On the Additional Properties page:

    • Optionally specify actions to be taken on the virtual machine when the Virtual Server service starts and stops on the host.
      Start action--You can choose to always turn on the virtual machine when Virtual Server starts, to turn the virtual machine on only if it was running when Virtual Server stopped, or to never turn on the virtual machine when Virtual Server starts. To enable a start action, you must specify the account that Virtual Server will run under. For account requirements, see " 'Run-as' Account Requirements for Virtual Server" (https://go.microsoft.com/fwlink/?LinkId=102862).
      Stop action--When Virtual Server stops, you can choose to save state for the virtual machine so that the virtual machine's current state can be restored quickly when the Virtual Server service starts again, shut down the virtual machine, or simply stop the virtual machine. Stopping the virtual machine has the same effect as unplugging a physical computer.
    • If the processors on your host support hardware-assisted virtualization, and you want to use that feature with the new virtual machine, select the Use Hardware Assisted Virtualization check box.
  10. On the Summary page, review the configuration settings. To change settings, click Previous.

    Note

    You can use the View Script button to display the Windows PowerShell - Virtual Machine Manager cmdlets that will perform the operation. All administrative tasks in Virtual Machine Manager can be performed at the command line or scripted. For more information, see "Getting Started with PowerShell Scripting for Virtual Machine Manager" (https://go.microsoft.com/fwlink/?LinkId=104252).

  11. To begin creating the virtual machine, click Create.

The Jobs window opens by default when the wizard closes. In the Jobs window, you can monitor the status of your jobs while you work in any view of the VMM Administrator Console. The Details tab displays the status of each step in the selected job. The Change Tracking tab displays an audit record of the changes made to VMM objects. To open the Jobs window at any time, click Jobs on the VMM toolbar.

When the wizard completes, the virtual machine will be added to Virtual Machines view of the VMM Administrator Console. However, before you can use the virtual machine, you must install an operating system. You also need to install Virtual Machine Additions to enhance the performance of the user interface.

Install an Operating System on the Virtual Machine

This section tells how to configure the virtual machine so that you can install an operating system from a system CD, from an ISO image file in the library, or through a network service boot. For the first two methods, you must configure a virtual DVD drive to attach to a physical CD drive on the host or to the image file. For a network installation, you must configure a virtual network adapter.

Operating System Requirements

The operating system on the virtual machine must meet the following requirements:

  • The operating system must be the Windows Server 2003 operating system or the Windows Server 2003 R2 operating system.

    Note

    For this tutorial, you cannot install the Microsoft Windows 2000 Server operating system on the virtual machine because you would not later be able to create a template from that virtual machine. Although VMM supports virtual machines running Windows 2000 Server, you cannot perform any operations that require the use of Sysprep. That includes cloning the virtual machine and creating a template from the virtual machine.

  • The boot partition must be the Windows partition.

Procedures

To install from a physical CD, you simply need to map a virtual CD/DVD drive on the virtual machine to the physical CD drive on the host computer.

To prepare to install from a system CD

  1. In Virtual Machines view of the VMM Administrator Console, right-click the virtual machine in the results pane, and click Properties.

  2. On the Hardware Configuration tab, click DVD on the New toolbar to add a virtual DVD drive to the IDE bus.

  3. In the right pane, click Physical CD/DVD drive, and then select the DVD drive on the host.

If you will use an image file to install the operating system, you must add the image file to the Virtual Machine Manager library.

To prepare to install from an image file in the library

  1. Copy the image file to a share in the Virtual Machine Manager library. The file will be added to the library and will be available in wizards after the next library refresh.

    If you have not yet added library servers and shares, you can use the default library share, $MSSCMMLibrary, on the VMM server. The default path is <systemdrive>\Documents and Settings\All Users\Documents\Virtual Machine Manager Library Files.

  2. To make the file available immediately, refresh the library share.

    1. In the VMM Administrator Console, click Library under the navigation pane to display Library view.
    2. In the navigation pane, right-click the share that you copied the image file to, and then click Refresh share.
  3. In the virtual machine properties, configure a virtual DVD drive to connect to the image file:

    1. In Virtual Machines view, right-click the virtual machine in the results pane, and click Properties.
    2. On the Hardware Configuration tab, click DVD on the New toolbar to add a virtual DVD drive to the IDE bus.
    3. In the right pane, Known image file, and then select the image file from the available library resources.

If the network adapter on the host computer supports network service boots, you can configure a virtual network adapter on the virtual machine to enable this.

To prepare to install from a network service boot

  1. In Virtual Machines view, right-click the virtual machine in the results pane, and click Properties.

  2. On the Hardware Configuration tab, configure a network connection:

    1. On the New toolbar, click Network Adapter to add a virtual network adapter to the IDE bus.

    2. In Connect to, select the external virtual network to use for the network service boot. The list contains all virtual networks that are configured on the host.
      If you just added a new host that did not have an existing Virtual Server installation, during Setup, Virtual Server will have configured an external virtual network for each physical network adapter on the host computer and named the network for the network adapter model.

      Note

      To support virtual machine migration, you should configure standard network descriptions on all hosts. For more information, see "How to Configure Virtual Networks on a Host" (https://go.microsoft.com/fwlink/?LinkId=98838).

    3. Under Ethernet (MAC) address, specify a dynamic or static IP address for the virtual machine.

With the virtual machine configured to provide access to the installation medium of choice, you can connect to the virtual machine to install the operating system. Virtual Machine Manager uses Virtual Machine Remote Control (VMRC) to connect to virtual machines from the VMM Administrator Console. By default, VMM uses port 5900 to connect to VMRC. No configuration is required unless a firewall is blocking the port.

To install the operating system on the virtual machine

  1. In Virtual Machines view, right-click the virtual machine in the results pane, and then click Connect to virtual machine. You will need to click Yes at the prompt to start the virtual machine.

    This opens the Virtual Machine Remote Control console.

  2. To connect to the virtual machine, on the Remote Control menu, click Special Keys, and then click Send Ctrl+Alt+Delete.

  3. Install the operating system on the virtual machine as you would on a physical computer. On a virtual machine, the boot disk partition must be the Windows partition.

  4. After completing the installation, end your session with the virtual machine and stop the virtual machine in VMM. (Use the Stop action in Virtual Machines view.)

    Note

    When you create a template from this virtual machine later in this tutorial, the virtual machine must have a blank local Administrator password.

Install Virtual Machine Additions on the Virtual Machine

Virtual Machine Additions is a collection of software drivers that maximize performance and provide a better user interface (UI) experience within virtual machines created by Virtual Server and Virtual PC. In VMM, Virtual Machine Additions is strongly recommended to improve the performance of virtual machines and is a requirement for virtual machine templates.

The image file for Virtual Machine Additions (VCMAdditions.iso) is downloaded to the host when Virtual Server is installed. To use the file in VMM, you must add it to the library, and then attach the file to a virtual DVD drive on the virtual machine.

To add Virtual Machine Additions to the VMM Library

  1. Copy the VMAdditions.iso file to a share in the Virtual Machine Manager library. The default location for the VMAdditions.iso is <C>:\Program Files\Microsoft Virtual Server\Virtual Machine Additions.

    If you have not yet added library servers and shares, you can use the default library share, $MSSCMMLibrary, on the VMM server. The default path to the share is <systemdrive>\Documents and Settings\All Users\Documents\Virtual Machine Manager Library Files

  2. If you do not see the VMAdditions ISO file in Library view or when you browse for a known image file, manually refresh the library. For more information about refreshing library shares, see "How to Refresh a Library Share" (https://go.microsoft.com/fwlink/?LinkId=98839).

To install Virtual Machine Additions on a virtual machine

  1. Display Virtual Machines view.

  2. If the virtual machine is running, stop the virtual machine so that you can update the virtual machine's hardware configuration. To do this, right-click the virtual machine, and then click Stop.

  3. To edit the virtual machine's properties, right-click the virtual machine, and then click Properties.

  4. In the Virtual Machine Properties dialog box, display the Hardware Configuration tab.

  5. If there is no DVD drive, add a DVD drive to the IDE device by clicking DVD on the New toolbar.

  6. Click Known image file, click Browse to open the Select ISO dialog box, click the VMAdditions.iso file, and then click OK. Click OK again to close the dialog box.

  7. Start the virtual machine. Virtual Machine Additions will be installed automatically from within the running virtual machine.

TASK 2   Create a Virtual Machine Template from a Virtual Machine

To create a template from a virtual machine, use the New template action in Library view. To be converted, the virtual machine must be deployed on a host.

Warning

Creating a template destroys the virtual machine that is used as the template's source. This is because Sysprep strips the virtual machine of its computer identity. If you want to continue to use the source virtual machine after creating the template, you must clone the virtual machine before you start. For instructions, see "How to Clone a Virtual Machine" (https://go.microsoft.com/fwlink/?LinkId=102844).

Requirements for the Source Virtual Machine

To be converted to a template, the virtual machine must meet the following requirements:

  • One of the following operating systems must be installed: Windows Server 2003 or Windows Server 2003 R2.

  • The boot disk partition must be the same as the Windows partition.

  • The Administrator password on the virtual hard disk should be blank as part of the Sysprep process. However, the Administrator password for the guest operating system profile does not have to be blank.

  • Virtual Machine Additions must be installed on the virtual hard disk that contains the operating system. For instructions, see "How to Install Virtual Machine Additions on a Virtual Machine in VMM" (https://go.microsoft.com/fwlink/?LinkId=103799).

  • The virtual machine must be deployed on a host. This is required because the wizard runs Sysprep.exe on the running virtual machine, and Virtual Server must be present to run the virtual machine.

    Note

    As a work-around for this requirement, you can install Virtual Server 2005 R2 on the library server on which the virtual machine is stored, and install the VHD Mount component of Virtual Server. The simplest way to prepare the library server is to add the library server as a host in VMM.

To create a template from a deployed virtual machine

  1. Display Library view of the VMM Administrator Console. To do this, click the Library button beneath the navigation pane.

  2. In the Actions pane, under Library Actions, click New template.

  3. On the Select Source page:

    1. Click From an existing virtual machine currently located on a host, and then use the Select button to select the virtual machine.
    2. In VHD containing OS, select the virtual hard disk that contains the system files.
  4. On the Template Identity page, enter a template name and description, and optionally specify the owner of the template. The template owner must have an AD DS domain account. All VMM administrators will be able to use the template.

    Note

    If you were to use the template in virtual machine self-service, you would need to specify an owner. Only the template owner -- whether an individual self-service user or a group assigned to the self-service policy -- would be able to create, see, and manage virtual machines created with the template.

  5. On the Configure Hardware page, configure at least one network adapter to enable you to add virtual machines created with this template to a domain later in this procedure.

    For other hardware, you can accept the defaults that the template inherited from the virtual machine.

    To configure virtual network adapter

    1. On the New toolbar, click Network Adapter to add a network adapter.

    2. In Connected to, select the virtual network that the virtual machines will use. The list contains all virtual networks that have been configured on the host.

      Note

      To support virtual machine migration, you need to configure standard networks on all hosts. If the host does not contain a virtual network that is configured for the virtual machine, migration fails. For more information, see "How to Configure Virtual Networks on a Host" (https://go.microsoft.com/fwlink/?LinkId=98838).

    3. Under Ethernet (MAC) address, specify a dynamic or static IP address for the virtual machine.

    To view procedures for configuring other hardware components, click one of the following links:

    Note

    If you want to use these hardware settings in other virtual machines or templates, use the Save Profile button to save a hardware profile.

  6. On the Guest Operating System page, configure identity information, administrator credentials, and user access to computers based on the template.

    Identity information: Enter the following settings:

    • Computer name -- Specify a computer name. To randomly generate a computer name for virtual machines based on the template, enter an asterisk in the Computer name field.
    • Full name, Organization name -- The Full name and Organization name fields provide required information for customization of the virtual machine during the Sysprep process. You can optionally provide the information through the template.
      Product key -- If you want the template to provide a product key for virtual machines, enter a product key in the Product key field. To require users to provide their own product key when they create a virtual machine, leave the field blank.

    Under Admin Password, specify the local Administrator password for the virtual machine. If virtual machines created with this template will not be in a domain, users must use this password to gain access to the local computer.

    Note

    To prompt for a password when the user creates a virtual machine with the template, enter an asterisk (*) in the Admin Password field. If you leave the field blank, virtual machine creation will fail.

    Networking: Configure settings to determine network access for virtual machines:

    • To add virtual machines that are created from this template to a domain, click Domain, and specify the domain name. Then specify a user account that will be used to add the computer to the domain at first logon. (The Domain option is available only if you configured at least one virtual network on the Configure Hardware page.)

      Important

      For increased security during the automation of mini-Setup, enter a user account with limited privileges. The account must be able to add the computer to a domain.

    • If the virtual machines that are created from this template will not be in a domain, click Workgroup, and then enter the workgroup name.

    Scripts: Use the options under Scripts to provide additional settings for Sysprep:

    • To add settings to those that the wizard will pass to SysPrep, in the Answer file field, specify the SysPrep.inf file to run. The settings in the .inf file will be appended to those that the wizard passes.
    • To automate mini-Setup, in the [GUIRunOnce] Commands field, enter the commands to run at first logon.
  7. On the Select Path wizard page, specify a library share and path on which to store all files associated with the template. All virtual hard disks and ISO images that are used with the template will be copied to the folder.

    Note

    The template itself is a database object, and it is not represented by a physical configuration file on a library share. To display templates in Library view, click the Library Servers node at the top of the navigation pane.

  8. On the Summary page, click Create.

TASK 3   Create a Virtual Machine from the Template

Now, create a virtual machine from the template that you just created. When you create a virtual machine from a template, the operating system is provided. You cannot change the system disk or startup disk configuration. However, you can add additional virtual hard disks.

Note

Because templates are database objects, and thus they are not associated with any physical file on a library share, you will not see templates displayed in Library view when a library server or share is selected. To display templates, click the Library Servers node at the top of the navigation pane.

To create a virtual machine from a template

  1. In Library view of the VMM Administrator Console, under Virtual Machine Manager Actions, click New virtual machine template.

  2. On the Select Source page, select the From an existing template, virtual machine, or virtual hard disk stored in the library option, and then use the Select button to select the template.

  3. Complete the wizard by following the instructions on the wizard pages.

    The new virtual machine will have the operating system and Virtual Machine Additions installed. On the Hardware Configuration page, you cannot change the system disk or the boot disk, but you can add additional virtual hard disks.

    In the Identity Information section of the Guest Operating System page, you must provide required fields for customization of the virtual machine. You can change any of the default values that you specified in the template.

Beyond the Basics

Procedures for Creating Virtual Machines

Creating a Virtual Machine with a Blank Virtual Hard Disk in VMM

Creating a Virtual Machine from an Existing Virtual Hard Disk in VMM

Creating a Virtual Machine from a Template in VMM

Cloning a Virtual Machine in VMM

Converting Physical Computers to Virtual Machines in VMM (P2V Conversions)

Converting VMware Virtual Machines in VMM (V2V Conversions)

How to Install Virtual Machine Additions on a Virtual Machine in VMM

How to Add and Configure Virtual Network Adapters for a Virtual Machine

Procedures for Creating Templates and Profiles

Creating Virtual Machine Templates in VMM

How to Create a Hardware Profile

How to Create a Guest Operating System Profile