Вы находитесь на странице: 1из 31

Implementing Hyper-V

Lab Exercises



FINAL
Released: 6 August 2008
Disclaimer - Terms of Use
Microsoft Confidential - For Internal Use Only
2008 Microsoft Corporation. All rights reserved.
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the companies, organizations, products, domain
names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no
association with any real company, organization, product, domain name, e-mail address, logo,
person, place, or event is intended or should be inferred. Complying with all applicable copyright
laws is the responsibility of the user. Without limiting the rights under copyright, no part of this
document may be reproduced, stored in or introduced into a retrieval system, or transmitted in
any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for
any purpose, without the express written permission of Microsoft Corporation.
For more information, see Use of Microsoft Copyrighted Content at
http://www.microsoft.com/about/legal/permissions/
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
The Microsoft company name and Microsoft products mentioned herein may be either registered
trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
This document reflects current views and assumptions as of the date of development and is
subject to change. Actual and future results and trends may differ materially from any
forward-looking statements. Microsoft assumes no responsibility for errors or omissions in
the materials.
THIS DOCUMENT IS FOR INFORMATIONAL AND TRAINING PURPOSES ONLY AND IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.

Table of Contents
About This Lab ........................................................................................................................................ 1
Hyper-V Lab Exercises ............................................................................................................................ 2
The Lab Environment ............................................................................................................................. 3
Network Layout .............................................................................................................................................. 3
Computer Names and IP Addresses ............................................................................................................... 3
Accounts and Group Membership ................................................................................................................. 4
Domain Membership ..................................................................................................................................... 4
Lab: Implementing Hyper-V ................................................................................................................... 5
Exercise 1: Install Windows Server 2008 Hyper-V .............................................................................................. 6
Exercise 2: Configure Windows Server 2008 Hyper-V ........................................................................................ 8
Exercise 3: Creating and Managing Virtual Machines ...................................................................................... 11
Exercise 4: Install Operating System in a Virtual Machine ............................................................................... 12
Exercise 5: Install Integration Services ............................................................................................................. 14
Exercise 6: Configure iSCSI For a Pass-through Disk ......................................................................................... 15
Exercise 7: Install Windows Server 2008 on a Pass-through Disk .................................................................... 17
Exercise 8: Hyper-V Management Pack............................................................................................................ 19
Exercise 9: Exploring Hyper-V with PowerShell ................................................................................................ 21
Exercise 10: Hyper-V Snapshots ....................................................................................................................... 25
Exercise 11: Export and Import Virtual Machines ........................................................................................... 27


FINAL Lab Exercises - About This Lab

Microsoft Confidential - For Internal Use Only 1
About This Lab
This Lab Manual describes the environment required to perform practice exercises in this
course and lab sessions included in this manual.
Practice exercises are performed on physical and virtual machines on two computers per
participant. To complete the exercises, your computer hardware and software must be
configured as described in the Classroom Setup Guide that accompanies this course.
Critical:
Lab sessions that accompany this course may use a preconfigured virtual machine
environment. If you start or modify VMs in any way prior to use in lab exercises, exercise
tasks and steps will not work as intended. DO NOT start or modify any VM until
instructed to do so in the lab exercises.

What You Will Learn
After completing the lab sessions in this course you will be able to:
Install Windows Server 2008 Hyper-V.
Configure Windows Server 2008 Hyper-V.
Create and manage Hyper-V virtual machines.
Install operating systems as Hyper-V virtual machines.
Use Hyper-V Snapshots.
Configure and use iSCSI and Pass-through disks.
Install an operating system as a virtual machine using a pass-through disk.
Use the Hyper-V Management Pack.
Configure Hyper-V using Windows PowerShell.
Implementing Hyper-V FINAL
2 2008 Microsoft Corporation. All rights reserved.
Hyper-V Lab Exercises
This manual provides the steps to perform the following lab exercises:
Exercise 1: Install Windows Server 2008 Hyper-V
In this exercise, you will install Hyper-V on a server running a Full installation of
Windows Server 2008 and a server running a Server Core installation of Windows Server
2008.
Exercise 2: Configure Windows Server 2008 Hyper-V
In this exercise, you will perform various configuration tasks using the Hyper-V Manager
on Windows Server 2008.
Exercise 3: Creating and Managing Virtual Machines
In this exercise, you will use the Hyper-V Manager in Windows Server 2008 to create and
manage a virtual machine.
Exercise 4: Install Operating System in a Virtual Machine
In this exercise, you will install Windows Server 2008 64-bit edition in a virtual machine
and create a Windows Vista SP1 virtual machine using an existing virtual hard disk (.vhd).
Exercise 5: Install Integration Services
In this exercise, you will install the Hyper-V Integration Services in a Windows Vista SP1
virtual machine.
Exercise 6: iSCSI and Pass-through Disks
In this exercise, you will configure the CORE-01 server to connect to an iSCSI device on
ADMIN-01.
Exercise7: Install Windows Server 2008 on Pass-through Disk
In this exercise, you will create a new virtual machine and install Windows Server 2008
using a pass-through disk.
Exercise 8: Hyper-V Management Pack
In this exercise, you will use a pre-configured Windows Vista virtual machine to explore
the Hyper-V Management pack.
Exercise 9: Exploring Hyper-V with PowerShell
In this exercise, you will use Windows PowerShell to explore Windows Server 2008
Hyper-V and manipulate virtual machines.
Exercise 10: Hyper-V Snapshots
In this exercise, you will create a snapshot and then revert to that snapshot to undo a
change in a VM.
Exercise 11: Export and Import Virtual Machines
In this exercise, you will export a virtual machine from one Hyper-V server and import it
to another Hyper-V server.

FINAL Lab Exercises - The Lab Environment

Microsoft Confidential - For Internal Use Only 3
The Lab Environment
To complete this lab, you will need the hardware and software configuration described in
the Classroom Setup Guide that accompanies this course.
Network Layout
The following figure illustrates the lab network configuration for each student. The lab
network must be isolated from production networks.
Figure 1. Network Layout

Computer Names and IP Addresses
The following table provides the computer configuration for the classroom lab network.
Table 1. Lab Computer Names and IP Addresses
Computer Name IP Address Preferred DNS Server Role
ADMIN-01 192.168.0.1 192.168.0.1 Domain Controller
CORE-01 192.168.0.2 192.168.0.1 Member Server




Implementing Hyper-V FINAL
4 2008 Microsoft Corporation. All rights reserved.
Accounts and Group Membership
Important:
You must log on as an administrative user in order to perform all of the tasks in this lab.

The following user accounts and passwords must be configured on the physical computer
and in all virtual machines:
Administrative username and password
Username: Administrator Password: LS1setup!
Member of: Local Administrators and Domain Administrators


Domain Membership
Your physical computers should already be joined to a domain.
Lab exercises may require you to join the following virtual domain(s):
contoso.com




FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 5
Lab: Implementing Hyper-V
In the following exercises, you will install Microsoft Hyper-V, create, configure, and install
virtual machines that will run in Microsoft Hyper-V, and use a variety of management
tools to configure and manage Hyper-V servers both locally and remotely.
Estimated time to complete this lab: X hours
Before You Begin
Before starting this lab:
Verify the lab environment:
o 2 computers with Windows Server 2008 Enterprise 64-bit edition.
o 1 of the computers should be a Server Core installation.
o Both computers should be connected with a crossover network cable.
o Each computer should have a C:\Labfiles and a C:\Scripts folder that is
shared.
What You Will Learn
After completing this lab you will be able to create and manage virtual machines in
Hyper-V.
After completing all of the exercises you will be able to:
Install Windows Server 2008 Hyper-V Role
Configure Windows Server 2008 Hyper-V
Create and manage Hyper-V virtual machines
Create a virtual machine that uses a Pass-through disk.
Take snapshots of virtual machines
Manage Hyper-V using Windows PowerShell
Manage Hyper-V using the Hyper-V Management Pack
Implementing Hyper-V FINAL
6 2008 Microsoft Corporation. All rights reserved.
Exercise 1: Install Windows Server 2008 Hyper-V
In this exercise, you will install Hyper-V on a server running a Full installation of
Windows Server 2008 and a server running a Server Core installation of Windows Server
2008.
Scenario
The goal of this exercise is to install and configure Windows Server 2008 Hyper-V to
prepare your server for creation of virtual machines.
Tasks
1. Upgrade Hyper-V to RTM.
a. Start the ADMIN-01 and CORE-01 physical machines and logon as
contoso\administrator.
b. On the ADMIN-01 server, open the folder C:\Labfiles\Hyper-V
RTM\KB950050 and execute Windows6.0-KB950050-x64.msu.
c. Click OK when prompted to install KB950050.
d. Restart ADMIN-01 when prompted.
e. On the CORE-01 server, open the folder C:\Labfiles\Hyper-V
RTM\KB950050 and execute Windows6.0-KB950050-x64.msu from
the command prompt.
f. Click OK when prompted to install KB950050.
g. Restart CORE-01 when prompted.
2. Install Windows Hyper-V on ADMIN-01 and CORE-01.
a. Start the ADMIN-01 and CORE-01 physical machines and logon as
contoso\administrator.
b. Server Manager should start automatically on Admin-01. After Server
Manager has refreshed, right-click on Roles and select Add Roles.
c. Click Next and then under Select one or more roles to install on this
server, check Hyper-V and then click Next.
d. Click Next on the Introduction to Hyper-V screen, and again click Next
on the Create Virtual Networks screen.
e. Confirm the installation options and then click Install. Click Close in the
Installation Results screen and then Yes to restart the server when
prompted.
FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 7
f. On the CORE-01 physical machine, make sure that the command prompt
is open and execute start /w ocsetup Microsoft-Hyper-V to install
Hyper-V.
g. Click No on the Windows Package Manager dialog that is displayed to
restart the server when prompted.
h. At the command prompt on CORE-01, type bcdedit /set
hypervisorlaunchtype auto and then press Enter.
i. Restart the physical machine CORE-01 by executing the command
shutdown /r /t 0.
j. After restart, logon to both ADMIN-01 and CORE-01 as
contoso\administrator to complete the Hyper-V installation process.
Implementing Hyper-V FINAL
8 2008 Microsoft Corporation. All rights reserved.
Exercise 2: Configure Windows Server 2008 Hyper-V
In this exercise, you will perform various initial configuration tasks using the Hyper-V
Manager on Windows Server 2008.
Scenario
You have just installed Windows Server 2008 Hyper-V on a new host computer and you
are planning to begin creating virtual machines to migrate workloads. You will begin by
configuring management tools, creating virtual networks, and a virtual hard disk. You will
also configure global defaults for Windows Server 2008 Hyper-V.
Tasks
1. Open the Windows Hyper-V Manager Console and connect to remote Hyper-
V server.
a. Ensure you are logged on to your ADMIN-01 and your CORE-01
computers using the username Contoso\Administrator and the
password LS1setup!.
b. On the Start menu, point to Administrative Tools, and then click Hyper-
V Manager.
c. Leave the Hyper-V Manager console open for the remainder of this
exercise.
d. Connect to the local computer, ADMIN-01, and accept the End User
License Agreement.
e. Right-click on Microsoft Hyper-V Servers and then click Connect to
server. Select Another Computer and then enter CORE-01 in the text
box.
f. When Hyper-V Manager connects to Core-01, the End User License
Agreement should again be displayed. Accept the EULA and you should
have access to Core-01 in the Hyper-V Manager running on Admin-01.
2. Configure Virtualization Settings
a. In Hyper-V Manager, click ADMIN-01, and then in the Actions pane, click
Hyper-V Server Settings.
b. In the Hyper-V Settings dialog box, click Virtual Hard Disks.
c. In Specify the default folder to store virtual hard disk files, type
C:\LabFiles\VHD and then click Apply.
d. In the Hyper-V Settings dialog box, click Virtual Machines.
FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 9
e. In the Specify the default folder to store virtual machine
configuration files, type C:\LabFiles\VM and then click OK.
f. Repeat the previous steps under Task 2 and configure CORE-01 with the
same settings as ADMIN-01.
3. Create a Private Virtual Network Switch
a. In Hyper-V Manager, click ADMIN-01 and then in the Actions pane, click
Virtual Network Manager.
b. In the Virtual Network Manager dialog box, under Create virtual
network, click Private, and then click Add.
c. Name the new network Guest Only Networking, and under Connection
Type make sure Private virtual machine network is selected. Click OK.
d. Repeat the previous steps under Task 3 and configure CORE-01 with the
same settings as ADMIN-01.
4. Create an External Virtual Network Switch
IMPORTANT: Do not create an external network on the Core-01
server during this exercise.
a. In Hyper-V Manager, click ADMIN-01 and then in the Actions pane, click
Virtual Network Manager.
b. In the Virtual Network Manager dialog box, under Create virtual
network, click External, and then click Add.
c. Name the new network External, and under Connection Type make sure
External is selected. Select the network card installed in the host machine
and then click Apply.
d. Click Yes on the Apply Networking Changes warning dialog.
Important:
Once the external switch is created, if the host network card can no longer be connected
to the network. Restore network connectivity on ADMIN-01, run
C:\scripts\restorenet.cmd from a command prompt and then re-check all of the network
card bindings for the Local Area Connection by using the Network Control Panel. Do not
create an external network on CORE-01.

Due to differences in hardware, restorenet.cmd may not restore network connectivity.
You may need to edit the file and change the Local Area Connection 3 to Local Area
Connection # where # matches the interface on your machine. On most machines that
have one network card, Hyper-V will create Local Area Connection 3 and so
restorenet.cmd attempts to set the IP address of this interface.



Implementing Hyper-V FINAL
10 2008 Microsoft Corporation. All rights reserved.
5. Create a New Virtual Hard Disk
a. In Hyper-V Manager, click ADMIN-01, in the Actions pane, click New,
and then click Hard Disk.
b. Click Next on the New Virtual Hard Disk Wizard screen.
c. Select Dynamically expanding and then click Next.
d. Name the disk V_Server1_IDE01.vhd, make sure the Location specifies
C:\Labfiles\VHD, and then click Finish.
e. Repeat the previous steps under Task 5 and configure CORE-01 with the
same settings as ADMIN-01.
6. Expand the Virtual Hard Disk.
a. In Hyper-V Manager, click ADMIN-01, and then in the Actions pane, click
Edit Disk.
b. In the Edit Virtual Hard Disk Wizard, click Next.
c. On the Locate Virtual Hard Disk page, click Browse.
d. In the Open dialog box, click V_Server1_IDE01 and then click Open.
e. On the Locate Virtual Hard Disk page, click Next.
f. On the Choose Action page, click Expand, and then click Next.
g. On the Expand Virtual Hard Disk page, in New size, type 200, and then
click Next.
h. Click Finish to close the Edit Virtual Hard Disk Wizard.
FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 11
Exercise 3: Creating and Managing Virtual Machines
In this exercise, you will use the Hyper-V Manager in Windows Server 2008 to create and
manage a virtual machine.
Scenario
You will begin by using the New Virtual Machine Wizard to create a new virtual machine
on the Hyper-V Server that is running Server Core that uses the virtual network switch
and virtual hard disk you created in the previous exercise. You will then install the
Windows Server 2008 64-bit operating system as a virtual machine and interact with that
Virtual Machine.
Tasks
1. Create a New Virtual Machine
a. Ensure you are logged on to ADMIN-01 as Contoso\Administrator using
the password LS1setup!, and that you have Hyper-V Manager open.
b. In Hyper-V Manager, click CORE-01, in the Actions pane, click New, and
then click Virtual Machine.
c. Click Next on the first screen of the New Virtual Machine Wizard.
d. Name the new virtual machine V_Server1 and the click Next.
e. Enter 512MB in the Memory box and then click Next.
f. Select Guest Only Networking in the connection box and then click Next.
g. Click the radio button Attach a virtual hard disk later and then click Next.
h. Review the configuration and make sure Start the virtual machine after it
is created is unchecked and then click Finish.
2. Add a Hard Drive to the Virtual Machine
a. In Hyper-V Manager, click CORE-01, and then in Virtual Machines, click
V_Server1, and then in the Actions pane, click Settings.
b. In the Settings for V_Server1 dialog box, click IDE Controller 0.
c. In IDE Controller, click Disk Drive, and then click Add.
d. In Media, click Browse, type c:\LabFiles\VHD\V_Server1_IDE01.vhd,
and then click Open.
e. Click OK to close the V_Server1 Settings dialog box.

Implementing Hyper-V FINAL
12 2008 Microsoft Corporation. All rights reserved.
Exercise 4: Install Operating System in a Virtual
Machine
In this exercise, you will install an operating system in a virtual machine using a .ISO file
and you will also create a virtual machine using an existing virtual hard disk (.vhd).
Scenario
A .ISO image of the Windows Server 2008 DVD-ROM and a pre-installed Windows Vista
SP1 virtual machine have been provided to use for this exercise.
You will install Windows Server 2008 into a virtual machine and create a Windows Vista
SP1 virtual machine using an existing virtual hard disk.
Tasks
1. Add the ISO image to the virtual machine DVD drive.
a. In Hyper-V Manager, click CORE-01, and then in Virtual Machines, click
V_Server1, and then in the Actions pane, click Settings.
b. Click DVD Drive under IDE Controller 1 and then click Image file: under
Media.
c. Click the Browse button and browse to C:\Labfiles\iso\. Click on
ws08vl.iso and then click Open. Click OK on the Settings for V_Server1
dialog.
2. Start the Virtual Machine and Install Operating System
a. Click on the V_Server1 virtual machine and then under Actions for
V_Server1, click Start.
b. Once the V_Server1 is started, double-click on V_Server1 to open the
Virtual Machine Connection.
c. Accept the default settings and start the installation of Windows Server
2008. Select Enterprise Edition full installation when prompted and
install to the virtual disk that was created in Exercise 2.
Note:
It may take several minutes to complete the installation of the Windows Server 2008 virtual
machine. Continue with the lab while you are waiting for the installation to finish.

3. Create a Windows Vista SP1 Virtual Machine.
a. In Hyper-V Manager, click CORE-01, in the Actions pane, click New, and
then click Virtual Machine.
FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 13
b. A Windows Vista SP1 virtual machine has been pre-installed and the .vhd
file is included in the C:\Labfiles\VHD folder. Create a new virtual machine
named Windows Vista SP1 Enterprise and make sure under Configure
Networking that the Guest Only Network network is selected.
c. On the Connect Virtual Hard Disk page, select Use an existing virtual
hard disk and then click Browse. Select V_Client1.vhd and then click
Open. Click Finish to close the wizard.
d. Repeat steps a c on the Admin-01 server.

4. Explore configuration options for a virtual machine.
a. In Hyper-V Manager on CORE-01, click on the Windows Vista SP1 Enterprise
virtual machine and then in the Action pane, click Settings.
b. Review the settings and note which items can be changed when the virtual
machine is running and which items cannot. List the items that can be changed
below:
c. Answer:


d. Shut down the Windows Vista SP1 Enterprise virtual machine on CORE-01.
e. In Hyper-V Manager on CORE-01, click on the Windows Vista SP1 Enterprise
virtual machine and then in the Action pane, click Settings.
f. Add an additional processor to the Windows Vista SP1 Enterprise virtual
machine.
g. Question/discussion: How many processors can you add to this virtual
machine? Is this what you would expect based on the hardware you are
running Hyper-V manager on?
h. Answer:





Implementing Hyper-V FINAL
14 2008 Microsoft Corporation. All rights reserved.
Exercise 5: Install Integration Services
In this exercise, you will install the Hyper-V Integration Services in a Windows Vista SP1
virtual machine.
Scenario
Completing the tasks in this exercise will allow you to use the network adapter that is
installed with the Integration Services to connect to an external network as well as the
parent partition from the virtual machine.
Tasks
1. Start the Windows Vista SP1 Enterprise Virtual Machine and install the
Integration Services.
a. In Hyper-V Manager on ADMIN-01, click to select the ADMIN-01 Hyper-V
server in the navigation pane.
b. Click to select the Windows Vista SP1 Enterprise virtual machine in the
details pane.
c. Start and Connect to the Windows Vista SP1 Enterprise virtual machine
using the links in the Hyper-V Manager action pane. This will open the
Virtual Machine Connection client application for the virtual machine.
d. Logon to the Windows Vista SP1 Enterprise virtual machine using the local
administrator account and the password LS1setup!.
e. In the Virtual Machine Connection client application for the Windows Vista
SP1 Enterprise virtual machine, click the Action menu and then click the
Insert Integration Services Setup Disk item.
f. In the Autoplay window that appears after inserting the Integration
Services disk, click the Install Microsoft Hyper-V Integration
Components option.
Tip:
If the Autoplay window does not appear after inserting the Integration Services disk, use
Explorer to browse to the CD drive in the Windows Vista SP1 virtual machine. Either
double-click the CD drive to start the Integration Services installation or explore the CD
drive to the Support\x86 folder and click Setup.exe to start the installation.

g. Restart the Windows Vista SP1 Enterprise virtual machine if prompted
after installing the Integration Services.

FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 15
Exercise 6: Configure iSCSI For a Pass-through Disk
In this exercise, you will configure the CORE-01 server to connect to an iSCSI device on
ADMIN-01.
Scenario
The Server ADMIN-01 has a pre-configured iSCSI Target and Device that will simulate a
iSCSI device on the network. You will manage this iSCSI device and create a disk that you
can install a Hyper-V child partition to.
Tasks
1. Configure the firewall on ADMIN-01.
a. Logon to ADMIN-01 as contoso\admininstrator and start a command
prompt.
b. Run the following command to add the wintarget.exe exception to the
firewall on ADMIN-01:
Netsh firewall add allowedprogram
c:\windows\system32\wintarget.exe WinTarget ENABLE
2. Configure the iSCSI Initiator on CORE-01.
a. Logon to CORE-01 as contoso\administrator.
b. Use the command prompt to start the Microsoft iSCSI Initiator service and
configure it to start automatically. Use the sc (service control) command
line tool to configure the automatic startup by using the following
command:
sc config msiSCSI start= auto
c. Start the msiSCSI service by using the following command:
Net start msiscsi
d. Add the target portal on ADMIN-01 by typing the following command on
CORE-01:
iSCSIcli QAddTargetPortal 192.168.0.1
e. List the available iSCSI targets using the following command:
Iscsicli ListTargets
f. Use the targets that were listed in the previous command to login to the
target using the following command:
Iscsicli QloginTarget iqn.1991-05.com.microsoft:admin-01-core-
01-target
Implementing Hyper-V FINAL
16 2008 Microsoft Corporation. All rights reserved.
Note:
The commands you issue might be slightly different than the above. The key is to use the
ListTargets command to list the target and then cut and paste the name from the
command prompt into the QloginTarget and PersistentLoginTarget commands.

g. To make the target persist after reboot, execute the following command:
Important:
In the following command there are 15 asterisks and a space between all of them. If the
command is not entered exactly as shown it will fail.

iSCSIcli PersistentLoginTarget iqn.1991-05.com.microsoft:admin-
01-core-01-target T * * * * * * * * * * * * * * * 0
h. Verify that the target is connected and persisted using the following
commands:
Iscsicli ListPersistentTargets

Iscsicli ReportTargetMappings
3. Use Diskpart to prepare the storage.
a. On CORE-01, use the command prompt to start the diskpart utility by
using the following command:
Diskpart
b. List the disks and note the disk number using the following command:
List disk
c. Disk 2 should be displayed as 78GB and offline. Use the following
commands to online the disk, clear attributes, and then Offline the disk. The
following shows the commands, one per line, and you should press enter
after each command:
select disk 2

online disk

attrib disk clear readonly

offline disk
d. Type Exit to leave diskpart.

FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 17
Exercise 7: Install Windows Server 2008 on a Pass-
through Disk
In this exercise, you will create a new virtual machine and install Windows Server 2008
on a pass-through disk.
Scenario
After verifying connectivity to an iSCSI device and disk, you will use Hyper-V Manager to
create and configure a virtual machine that uses a pass-through disk as the virtual
machine hard disk.
Tasks
1. Create Virtual Machine on CORE-01.
a. Logon to ADMIN-01 as contoso\administrator and open Hyper-V Manager.
If CORE-01 is not already displayed, connect to CORE-01 using Hyper-V
Manager.
b. In Hyper-V Manager, click CORE-01, and then in action pane, click New
and then Virtual Machine.
c. Click Next on the Before you begin page.
d. In the Name: box, enter Windows Server 2008 Pass-through and then
click Next.
e. Leave memory settings at 512MB and then click Next.
f. Under Connection, change the selection to Guest Only Networking and
then click Next.
g. Select Attach a virtual hard disk later, click Next, and then click Finish.
2. Attach virtual machine to pass-through disk
a. Select Windows Server 2008 Pass-through virtual machine and then in
the Actions pane, click Settings.
b. Select IDE Controller 0, click Hard Drive, and then click Add.
c. Click the radio button Physical hard disk and select Disk 2 from the drop
down list.
d. Expand IDE Controller 1 and select DVD Drive.
e. In the Media section, select Image file and click the Browse button.
f. Browse to C:\Labfiles\ISO\ws08vl.iso, click Open, and then click OK.
Implementing Hyper-V FINAL
18 2008 Microsoft Corporation. All rights reserved.
3. Start the Virtual Machine and Install Operating System
a. After adding the hard drive to the virtual machine, click on the Windows
Server 2008 Pass-through virtual machine and then under Actions, click
Start.
b. Once the virtual machine is started, double-click on Windows Server 2008
Pass-through to open the Virtual Machine Connection.
c. Accept the default settings and start the installation of Windows Server
2008. Select Enterprise Edition full installation when prompted and
complete the installation.
d. After the installation is finished, shut down the Windows Server 2008 Pass-
through virtual machine.

FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 19
Exercise 8: Hyper-V Management Pack
In this exercise, you will use a pre-configured Windows Vista virtual machine to explore
the Hyper-V Management pack and examine the effect of a failure in the Hyper-V Virtual
Machine Management service.
Scenario
A Windows Vista SP1 32-bit virtual machine has been included in the C:\Labfiles folder of
your physical machine. This virtual machine was created during Exercise 4 and will be
used to connect back to the Hyper-V server using Hyper-V Manager.
IMPORTANT: For this exercise, make sure you start and use the Windows Vista SP1
Enterprise virtual machine on ADMIN-01, configure it to use an external network.

Tasks
1. Start and configure Windows Vista virtual machine
a. In Hyper-V Manager on ADMIN-01, double-click on the Windows Vista
SP1 Enterprise virtual machine and then click the Start button.
b. Logon to the virtual machine using the Administrator account and the
password LS1setup!.
c. Verify network connectivity and make sure the virtual machine has an
operating network and the IP address is set to 192.168.0.100 and DNS
server is set to 192.168.0.1.
d. Add the Vista machine to the contoso.com domain and reboot when
prompted.
e. After reboot, logon to the domain as contoso\administrator using the
password LS1setup!.
2. Install and use Hyper-V Management Pack
a. Connect to the share \\ADMIN-01\Labfiles and browse to the Hyper-V
RTM folder. Copy the folder KB952627 to the desktop of the Vista Machine.
b. Open the KB952627 folder on the desktop and double-click on
Windows6.0-KB952627-x86.msu to install the Hyper-V Management
pack.
c. After installation, click on the Start menu and search for Hyper-V. Select the
Hyper-V Manager in the search results at the top of the Start menu.
Implementing Hyper-V FINAL
20 2008 Microsoft Corporation. All rights reserved.
d. Once Hyper-V Manager is open, right-click on the Hyper-V Manager icon
and select Connect to server. Select Another computer and enter ADMIN-
01.
e. Repeat the above step and connect to CORE-01.
f. Verify that you can manage virtual machines on both ADMIN-01 and CORE-
01.
3. Examine effect of Hyper-V Virtual Machine Management service failure.
a. Open Hyper-V Manager on ADMIN-01 and make sure all of the virtual
machines that are installed are started and running.
b. On ADMIN-01, open Task Manager by pressing CTRL-ALT-DELETE. Note
the number of vmwp.exe processes and record the result here:
c. Open a Virtual Machine Connection to each virtual machine that is
running on ADMIN-01.
d. On ADMIN-01, open Server Manager, expand Configuration, and then
click on Services. In the middle pane, click on Hyper-V Virtual Machine
Management service and then click on the Stop button to stop the service.
e. Questions/Discussions: Are the virtual machines on ADMIN-01 still
running? What (if anything) happened to the vmwp.exe processes on
ADMIN-01 after the service was stopped? Hyper-V Manager on ADMIN-01
should now be displaying a message The Virtual Machine Management
Service is not available. What can you do to restore Hyper-V Manager
functionality?
f. Answers:

FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 21
Exercise 9: Exploring Hyper-V with PowerShell
In this exercise, you will use Windows PowerShell to explore Windows Server 2008
Hyper-V and manipulate virtual machines.
Before You Begin
Before starting this lab:
Complete Exercises 1-8
Configure | verify your lab environment:
o Physical machines ADMIN-01 and CORE-01 with Hyper-V installed
What You Will Learn
After completing this exercise, you will be able to explore and manipulate a Hyper-V
server and virtual machines using Windows PowerShell.
After completing the exercises you will be able to:
Enumerate available classes in the Hyper-V WMI namespace
Start, Create a virtual machine, take a memory dump of a virtual machine and
change settings in virtual machine using PowerShell and WMI.
Scenario
Windows Server 2008 Hyper-V is includes a full set of management and automation
interfaces which are based on Windows Management Instrumentation (WMI). This allows
administrators to create custom management tools and scripts using any platform that
supports WMI, such as Windows Script Host, PowerShell, or .NET.
Important:
The following scripts should be run using the 32-bit version of PowerShell. Do not close
PowerShell in between executing the commands in this lab or the environment will have
to be reconfigured. This can be accomplished by repeating the steps in 4a, Prepare
PowerShell to run scripts.

Tip:
Some of the following commands contain commands that must be enclosed in quotes, and
virtual machine names that must be enclosed in single quotes. Please take note of this to make
sure you enter the command correctly.

Tasks
1. Display available Windows Server 2008 Hyper-V WMI Objects.
a. Ensure you are logged on to Admin-01 as Contoso\Administrator using
the password LS1setup!.
Implementing Hyper-V FINAL
22 2008 Microsoft Corporation. All rights reserved.
b. If Server Manager is not already open on ADMIN-01, open it and then
expand Features. Right-click on Features and select Add Features.
c. Select Windows PowerShell from the Select Features screen and follow
the wizard to install Windows PowerShell.
d. On the Start menu, point to All Programs, click Windows PowerShell 1.0
and then click Windows PowerShell.
e. In Windows PowerShell, type the following command, and then press
ENTER.
Get-WMIObject namespace root\Virtualization computername
core-01 list
f. The results of this command should be a list of the WMI objects from the
root\virtualization namespace.
2. Explore Virtualization System Management Service
a. In Windows PowerShell, type the following commands, pressing ENTER
after each command. This series of commands will first store an instance of
the Virtual System Management Service in an object. It will then display the
current values of the object, and finally enumerate the available properties
and methods.
$VM = Get-WMIObject query Select * from MSVM_ComputerSystem
where ElementName = V_Server1 namespace root\Virtualization
computername core-01

$VM

$VM | get-member
b. When displaying the properties of the new $VM object, you should see the
results of the query. The command was successful if _PATH displays
\\CORE-01, ElementName = V_Server1, and PrimaryOwnerName =
contoso\administrator.
3. Explore Virtual Networks
a. In Windows PowerShell, type the following commands, pressing ENTER
after each command. This series of commands will first display details on all
configured virtual network switches. It will then display the properties and
methods available for working with virtual network switches.
Get-WMIObject MSVM_VirtualSwitch namespace root\Virtualization
computername core-01

Get-WMIObject MSVM_VirtualSwitch namespace root\Virtualization
computername core-01 | Get-Member
FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 23
b. The first command was successful if the query returns both virtual
networks on CORE-01, one named Guest Only Networking and one named
External. You can see the names of the networks by looking at the
ElementName.
4. Start a Virtual Machine
a. Prepare PowerShell to execute scripts by running the following
commands:
Set-executionpolicy unrestricted

$env:path = $env:path + ;c:\labfiles\scripts
b. Change directory to c:\labfiles\scripts.
c. Shutdown the Windows Server 2008 Pass-through virtual machine if it
is not already shut down.
d. Execute the following command to start the Windows Server 2008 Pass-
through virtual machine:
change-state.ps1 -virtualhost core-01 -virtualguest "Windows
Server 2008 Pass-through" -state enable
e. Use Hyper-V Manager to verify that the Windows Server 2008 Pass-
through virtual machine on CORE-01 is now running. When the virtual
machine has finished booting, proceed to the next step.
f. Open the script in notepad and examine the other arguments that can be
passed to the script to change the state.
g. Execute the following command to turn the Windows Server 2008 Pass-
through virtual machine off:
change-state.ps1 -virtualhost core-01 -virtualguest "Windows
Server 2008 Pass-through" -state disable
5. Change the boot order of a virtual machine.
a. Execute the following command to change the boot order of the Windows
Server 2008 Pass-through virtual machine:
change-vmbootorder.ps1 -virtualhost core-01 -virtualguest
"Windows Server 2008 Pass-through" -bootorder 0,1,2,3
b. Using Hyper-V Manager, verify that the startup order of the Windows
Server 2008 Pass-through virtual machine is Floppy, CD, IDE, and then
Legacy Network Adapter.
c. Execute the following command to change the boot order of the Windows
Server 2008 Pass-through virtual machine:
change-vmbootorder.ps1 -virtualhost core-01 -virtualguest
"Windows Server 2008 Pass-through" -bootorder 3,2,1,0
Implementing Hyper-V FINAL
24 2008 Microsoft Corporation. All rights reserved.
d. Using Hyper-V Manager, verify that the startup order of the Windows
Server 2008 Pass-through virtual machine is Legacy Network Adapter,
IDE, CD, and then Floppy.
6. Create a virtual machine
a. Change to the C:\Labfiles\Scripts folder in PowerShell and execute the
following command to create a new virtual machine on CORE-01:
create-vm core-01 NewScriptedVM
b. Verify that a new virtual machine named NewScriptedVM was created on
CORE-01.
7. Create a memory dump of a virtual machine.
a. If it is not already started, start the Windows Vista SP1 Enterprise virtual
machine on CORE-01.
b. Execute the following command to manually force a memory dump of the
virtual machine:
Dumpvm s core-01 v Windows Vista SP1 Enterprise
c. If the Vista SP1 virtual machine does not blue screen with a Stop
0x000000e2 exception, add a DWORD registry value named
CrashOnCtrlScroll to the Vista SP1 machine and set it to 0x1. Add the value
to HKLM\System\CurrentControlSet\Services\i8042prt\parameters.
Reboot the Vista SP1 virtual machine and then try the script again.

FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 25
Exercise 10: Hyper-V Snapshots
In this exercise, you will create snapshots and then apply snapshots to revert to a
previous configuration (i.e. to undo changes to the virtual machine).
Scenario
A snapshot is a point-in-time picture of a virtual machines running state. Snapshots can
be used to create checkpoints that allow you to quickly roll back a configuration change,
or revert a VM to a previous state. Capturing snapshots is an important part of Hyper-V
management and administration.
Tasks
1. Create a Virtual Machine Snapshot
a. Make sure the V_Server1 virtual machine is running on CORE-01. Click on
V-Server1 in Hyper-V Manager, and then on the Action menu, click
Snapshot.
b. Click on the Snapshot that you just created above and then click Rename in
Action menu. Rename the snapshot to First Snapshot No folder.
c. Logon to the virtual machine V_Server1 running on CORE-01 using the
administrator account and password. Create a new folder named New
Folder 1on the desktop of the V_Server1 virtual machine.
d. Use Hyper-v Manager to take another snapshot of the V_Server1 virtual
machine. Rename the snapshot to Second Snapshot Folder 1.
e. Repeat steps c and d two more times and create a third and fourth
snapshot and a New Folder 2 and New Folder 3 on the desktop. Make sure
to take a new snapshot after each folder is created.
2. Restore the VM from a snapshot
a. In Hyper-V Manager, under Snapshots, click Second Snapshot Folder 1,
and then in the Actions pane, click Apply.
b. In the Apply Snapshot dialog box, click Apply.
Note:
The green arrow that indicates the active snapshot should move from Fourth Snapshot to the
Second Snapshot.

c. Switch to V_Server1 on CORE-01 and logon to this virtual machine.
d. Verify that there is only one folder on the desktop of the virtual machine
named New Folder 1.
Implementing Hyper-V FINAL
26 2008 Microsoft Corporation. All rights reserved.
e. In Hyper-V Manager, click V_Server1, and then under Snapshots right-click
on First Snapshot No folder, and then click Delete Snapshot Subtree.
f. Click Delete in the Delete Snapshot Tree dialog to confirm the deletion.
g. Question/discussion: How many New Folders are on the desktop of the
V_Server1 virtual machine after deleting the snapshot tree? Is this
something you would expect?
h. Answer:


i. Close the V_Server1 on CORE-01 Virtual Machine Connection window.
j. In Hyper-V Manager, click V_Server1 and then in the Actions pane, click
Shut Down.
k. If a message is displayed about forcing the shutdown, click Force to force
the shutdown.

FINAL Lab Exercises - Lab: Implementing Hyper-V

Microsoft Confidential - For Internal Use Only 27
Exercise 11: Export and Import Virtual Machines
In this exercise, you will export a Windows Vista SP1 virtual machine from the ADMIN-01
server to a folder on the CORE-01 server. You will then import the exported virtual
machine on the CORE-01 server.
Scenario
The Export/Import feature allows you to export a complete virtual machine, including all
of its settings, to a folder and then import the virtual machine, and all of its settings, to
another Hyper-V server.
1. Export a Windows Vista SP1 Virtual Machine
e. Ensure you are logged on to ADMIN-01 as Contoso\Administrator using
the password LS1setup!, and that you have Hyper-V Manager open.
f. In Hyper-V Manager on ADMIN-01, click on Windows Vista SP1
Enterprise and then in the Actions pane, click on Export.
g. In Export path, enter \\CORE-01\Labfiles\VM and then click Export.
h. Verify that the Export process is proceeding by looking at the Operations
column to the right of the Windows Vista SP1 Enterprise virtual machine.
2. Import a Windows Vista SP1 Virtual Machine
a. When the Export is finished, click on CORE-01 in Hyper-V Manager and
then in the Actions pane, click on Import Virtual Machine.
b. In Import path, enter C:\Labfiles\VM\Windows Vista SP1 and then click
Import. The virtual machine should import immediately and be displayed
under Virtual Machines on CORE-01.
c. Start the Windows Vista SP1 virtual machine on CORE-01 and logon as
contoso\administrator.
d. Question/discussion: After logging on to the Windows Vista SP1
Enterprise virtual machine, you will notice that the virtual machine does
not have network connectivity to the host. What is the most likely cause of
this problem?
e. Answer:

Вам также может понравиться