Dienstag, 2. August 2011

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

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:
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 athttp://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.
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”.
This will bring up the “Add Roles Wizard”, where you will find “Hyper-V” on the list of roles:
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”.
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:
The second question is about configuring the firewall to allow the iSCSI traffic:
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:
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.
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.
Here’s the screen after the Target Portal is added:
Now, if you switch over the “Targets” tab of the iSCSI Initiator Properties windows, you will see this:
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.
After starting the wizard, skip the introduction page by clicking “Next”.
Next, you will provide the name and description for the target. We’ll be using simply “T1” for the name.
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.
Since our initiator in this case already contacted the Storage Server, you can simply click on “Browse” and pick the IQN from there.
Once you get the right IQN, click “Next” to proceed.
Finally, click “Finish” to create the target.
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”.
You will start the wizard. Click “Next” on the introduction page.
Next, you will provide a path to the file to use as your virtual disk or LUN. This file will have a VHD extension.
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.
Next, you will specify a description for the virtual disk or LUN.
Finally, click “Finish” to create the virtual disk. Depending on the size, it could take a while.
At this point, you can see the target and its virtual disk on the Microsoft iSCSI Software Target MMC:
You can check the properties of the target, including the target IQN, by right-clicking the target name and clicking on “Properties”.
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”:
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”.
Once you log on, the target status will change to “Connected”.
The LUN should also appear in the list of “Volumes and Devices” in the iSCSI Initiator Properties:
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:
The first thing you need to do here is to online the volume, by right-clicking on the disk:
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”:
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.
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”.
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:
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:
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:
The second one is when you specify the location of the virtual hard drive used by that virtual machine:
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:
If you click on the “Inspect” button, you can see it’s a Dynamic VHD:
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…
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.

Keine Kommentare:

Kommentar veröffentlichen

Dieses Blog durchsuchen