Friday 21 June 2013

Step-by-step: Using the Microsoft iSCSI Software Target with Hyper-V (Standalone, Full, VHD)

Overview
In this post, I will show all the steps required to run Windows Server 2008 Hyper-V with the Microsoft iSCSI Software Target. We will cover the specific scenario of a standalone Windows Server 2008 server (as opposed to a clustered one) on a full install (as opposed to a core install) and using a VHD file (as opposed a pass-through disk).
In order to follow these instructions you will need at least two computers. One computer will run a full install of Windows Server 2008 with the Hyper-V role enabled. The other computer needs to be a Windows Storage Server (WSS) with the iSCSI pack or Windows Unified Data Storage Server (WUDSS). Optionally, you could add a Client for your Virtual Machine and a computer for remote Hyper-V Management.
Configuring the Networks
For your server running Hyper-V, you should consider having at least three Network Interface Cards (NICs). One will be dedicated to iSCSI traffic. The second will be connected to the Virtual Switch and used for traffic going to your virtual machine. The third NIC you will dedicate to remote management. This configuration is showed in the diagram below:
01 
Checking the Windows Storage Server
WSS (with the Microsoft iSCSI Software Target) comes preinstalled from the hardware vendor. This special OS release is not available the Microsoft sales channels like software retailers or volume licensing. You can find more information about WSS and WUDSS at http://www.microsoft.com/storageserver. Windows Storage Server 2008 is also available from MSDN or TechNet subscriber downloads for non-production use (see details at http://blogs.technet.com/josebda/archive/2009/05/13/windows-storage-server-2008-with-the-microsoft-iscsi-software-target-3-2-available-to-msdn-and-technet-plus-subscribers.aspx).
You should make sure you have the proper credentials (username and password) with administrator privileges on the Storage Server. You should also make sure you have remote access to the Storage Server via Remote Desktop. Once you log on to the Storage Server via Remote Desktop, verify that you can locate the Microsoft iSCSI Software Target Management Console (MMC), which can be found in the Administration Tools menu. From a Storage Server perspective, we’ll perform all the configuration actions using the iSCSI Target MMC.
02 
Checking the Server running Hyper-V
On the server running Windows Server 2008 Hyper-V, you should make sure to run Windows Update to get the latest updates. This will ensure that you have the final release of Hyper-V, not the beta version that was released with Windows Server 2008.
You will also need to enable the Hyper-V role. This is done using Server Manager by right-clicking the “Roles” node on the tree on the left and selecting “Add Roles”.
03
This will bring up the “Add Roles Wizard”, where you will find “Hyper-V” on the list of roles:
 04
While configuring the Hyper-V role on the wizard, you should see the three (or more) NICs on your server on the “Create Virtual Networks” step.
Make sure you do not select the NICs used for iSCSI traffic and Hyper-V remote management in the “Create Virtual Networks”.
05 
You will need to restart the server after you add the Hyper-V role.
Loading the iSCSI Initiator
The next step now is to configure the iSCSI initiator on the Hyper-V server.
You can find the “iSCSI Initiator” under “Administrative Tools” in Windows Server 2008. You can also find it in the “Control Panel”.
The first time you load the iSCSI initiator, it will ask you two questions.
The first question is about loading the Microsoft iSCSI Initiator service every time:
06
The second question is about configuring the firewall to allow the iSCSI traffic:
07
You should click on “Yes” for both questions.
After that, the iSCSI Initiator Properties windows will load, showing the “General” tab.
This tab gives you an important piece of information: your initiator name or IQN. We’ll need this later when configuring the target:
07
Configuring the target portal
The next step is configure the initiator with the address of your iSCSI target portal.
In our case, this is the computer running Windows Storage Server and the Microsoft iSCSI Software Target.
In the iSCSI Initiator Properties window, select the “Discovery” tab and add the IP address of the Storage Server to the list of Target Portals.
09
Click on “Add Portal…” to add the information. You will need the IP address of your Storage Server at this point. Port 3260 is the default.
10
Here’s the screen after the Target Portal is added:
11
Now, if you switch over the “Targets” tab of the iSCSI Initiator Properties windows, you will see this:
12
This blank list of targets is expected at this point, since we haven’t configured any targets yet.
We’ll do that next.
Creating the iSCSI Target
Now we switch over the Microsoft iSCSI Software Target side, on the Windows Storage Server.
We will create the target using the Microsoft iSCSI Software Target MMC we mentioned before.
13
After starting the wizard, skip the introduction page by clicking “Next”.
14
Next, you will provide the name and description for the target. We’ll be using simply “T1” for the name.
15
On the following screen, you need to provide the identification for the target.
Here you can use an IQN (iSCSI Qualified Name) or you can use the advanced setting to go with an IP address, DNS name or MAC address.
16
Since our initiator in this case already contacted the Storage Server, you can simply click on “Browse” and pick the IQN from there.
17
Once you get the right IQN, click “Next” to proceed.
18
Finally, click “Finish” to create the target.
19
Adding LUNs to the iSCSI Target
Now that the target is created, you need to add virtual disks or LUNs to it. These will be the logical units that will be presented to the initiator.
You will do this by right-clicking the target T1 and selecting the option to “Create Virtual Disks for iSCSI Target”.
20
You will start the wizard. Click “Next” on the introduction page.
21
Next, you will provide a path to the file to use as your virtual disk or LUN. This file will have a VHD extension.
22
Next, you will specify the size for the virtual disk or LUN. We’ll create a 20GB LUN here, which is enough to install Windows Server 2008 later on. The iSCSI target uses fixed-sized VHD files, but you can extend them if needed.
23
Next, you will specify a description for the virtual disk or LUN.
24
Finally, click “Finish” to create the virtual disk. Depending on the size, it could take a while.
25
At this point, you can see the target and its virtual disk on the Microsoft iSCSI Software Target MMC:
26
You can check the properties of the target, including the target IQN, by right-clicking the target name and clicking on “Properties”.
27
Now we go back to the initiator side.
Configuring the iSCSI Initiator targets
When we last checked the “Targets” tab of the iSCSI Initiator Properties windows, we had an empty list.
With the target properly configured, you should see the it showing after you click on “Refresh”:
28
Now you need to click on “Log on…” to connect to the target.
On the “Log On to Target” window, be sure to check the box to “Automatically restore this connection when the computer starts”.
29
Once you log on, the target status will change to “Connected”.
30
The LUN should also appear in the list of “Volumes and Devices” in the iSCSI Initiator Properties:
31
Now we need to work on that LUN to turn it into an NTFS volume with a drive letter.
That is done in Disk Management.
Preparing the Volume
If you followed all the steps so far, you should already have the LUN as an offline, uninitialized, unallocated volume in Server Manager, under Disk Management:
32
The first thing you need to do here is to online the volume, by right-clicking on the disk:
33
The volume will be onlined automatically if you are running the Standard Edition of Windows Server 2008. 
After that, the volume will be online, but still uninitialized. You will then select the option to “Initialize Disk”:
34
At this point you need to select a partition style (MBR or GPT). The older MBR style is commonly used for small partitions. GPT is required for partitions larger than 2TB.
35
After this, you have a basic disk online which you could use to create an NTFS volume. If you right click it again, there will be an option to create a “New Simple Volume”.
36
Once you go through that wizard, format the volume and assign it a drive letter, you will have the final result in Disk Management as drive E:
37
We’ll use this drive E: as our storage for Hyper-V.
Creating the Virtual Machine
Last but not least, we must now create our Virtual Machine. We’ll do this in the Hyper-V Manager:
38
There are two places in the New Virtual Machine Wizard where you will refer to the E: disk.
The first one is when you select the location of your virtual machine configuration files:
39
The second one is when you specify the location of the virtual hard drive used by that virtual machine:
40
In this case, by using the wizard, we selected the default option of using a Dynamically Expanding VHD file that is exposed to the child partition as Virtual IDE.
You can verify that looking at the settings for the resulting Virtual Machine:
41
If you click on the “Inspect” button, you can see it’s a Dynamic VHD:
42
You could, of course, use any of the other types of VHD files or even a pass-through disk, but that’s a topic for another blog post…
Conclusion
I hope this blog post has helped you understand all the steps required to use the Microsoft iSCSI Software Target to provision storage for your Windows Server 2008 server running Hyper-V.
This post covered a scenario where Hyper-V runs on a full install of Windows Server 2008, using a VHD file on the parent and without Failover Clustering.

How to Install and Manage Hyper-V Server 2008 R2 SP1

1- Installing Hyper-V Server 2008 R2 SP1

Overview 

Microsoft® Hyper-V™ Server 2008 R2 SP1 is the next generation of Microsoft Hyper-V Server 2008, which is a hypervisor-based product that was first released in September 2008. It's a dedicated stand-alone product that contains only the Windows® hypervisor, a Windows Server® driver model, and virtualization components.

Prerequisites for Installation

For install Hyper-V Server 2008 R2 SP1, you will need the following specific hardware requirements by the technology:
Processor:
• Minimum: An x64-based processor with hardware-assisted virtualization. This is available in processors that include a virtualization option—specifically, processors with Intel Virtualization Technology (Intel VT) or AMD Virtualization (AMD-V) technology.
• Hardware-enforced Data Execution Prevention (DEP) must be available and enabled. Specifically, you must enable the Intel XD (“execute disable”) bit or the AMD NX (“no execute”) bit.
Memory:
• Minimum: 1 GB RAM; recommended: 2+ GB RAM
• Maximum: 1 TB
Network adapters
• Minimum: 1
• Recommended: 2 or more
Additional considerations: 
       • The settings for hardware-assisted virtualization and hardware-enforced DEP are available in the BIOS. However, the names of the settings may differ from the names identified previously. 
For more information about whether a specific processor model supports Hyper-V, check with the manufacturer of the computer.
       • If you modify the settings for hardware-assisted virtualization or hardware-enforced DEP, you may need to turn off the power to the computer and then turn it back on. Restarting the computer may not apply the changes to the settings.

Installation

The installation of Microsoft Hyper-V Server 2008 R2 SP1 will be very familiar to those of you who have installed a Windows Server 2008 R2 SP1 edition because it uses a similar wizard-driven installation.
There are some sources for deploy Hyper-V Server 2008 R2 SP1: USB, Windows Deployment Services (WDS), downloading the ISO file (for free on Microsoft web site) and burning on DVD.
After you choose the source installation, Power-up the server and boot;


After the boot completes, you will select the language of you interest;
   
Select the installation language, time and currency format, and the keyboard and input language, and then click Next;
  
To begin the installation, click Install Now;


After your click Install now, the setup will start;
  

Review the license terms, select I accept the license terms if you agree to them, and then click Next;
Click the Custom installation button . The Upgrade option is disabled because Microsoft Hyper-V Server 2008 R2 SP1 does not support upgrading from another version of Windows;
Select a disk and partition to install, and then click Next; 


The installation process begins;   


After the installation process completes, a logon screen will display. When you log on for the first time, you will be required to change the local administrator password; 
  
After log on, a command line configuration tool automatically launches to allow you to modify the default system settings.
   

2- Configuring Hyper-V Server 2008 R2 SP1 for remote management

  • If it is not already running, start the Server Configuration tool by typing Sconfig.cmd in a command prompt and pressing ENTER;
  • If the account you have used to log on to the computer is already in the Domain Administrators group, skip to the next step. If the account you have used to log on to the computer is not in the Domain Administrators group, add the account to the Administrators group by typing 3 and pressing ENTER;
  • Type the domain name and user name and press ENTER.
For example, type: domain\domain user;
  • Click OK;
  • In the Server Configuration tool, configure remote management by typing 4 and pressing ENTER;
  • Select any of the following remote management methods. These options are not exclusive—you can enable any or all of them by repeating this step. For remote management, you should enable all of them;  
Allow MMC Remote Managementa.    Type 1 to enable MMC Remote Management.
b.    A message appears that says: “Enabling MMC firewall exceptions and Virtual Disk Service.”
c.    When the process is complete, the following message appears: "Remote Management allowed for all Windows Firewall profiles.” Click OK.
Enable Windows PowerShella.    Type 2 to enable Windows PowerShell.
b.    When the process is complete, the following message appears: “You must restart the computer to complete the Windows PowerShell installation. Restart now?” Click Yes.
Allow Server Manager Remote ManagementNote
You must enable Windows PowerShell and restart the computer before you can enable Server Manager Remote Management.
a.    Type 3 to allow the computer to be managed by using Remote Server Manager.
b.    When the process is complete, the following message appears: “Remote Server Management enabled.” Click OK.


Managing Hyper-V Server 2008 R2 Remotely

After configuring remote management, you can remotely manage Hyper-V Server through any of the following methods:
• Use Hyper-V Manager in a Full installation of Windows Server 2008 R2. 
• Use Hyper-V Manager in Windows 7 using Remote Server Administration Tools.
• Use Microsoft System Center Virtual Machine Manager 2008 R2.

• Use 5Nine Manager for Hyper-V  .
Choose the option that is right for you, and then follow the steps that correspond with your choice.
 Notes:
     • The Hyper-V Manager Microsoft Management Console (MMC) snap-in is automatically installed when the Hyper-V role is enabled on Full installations of Windows
Server 2008 R2.
     • The System running Hyper-V Manager Microsoft Management Console (MMC) snap-in Must be in the same domain as the Server running Microsoft Hyper-V. Cross domain permissions do not work within this MMC snap-in 
    • If you will be using a computer with a 32-bit operating system to remotely manage a computer running Hyper-V Server that has failover clustering enabled, you must enable 32-bit support for failover clustering on the computer running Hyper-V Server. You can do this with the following command:  dism /online /enable-feature /featurename: FailoverCluster-Core-WOW64

To manage from a Windows Server 2008 R2 computer

1. On the remote computer you will be managing Hyper-V Server from, enable the Hyper-V Manager MMC snap-in: On the Start menu, click Server Manager.
2. Right-click Features, and then click Add Features. 
3. Under Remote Server Administration Tools, click Role Administration Tools, click Hyper-V Tools, and then click Next.
4. Click Install.
5. After the computer restarts, click the Start menu, click Administrative Tools, and then click Hyper-V Manager.
6. On the left side of the MMC window, click Hyper-V Manager.
7. From the Actions menu, click Connect to Server, select Another Computer, and then enter the name or IP address of the server that you want to connect to.

To manage from Windows 7

1. On the remote computer you will be managing Hyper-V Server 2008 R2 from, download and install the Hyper-V Manager MMC snap-in from Remote Server Administration Tools (http://go.microsoft.com/fwlink/?LinkID=130862).
2. After the computer restarts, click the Start menu, click Administrative Tools, and then click Hyper-V Manager.
3. On the left side of the MMC window, click Hyper-V Manager.
4. From the Actions menu, click Connect to Server, select Another Computer, and then enter the name or IP address of the server that you want to connect to.