hyper v iscsi setup

Upload: ion-cristian

Post on 03-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Hyper v iSCSI Setup

    1/2

    Step-by-Step: Speaking iSCSI with Windows Server 2012 and Hyper-V - Become a

    Virtualization Expert in 20 Days! ( Part 7 of 20 )

    Windows Server 2012and our completely FREEHyper-V Server 2012certainly have some really cost effective newstorage options, withStorage SpacesandHyper-V over SMB 3.0. However, many IT Pros have already invested iniSCSI 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 iSCSIinitiator as well as MPIO ( Multipath IO ) for resiliency and load balancing of storage IO over multiple networkpaths.

    In this article, well walk through the process of connecting Windows Server 2012 and Hyper-V Server 2012 tocommon iSCSI storage arrays. Because most of my IT Pro friends are running Hyper-V either on Windows Server2012 Server Core or Hyper-V Server 2012, both options without a local console GUI, Ill 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.

    Dont have an iSCSI Storage Array? Did you know that Windows Server 2012 includes an iSCSI Targetrole that, along with Failover Clustering, allows it to become a cost-effective and highly-available iSCSIStorage 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

    Lets Get Things Started

    A software iSCSI initiator is installed by default on Windows Server 2012 and Hyper-V Server 2012 as theMSiSCSIservice. 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 commandline:

    Get-Service Name MSiSCSI

    Now Lets Get Connected

    After starting the MSiSCSI service, we can connect from our Hyper-V host to the iSCSI target on the storage arraywith the following PowerShell command line:

    New-IscsiTargetPortal TargetPortalAddress

    $target = Get-IscsiTarget

    Connect-IscsiTarget NodeAddress $target.NodeAddress

    If youre successfully connected to the target on your iSCSI storage array, you should see the connection statusreturned with the following cmdlet:

    Get-IscsiConnection

    http://aka.ms/eedlhttp://aka.ms/eedlhttp://aka.ms/hv2012gshttp://aka.ms/hv2012gshttp://aka.ms/hv2012gshttp://blogs.technet.com/b/keithmayer/archive/2012/10/06/optimize-it-budgets-with-storage-spaces-in-windows-server-2012-31-days-of-favorite-features-part-6-of-31.aspxhttp://blogs.technet.com/b/keithmayer/archive/2012/10/06/optimize-it-budgets-with-storage-spaces-in-windows-server-2012-31-days-of-favorite-features-part-6-of-31.aspxhttp://blogs.technet.com/b/keithmayer/archive/2012/10/06/optimize-it-budgets-with-storage-spaces-in-windows-server-2012-31-days-of-favorite-features-part-6-of-31.aspxhttp://blogs.technet.com/b/keithmayer/archive/2012/12/12/step-by-step-building-a-free-hyper-v-server-2012-cluster-part-1-of-2.aspxhttp://blogs.technet.com/b/keithmayer/archive/2012/12/12/step-by-step-building-a-free-hyper-v-server-2012-cluster-part-1-of-2.aspxhttp://blogs.technet.com/b/keithmayer/archive/2012/12/12/step-by-step-building-a-free-hyper-v-server-2012-cluster-part-1-of-2.aspxhttp://blogs.technet.com/b/keithmayer/archive/2013/01/24/step-by-step-building-a-windows-server-2012-storage-server-in-the-cloud-with-windows-azure.aspxhttp://blogs.technet.com/b/keithmayer/archive/2013/01/24/step-by-step-building-a-windows-server-2012-storage-server-in-the-cloud-with-windows-azure.aspxhttp://blogs.technet.com/b/keithmayer/archive/2013/01/24/step-by-step-building-a-windows-server-2012-storage-server-in-the-cloud-with-windows-azure.aspxhttp://blogs.technet.com/b/keithmayer/archive/2013/01/24/step-by-step-building-a-windows-server-2012-storage-server-in-the-cloud-with-windows-azure.aspxhttp://blogs.technet.com/b/keithmayer/archive/2012/12/12/step-by-step-building-a-free-hyper-v-server-2012-cluster-part-1-of-2.aspxhttp://blogs.technet.com/b/keithmayer/archive/2012/10/06/optimize-it-budgets-with-storage-spaces-in-windows-server-2012-31-days-of-favorite-features-part-6-of-31.aspxhttp://aka.ms/hv2012gshttp://aka.ms/eedl
  • 7/28/2019 Hyper v iSCSI Setup

    2/2

    Now, lets make the session for this iSCSI connection persist across reboots with the following command:

    Get-IscsiSession | Register-IscsiSession

    You can check to make sure theIsPersistentvalue is True for this session with the following command line:

    Get-IscsiSession

    Were ready to start using our new iSCSI disk!

    After successfully persisting our connection to the iSCSI target session, were ready to begin using our new iSCSIdisk. 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 diskNumberin the first column and verify that thePartition Style column shows Raw ( ie. unused ) for thisnew disk. To initialize and format the new disk, use the following command line, being careful to specify the correctdisk number from the command output above:

    Initialize-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 newpartition on your iSCSI disk so that you can begin using this path for storing new virtual machines and virtual harddisks!

    Get-Partition

    Great! But What about High Availability?

    Good question! Highly available iSCSI connections are generally configured via MPIO ( Multipath IO ). MPIOsupport is also included in Windows Server 2012 and Hyper-V Server 2012, but this feature first needs to be installedwith 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 commandlines:

    Enable-MSDSMAutomaticClaimBusType iSCSI

    Set-MPIOSetting NewDiskTimeout 60

    After running these commands, restart your server for MPIO discovery to take effect. After restarting, you can alsoconfigure 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 confirmtheir compatibility with this DSM. In some cases, your storage vendor may require an alternate DSM and/or adifferent 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! READ IT:Become a Virtualization Expert in 20 Days!

    http://itproguru.com/expert/2013/03/become-a-virtualization-expert-with-20-days-of-server-virtualization-virtexpert-itproguru-part-0-of-20/http://itproguru.com/expert/2013/03/become-a-virtualization-expert-with-20-days-of-server-virtualization-virtexpert-itproguru-part-0-of-20/http://itproguru.com/expert/2013/03/become-a-virtualization-expert-with-20-days-of-server-virtualization-virtexpert-itproguru-part-0-of-20/http://itproguru.com/expert/2013/03/become-a-virtualization-expert-with-20-days-of-server-virtualization-virtexpert-itproguru-part-0-of-20/