Configuring Hyper-V over Highly Available SMB Storage
In this lab, you will learn how to
configure a file server cluster to support running Hyper-V virtual machines
from SMB file shares. You will create the file share, configure delegation, and
then create a new VM on SMB storage.
Objectives
After completing this
lab, you will be able to:
- Configure a failover cluster with a
highly available SMB share.
- Configure a Hyper-V server to leverage
SMB storage.
- Configure a file share to be used by
Hyper-V.
IMPORTANT:
This lab is designed to be run in a hosted environment, and leverages virtualized
Hyper-V servers. You will therefore be unable to start any virtual machines you
create. This is by design, as the lab is written to focus on the configuration
required only.
Prerequisites
Before working on this
lab, you must have:
1.
An understanding of concepts such as virtual machines, virtual hard disks, and
virtual networks
2.
An understanding of concepts related to clustering.
Overview of the lab
In this lab, you will
learn how to configure a file server cluster to support running Hyper-V virtual
machines from SMB file shares. You will create the file share, configure
delegation, and then create a new virtual machine on SMB storage.
Intended audience
This lab is targeted at
administrators who wish to replace traditional DAS or SAN-based storage with
virtual machines with highly-available SMB-based storage.
Virtual machine
technology
This lab is completed
using virtual machines that run on Windows Server Hyper-V ™ technology. To log
on to the virtual machines, press CTRL+ALT+END and enter your logon
credentials.
Computers in this lab
This lab uses computers
as described in the following table. Before you begin the lab, you must ensure
that the virtual machines are started and then log on to the computers.
All user accounts in this lab use the password Passw0rd!
Note regarding
pre-release software
Portions
of this lab include software that is not yet released, and as such may still
contain active or known issues. While every effort has been made to ensure this
lab functions as written, unknown or unanticipated results may be encountered
as a result of using pre-release software.
Note regarding
user account control
Some
steps in this lab may be subject to user account control. User account control
is a technology which provides additional security to computers by requesting
that users confirm actions that require administrative rights. Tasks that
generate a user account control confirmation are denoted using a shield icon.
If you encounter a shield icon, confirm your action by selecting the
appropriate button in the dialog box that is presented.
Exercise 1: Creating a File Server Cluster
In
this exercise, you will create a new file cluster which is suitable for running
virtual machines. You will create the Application File Server Cluster, and then
create the shared folder in a manner suitable for storing Hyper-V virtual
machines.
Adding
File Services to the cluster nodes
In
this step, you will add the File Services role to the nodes of an existing,
unconfigured cluster.
Switch to the DC computer.
1. Log on to DC as Contoso\Administrator.
2. Click Server Manager.
3. Click All Servers.
4. Right-click NODE1, and then click Add
Roles and Features.
5. Click Next three times.
6. In Roles, expand File and Storage Services, check File
Services, and then click Next.
7. Continue clicking Next, and
then click Install.
8. Click Close.
9. Repeat this process to add File Services to NODE2.
10. Use the status area to verify the installation completed
successfully.
11. Installation is completed when the progress bar is completed.
Figure 1: Completed installation
Creating
the cluster
In
this step, you will configure a file server cluster role suitable for hosting
highly available SMB file shares.
Perform this task logged on to DC as Contoso\Administrator with
the password Passw0rd!
1. Open Server Manager.
2. On the Tools menu, click Failover Cluster Manager.
3. Click Cluster.contoso.com, and then click Configure
Role.
4. Click Next, and then click File Server.
5. Click Next.
6. Select File Server for scale-out application data, and
then click Next.
7. In Name, type ClusterFS.
8. Click Next, and then on the Confirmation page, click Next again.
9. On the Summary page, click Finish.
10. In Failover Cluster Manager, expand Cluster.contoso.com, and
then click Storage.
11. Right-click Cluster Disk 2, and
then click Add to Cluster Shared Volumes.
NOTE: The CSV technology has been extended to include other
cluster roles such as file servers.
Creating
the shared folder
In
this step, you will create a shared folder for Hyper-V. This shared folder will
be configured for continuous availability and will have permissions configured
so that the Hyper-V computer account has access to the share.
Perform this task logged on to DC as Contoso\Administrator with
the password Passw0rd!
1. In Failover Cluster Manager, click Roles, and
then click ClusterFS.
2. Click Add Shared Folder.
NOTE: It may take a few minutes for the cluster name to become
available.
NOTE: If you receive a message indicating that the Network Name
is not yet available, it may be necessary to run the command IPConfig /FLUSHDNS
on your computer.
3. In Select Profile, click SMB Share – Server Application, and
then click Next.
4. In Share Location, click C:\ClusterStorage\Volume1, and
then click Next.
5. In Share name, type VMStore, and
then click Next.
NOTE: The share type has a default setting of Enable continuous
availability. This ensures the file share can fail over to an alternate node
without interrupting the client, even if active file operations are ongoing.
6. Click Next.
7. Click Customize Permissions.
8. Click Add, then click Select a principal.
9. Click Object Types, select Computers, and
then click OK.
10. Type HV1, and then click OK.
11. In Permissions, click Full Control.
NOTE: The computer account for any Hyper-V server must have the
ability to write to ACLs on the file share, so full control is required.
12. Click OK.
13. Click the Share tab.
14. Click Allow Everyone, and then
verify the access is Full Control.
15. Click OK.
16. Click Next.
17. Click Create, and then click Close.
Verifying
the shared folder
In
this step, you will verify the shared folder you created is available.
Perform this task logged on to DC as Contoso\Administrator with
the password Passw0rd!
1. Click Windows PowerShell.
2. Type the following command, and then press ENTER. The command
will return TRUE if the path is available.
↪ Test-Path
\\clusterfs\vmstore
3. Verify the Shared Folder VMStore is available in Windows
Explorer.
Exercise 2: Configuring Delegation
In
this exercise, you will enable the delegation required to ensure the Hyper-V
server can access file shares when running SMB-based virtual machines. Hyper-V
computers must have their computer accounts enabled for delegation. Optionally,
constrained delegation can be used to limit the configuration to only the CIFS
service.
Enabling
delegation for HV1
In
this step, you will enable delegation. Delegation is required on the computer
account of each Hyper-V server which will leverage the highly available SMB
share.
Perform this task logged on to DC as Contoso\Administrator with
the password Passw0rd!
1. Open Server Manager.
2. On the Tools menu, click Active Directory Users and
Computers.
3. Navigate to Computers.
4. Click HV1, and then on the Action menu, click Properties.
5. On the Delegation tab, click Trust this computer for
delegation to any service (Kerberos only).
NOTE: You can implement constrained delegation for increased
security by limiting delegation to the CIFS service.
6. Click OK.
7. Click Windows PowerShell.
8. Type Restart-Computer HV1 –Force, and then press ENTER.
Ensure you wait for HV1 to fully restart before proceeding. You can
switch to the console of HV1 to verify it has restarted. This can take 5-6
minutes to complete.
Exercise 3: Creating an SMB-based Virtual Machine
In
this exercise, you will use the Hyper-V UI to create a new virtual machine
which leverages the shared file server cluster for its VHD and configuration
storage. Note that this configuration does not make the virtual machine highly
available. Host clustering of Hyper-V is required to do this. This
configuration allows the virtual machine to leverage a highly-available file
server instead of costly SAN storage as its primary storage location.
Creating
an SMB-based virtual machine
In
this step, you will use Hyper-V Manager to create a new SMB-based virtual
machine. You will use RDP to access the HV1 computer from DC.
It is critical to understand that this training lab uses a
virtualized Hyper-V server for educational purposes. As such, the VM you create
will not be able to start. This is by design, and not a limitation of Hyper-V
or the training environment.
Perform this task logged on to DC as Contoso\Administrator with
the password Passw0rd!
1. In Server Manager, click All Servers.
2. Right-click HV1, and then click Remote
Desktop Connection.
3. In the Remote Desktop Connection box, type HV1, and
then click Connect.
4. Log on as Contoso\Administrator with a
password of Passw0rd!
5. In the HV1 remote session, on the desktop, open Hyper-V
Manager.
6. Click New, and then click Virtual Machine.
7. Click Next.
8. In Name, type SMB-VM-1.
9. Check Store the virtual machine in a different location, and
then in Location, type \\clusterfs\vmstore.
10. Click Next.
11. In Startup Memory, type 8, check Use
Dynamic Memory for this virtual machine, and then click Next.
12. Click Next.
13. On Connect Virtual Hard Disk, click Next.
NOTE: The VHD Is being stored on the SMB share.
14. Click Finish.
WARNING: You cannot start this virtual machine. This is expected.
HV1 is a virtualized Hyper-V server and starting virtual machines inside of an
existing virtual machine is not possible. This task is for the purpose of
learning or demonstrating the administrative process to enable this scenario.
15. Log off HV1 and close the RDP session.
Exercise 4: Validating Failover of Clustered SMB-Based Virtual
Machines
In
this exercise, you will examine the process of transferring the cluster file
share containing virtual machines to another node. This process is identical if
the virtual machines are powered off or running. If this process is completed
when virtual machines are running, the virtual machines do not experience
downtime or service interruption.
Transferring
storage between nodes
In
this step, you will transfer file server storage between cluster nodes.
Perform this task logged on to DC as Contoso\Administrator with
the password Passw0rd!
1. Click Start, and then click Failover Cluster Manager.
2. Click Roles, and then click ClusterFS.
3. In the Action pane, click Move, and
then click Select Node.
4. Note the selected node, and then click OK.
IMPORTANT: If your virtual machine was running, storage would have
been transferred without the virtual machine being interrupted.
Exercise 5: Challenge
Using
the steps in this lab, attempt to complete the following challenge to test your
skills on this topic.
Scenario
You
must configure a new highly-available file server cluster and configure Hyper-V
virtual machines to use this cluster. Your company has provided you with two
file servers which already have shared storage implemented as a SAN. You have
one Hyper-V server. Your company requires that Hyper-V configuration files and
VHD files be stored on different LUNs for better storage management.
Environment
To
complete this challenge, use the following servers:
Desired
end state
A
new virtual machine named Test-VM exists on HV2. The virtual machine has the
configuration stored on a shared folder named VMConfig, which is managed by
NODE1. The virtual machine has VHDs stored on a shared folder named VMVHD,
which is managed by NODE2.