By Keith Mayer | Article Rating: |
|
March 14, 2013 02:00 PM EDT | Reads: |
876 |

Windows Server 2012 and our completely free Hyper-V Server 2012 certainly have some really cost-effective new storage options, with Storage Spaces and Hyper-V over SMB 3.0. However, many IT Pros have already invested in iSCSI shared storage and, as a result, many Hyper-V deployments also need to be able to leverage these existing storage investments.
iSCSI? No problem! Windows Server 2012 and Hyper-V Server 2012 include native support for a software iSCSI initiator as well as MPIO ( Multipath IO ) for resiliency and load balancing of storage IO over multiple network paths.
In this article, we’ll walk through the process of connecting Windows Server 2012 and Hyper-V Server 2012 to common iSCSI storage arrays. Because most of my IT Pro friends are running Hyper-V either on Windows Server 2012 Server Core or Hyper-V Server 2012, both options without a local console GUI, I’ll be providing my examples below in PowerShell.
NOTE: In this article, I make the assumption that your iSCSI storage array is already configured and that your Hyper-V host is already physically attached and zoned into your iSCSI storage network.
- Don’t have an iSCSI Storage Array? Did you know that Windows Server 2012 includes an iSCSI Target role that, along with Failover Clustering, allows it to become a cost-effective and highly-available iSCSI Storage Array? Walk through the process of getting this configured in the following Step-by-Step Guide:
DO IT: Step-by-Step: Build a Windows Server 2012 Storage Server
Let’s Get Things “Started” …
A software iSCSI initiator is installed by default on Windows Server 2012 and Hyper-V Server 2012 as the MSiSCSI service. However, the MSiSCSI service isn't set to automatically startup, so we can start the MSiSCSI service with the following PowerShell command lines:
Set-Service –Name MSiSCSI –StartupType Automatic
Start-Service MSiSCSI
After running the above cmdlets, you can check on the status of the MSiSCSI service with the following command line:
Get-Service –Name MSiSCSI
Now Let’s Get “Connected’ …
After starting the MSiSCSI service, we can connect from our Hyper-V host to the iSCSI target on the storage array with the following PowerShell command line:
New-IscsiTargetPortal –TargetPortalAddress <IP_Address or FQDN of storage array>
$target = Get-IscsiTarget
Connect-IscsiTarget –NodeAddress $target.NodeAddress
If you’re successfully connected to the target on your iSCSI storage array, you should see the connection status returned with the following cmdlet:
Get-IscsiConnection
Now, let’s make the session for this iSCSI connection persist across reboots with the following command:
Get-IscsiSession | Register-IscsiSession
You can check to make sure the IsPersistent value is True for this session with the following command line:
Get-IscsiSession
We’re ready to start using our new iSCSI disk!
After successfully persisting our connection to the iSCSI target session, we’re ready to begin using our new iSCSI disk. To verify that your Hyper-V host sees the new iSCSI disk, use the following command:
Get-Disk | Where-Object BusType –eq “iSCSI”
Note the disk Number in the first column and verify that the Partition Style column shows “Raw” ( ie. unused ) for this new disk. To initialize and format the new disk, use the following command line, being careful to specify the correct disk number from the command output above:
Initialize-Disk –Number <Disk_Number> –PartitionStyle GPT –PassThru | New-Partition –AssignDriveLetter –UseMaximumSize | Format-Volume
After this command completes, you can use the following command to confirm the drive letter assigned to the new partition on your iSCSI disk so that you can begin using this path for storing new virtual machines and virtual hard disks!
Get-Partition
Great! But … What about High Availability?
Good question! Highly available iSCSI connections are generally configured via MPIO ( Multipath IO ). MPIO support is also included in Windows Server 2012 and Hyper-V Server 2012, but this feature first needs to be installed with the following command line:
Install-WindowsFeature Multipath-IO
After MPIO is installed, configure it to automatically claim all iSCSI devices for MPIO with the following command lines:
Enable-MSDSMAutomaticClaim –BusType iSCSI
Set-MPIOSetting –NewDiskTimeout 60
After running these commands, restart your server for MPIO discovery to take effect. After restarting, you can also configure a Round Robin load-balancing policy for all newly claimed devices with the following command:
Set-MSDSMGlobalDefaultLoadBalancePolicy -Policy RR
NOTE: The above commands leverage the Microsoft MPIO DSM ( Device Specific Module ). Prior to attempting to implement MPIO between your hosts and storage array, be sure to check with your storage array vendor to confirm their compatibility with this DSM. In some cases, your storage vendor may require an alternate DSM and/or a different MPIO configuration. Many storage arrays that are SPC-3 compliant will work with the Microsoft DSM, but we recommend confirming compatibility with your storage vendor before proceeding.
Want More? Become a Virtualization Expert in 20 Days!
This month, my fellow Technical Evangelists and I are writing a new blog article series, titled Become a Virtualization Expert in 20 Days! Each day we’ll be releasing a new article that focuses on a different area of virtualization as it relates to compute, storage and/or networking. Be sure to catch the whole series at:
After you’re done reading the series, if you’d like to learn more and begin preparing for MCSA certification on Windows Server 2012, join our FREE Windows Server 2012 “Early Experts” online study group for IT Pros at:
Published March 14, 2013 Reads 876
Copyright © 2013 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
- Sanbolic's Clustered File Systems Available to Microsoft Customers While Deploying Virtualization Applications on Windows Server 2008 Hyper-V
- Diskeeper Helps Customers Get Virtual with Windows Server 2008 Hyper-V Virtualization
- CommVault Integrates Modern Data Management for Windows Server 2012, Hyper-V and Windows Azure Environments
More Stories By Keith Mayer
Keith Mayer is a Technical Evangelist at Microsoft focused on Windows Infrastructure, Data Center Virtualization, Systems Management and Private Cloud. Keith has over 17 years of experience as a technical leader of complex IT projects, in diverse roles, such as Network Engineer, IT Manager, Technical Instructor and Consultant. He has consulted and trained thousands of IT professionals worldwide on the design and implementation of enterprise technology solutions.
Keith is currently certified on several Microsoft technologies, including System Center, Hyper-V, Windows, Windows Server, SharePoint and Exchange. He also holds other industry certifications from IBM, Cisco, Citrix, HP, CheckPoint, CompTIA and Interwoven.
Keith is the author of the IT Pros ROCK! Blog on Microsoft TechNet, voted as one of the Top 50 "Must Read" IT Blogs.
Keith also manages the Windows Server 2012 "Early Experts" Challenge - a FREE online study group for IT Pros interested in studying and preparing for certification on Windows Server 2012. Join us and become the next "Early Expert"!
- Cloud People: A Who's Who of Cloud Computing
- Cloud Expo New York: How to Use Google Apps Script
- Do Software Patents Stifle Innovation?
- Oracle Appeals Java Decision
- Cook, Schmidt, Otellini Ordered into Court
- What's in Store for Technology in 2013
- Ubuntu Phone Coming to the Developing World
- Top Ten Apps to Start 2013 Off Right
- EC Threatens to Go on a FRAND Tear
- Apple to Launch a 128GB iPad
- Google Is Winning the Ecosystem War
- Samsung Uses Centrify for Safer Android Platform
- Cloud People: A Who's Who of Cloud Computing
- Cloud Expo New York: How to Use Google Apps Script
- Know Your Road Map for IT Maturity in the Age of Cloud Computing
- How Can Green Web Hosting Benefit Your Business?
- Do Software Patents Stifle Innovation?
- Step-by-Step: Build a SharePoint 2013 Lab in the Cloud on Windows Azure
- SecurityStock Watch.com “Media Sponsor” of Cloud Expo NY & Silicon Valley
- Oracle Appeals Java Decision
- Which Open Source Software License Should I Use?
- Cook, Schmidt, Otellini Ordered into Court
- What's in Store for Technology in 2013
- Ubuntu Phone Coming to the Developing World
- Where Are RIA Technologies Headed in 2008?
- Personal Branding Checklist
- AJAXWorld 2006 West Power Panel with Google's Adam Bosworth
- The Top 250 Players in the Cloud Computing Ecosystem
- Why Microsoft Loves Google's Android
- Google's OpenSocial: A Technical Overview and Critique
- Cloud People: A Who's Who of Cloud Computing
- Wal-Mart To Sell $399 Ubuntu Linux-based Laptop with Google Operating System
- Cloud Expo New York Call for Papers Now Open
- i-Technology Blog: Google Trends on Java, McNealy, AJAX, and SOA Give Pause For Thought
- i-Technology Blog: Is There Life Beyond Google?
- Android: Who Hates Google Over the Phone?