Microsoft Hyper-V Server is basically Windows Server Core 2008 with only the Hyper-V role. Hyper-V Server does not have a GUI for configuring or managing the system. In order to connect a Hyper-V Server to iSCSI storage the command line tool iscsicli.exe and a few other commands must be used. The directions below are step by step instructions to connect a Hyper-V Server to first an MD3000i iscsi array and then to an EqualLogic PS5000e array.
Hardware Configuration
The following step by step should work for most configurations, but some changes will be necessary to account for differences in IP address, number of NICs, number of LUNs, etc. The hardware specifically used for this example was a Dell PowerEdge R805, with two local disks configured in a RAID 1, Hyper-V Server installed on the local disks (actually it is the install used in this video). The NICs used are the four on-board NICs of the R805 and were connected as follows:
NIC 1 - Primary Data Network - 10.10.10.x
NIC 2 - VM Data Network - 192.168.50.x
NIC 3 - iSCSI Network - 10.10.30.x
NIC 4 - iSCSI Network - 10.10.30.x
The MD3000i and EqualLogic arrays are connected to the 10.10.30.x network
Step by Step Instructions
Set IP Address for NICs 3 and 4 that are connected to 10.10.30.0 iscsi subnet Using the Hyper-V Configuration text based tool
Select 3 - Network Settings
Then select NIC Index 4 and 5 (will have to do steps seperately for each NIC)
1 Set Network Adapter IP Address
S Static 10.10.30.231 and 10.10.30.230, mask 255.255.255.0, no gateway
Enable iSCSI Inititator
Enable the iSCSI Initiator to auto start:
sc \\r0hypervR805c config msiscsi start= autoSC is a command line program used for communicating with the Service Control Manager and services.
Usage: sc <server> [command] [service name] <option1> <option2>...
start iscsi initiator:
sc \\r0hypervR805c start msiscsiCheck status of iscsi initiator:
sc \\r0hypervR805c query msiscsiiscsicli Configuration
Add iscsi targets:
iscsicli Qaddtargetportal 10.10.30.25iscsicli Qaddtargetportal 10.10.30.27iscsicli Qaddtargetportal 10.10.30.28iscsicli Qaddtargetportal 10.10.30.29iscsicli QaddTargetPortal 10.10.30.40The first four are for the MD3000i, the last entry is for the EqualLogic
Get iSCSI Target IQN:
iscsicli ListTargetsMicrosoft iSCSI Initiator Version 6.0 Build 6000Targets List: iqn.1984-05.com.dell:powervault.600188b000474fb400000000458d86ecThe operation completed successfully.Only the MD3000i has a LUN created and assigned at this point.
Login to Target. This step only does the login, not the connection:
iscsicli qlogintarget iqn.1984-05.com.dell:powervault.600188b000474fb400000000458d86ecSimple single Connection to Target LUN. This step will connect to the target LUN:
iscsicli PersistentLoginTarget iqn.1984-05.com.dell:powervault.600188b000474fb400000000458d86ec T * * * * * * * * * * * * * * * 0List the target LUNs that have been connected:
iscsicli listpersistenttargetsMicrosoft iSCSI Initiator Version 6.0 Build 6000Total of 1 peristent targetsTarget Name : iqn.1984-05.com.dell:powervault.600188b000474fb400000000458d86ecAddress and Socket : 10.10.30.25 3260Session Type : DataInitiator Name : Root\ISCSIPRT\0000_0Port Number : <Any Port>++Security Flags : 0x0++Version : 0++Information Specified: 0x20++Login Flags : 0x8++Username :The operation completed successfully.iscsicli reporttargetmappingsMicrosoft iSCSI Initiator Version 6.0 Build 6000Total of 1 mappings returnedSession Id : fffffa801a5c3018-4000013700000006Target Name : iqn.1984-05.com.dell:powervault.600188b000474fb400000000458d86ecInitiator : Root\ISCSIPRT\0000_0Initiator Scsi Device : \\.\Scsi4:Initiator Bus : 0Initiator Target Id : 0Target Lun: 0x0 <--> OS Lun: 0x0Target Lun: 0x1f00 <--> OS Lun: 0x1fThe operation completed successfully.At this point the LUN is connected through iSCSI. The things done with iscsicli are equivalent to what would be done with the iSCSI Initiator GUI based management tool on a Windows Server 2008 system.
Using DISKPART to Create Partition, Mount, and Format
The following commands are run after running diskpart.exe, from the DISKPART> prompt.
DISKPART>RESCAN
DISKPART>LIST DISK
DISKPART>select disk 4 (You will need to use the number that corresponds to your disk)
DISKPART>create partition primary
DISKPART>select partition 1
DISKPART>assign letter=m
DISKPART>format fs=ntfs label="MDVMHosts2" quick
Adding EqualLogic iSCSI LUN
The steps are almost exactly the same, but this time there is less explanation and more direct output from the screeen:
A LUN was created on the EqualLogic storage and assigned to the host. In order for the target to appear the refreshtargetportal command was necessary at the beginning:
iscsicli refreshtargetportal 10.10.30.40 3260iscsicli listtargetsiscsicli qlogintarget iqn.2001-05.com.equallogic:0-8a0906-21de97202-61e510b651b48ed1-eqvmhosts20 Microsoft iSCSI Initiator Version 6.0 Build 6000Session Id is 0xfffffa801a5cd018-0x4000013700000008Connection Id is 0xfffffa801a5cd018-0x8The operation completed successfully. iscsicli persistentlogintarget iqn.2001-05.com.equallogic:0-8a0906-21de97202-61e510b651b48ed1-eqvmhosts20 T * * * * * * * * * * * * * * * 0 Microsoft iSCSI Initiator Version 6.0 Build 6000The operation completed successfully. iscsicli listpersistenttargets Microsoft iSCSI Initiator Version 6.0 Build 6000Total of 2 peristent targetsTarget Name : iqn.1984-05.com.dell:powervault.600188b000474fb400000000458d86ecAddress and Socket : 10.10.30.25 3260Session Type : DataInitiator Name : Root\ISCSIPRT\0000_0Port Number : <Any Port>++Security Flags : 0x0++Version : 0++Information Specified: 0x20++Login Flags : 0x8++Username :Target Name : iqn.2001-05.com.equallogic:0-8a0906-21de97202-61e510b651b48ed1-eqvmhosts20Address and Socket : 10.10.30.40 3260Session Type : DataInitiator Name : Root\ISCSIPRT\0000_0Port Number : <Any Port>++Security Flags : 0x0++Version : 0++Information Specified: 0x20++Login Flags : 0x8++Username :The operation completed successfully. diskpartMicrosoft DiskPart version 6.0.6001Copyright (C) 1999-2007 Microsoft Corporation.On computer: R0HYPERVR805CDISKPART> rescanPlease wait while DiskPart scans your configuration...DiskPart has finished scanning your configuration.DISKPART> list diskDisk ### Status Size Free Dyn Gpt-------- ---------- ------- ------- --- ---Disk 0 Online 67 GB 0 BDisk 1 No Media 0 B 0 BDisk 2 Online 545 GB 0 BDisk 3 Online 20 MB 20 MBDisk 4 Online 200 GB 200 GBDISKPART> select disk 4Disk 4 is now the selected disk.DISKPART> create partition primaryDiskPart succeeded in creating the specified partition.DISKPART> select partition 1Partition 1 is now the selected partition.DISKPART> assign letter=nDiskPart successfully assigned the drive letter or mount point.DISKPART> format fs=ntfs label="EQVMHosts20" quick100 percent completedDiskPart successfully formatted the volume.DISKPART>Links -
http://social.technet.microsoft.com/Forums/en-US/winservercore/thread/85ebf386-adeb-4721-a752-c0b936f2a692/