Quantcast
Channel: Jose Barreto's Blog
Viewing all 155 articles
Browse latest View live

PowerShell cmdlets for the Microsoft iSCSI Target 3.3 (included in Windows Storage Server 2008 R2)

$
0
0

1. Overview

One of the new features in the Microsoft iSCSI Software Target 3.3 (included in Windows Storage Server 2008 R2) is the inclusion of PowerShell cmdlets for management.

In this blog post, we will examine the details of the cmdlets available to manage targets and their associated virtual disks.

2. Modules, Cmdlets and Classes

The iSCSI Target PowerShell is provided in a single module called MicrosoftIscsiTarget, which includes 10 cmdlets, as listed in the example below:

PS C:\> Import-Module MicrosoftIscsiTarget
PS C:\> Get-Command -module MicrosoftIscsiTarget  | Sort Noun

CommandType  Name                             Definition
-----------  ----                             ----------
Cmdlet       Remove-IscsiServerTarget         Remove-IscsiServerTarget [-TargetName] <String> ...
Cmdlet       New-IscsiServerTarget            New-IscsiServerTarget [-TargetName] <String> [-I...
Cmdlet       Set-IscsiServerTarget            Set-IscsiServerTarget [-TargetName] <String> [-T...
Cmdlet       Get-IscsiServerTarget            Get-IscsiServerTarget [[-TargetName] <String>] [...
Cmdlet       Remove-IscsiVirtualDisk          Remove-IscsiVirtualDisk [-DevicePath] <WindowsPa...
Cmdlet       New-IscsiVirtualDisk             New-IscsiVirtualDisk [-DevicePath] <WindowsPath>...
Cmdlet       Get-IscsiVirtualDisk             Get-IscsiVirtualDisk [[-DevicePath] <WindowsPath...
Cmdlet       Set-IscsiVirtualDisk             Set-IscsiVirtualDisk [-DevicePath] <WindowsPath>...
Cmdlet       Add-VirtualDiskTargetMapping     Add-VirtualDiskTargetMapping [-TargetName] <Stri...
Cmdlet       Remove-VirtualDiskTargetMapping  Remove-VirtualDiskTargetMapping [-TargetName] <S...

As you can see, these cmdlets relate to three different nouns: IscsiServerTarget (Target), IscsiVirtualDisk (Virtual Disks) and VirtualDiskTargetMapping (LUN Mapping).

Next, we will examine these three main classes (or types) used to manage a Microsoft iSCSI Software Target, looking at their specific cmdlets and properties.

2.1. IscsiServerTarget

TypeName:

  • Microsoft.Iscsi.Target.Commands.IscsiServerTarget

Associated Cmdlets:

  • New-IscsiServerTarget (Creates a new iSCSI target object with the specified name)
  • Get-IscsiServerTarget (Obtains the iSCSI targets and their associated properties)
  • Set-IscsiServerTarget (Modifies settings for the iSCSi target)
  • Remove-IscsiServerTarget (Deletes an iSCSI target object)

Properties:

  • Id (Microsoft.Iscsi.Target.Commands.IscsiServerTargetIdentity)
  • TargetName (System.String)
  • TargetIqn (Microsoft.Iscsi.Target.Commands.Iqn)
  • ComputerName (System.String)
  • ServerInfo (Microsoft.Iscsi.Server.ServerInfo)
  • Description (System.String)
  • InitiatorIds (Collection of Microsoft.Iscsi.Target.Command.InitiatorId)
  • LunMappings (Collection of Microsoft.Iscsi.Target.Command.LunMapping)
  • Enable (System.Boolean)
  • Status (Microsoft.Iscsi.Target.Commands.IscsiServerTargetStatus)
  • LastLogin (System.DateTime)
  • EnableChap (System.Boolean)
  • EnableReverseChap (System.Boolean)
  • EnforceIdleTimeoutDetection (System.Boolean)
  • FirstBurstLength (System.Int32)
  • MaxBurstLength (System.Int32)
  • MaxReceiveDataSegmentLength (System.Int32)
  • ReceiveBufferCount (System.Int32)
  • Version (System.Version)

2.2. IscsiVirtualDisk

TypeName

  • Microsoft.Iscsi.Target.Commands.IscsiVirtualDisk

Associated Cmdlets

  • New-IscsiVirtualDisk (Creates an iSCSI virtual disk with the specified file path and size, or imports the VHD file if it already exists)
  • Get-IscsiVirtualDisk (Obtains the iSCSI virtual disks and their associated properties)
  • Set-IscsiVirtualDisk (Modifies the settings for the specified iSCSI virtual disk)
  • Remove-IscsiVirtualDisk (Deletes the specified iSCSI virtual disk)

Properties

  • Id (Microsoft.Iscsi.Target.Commands.IscsiVirtualDiskIdentity)
  • DevicePath (Microsoft.Iscsi.Server.WindowsPath)
  • VirtualDiskIndex (System.Int32)
  • Size  (Microsoft.Iscsi.Server.StorageSize)
  • SnapshotStorageSize (Microsoft.Iscsi.Server.StorageSize)
  • ComputerName (System.String)
  • ServerInfo (Microsoft.Iscsi.Server.ServerInfo)
  • Description (System.String)
  • Enabled (System.Boolean)
  • Status (Microsoft.Iscsi.Target.Commands.IscsiVirtualDiskStatus)
  • LastLocalMountTime (System.DateTime)
  • Flags (Microsoft.Iscsi.Target.Commands.IscsiVirtualDiskFlags)
  • SerialNumber (System.String)
  • LocalMountDeviceId (System.String)
  • LocalMountPaths (Collection of System.String)
  • LocalMountStatus (Microsoft.Iscsi.Target.Commands.LocalMountStatus)
  • Version (System.Version)

2.3. VirtualDiskTargetMapping or LunMapping

Typename

  • Microsoft.Iscsi.Target.Command.LunMapping

Associated Cmdlets

  • Add-VirtualDiskTargetMapping (Assigns a virtual disk to an iSCSI target)
  • Remove-VirtualDiskTargetMapping (Removes the assignment between the specified iSCSI virtual disk and iSCSI target)

Note: To obtains a list of Lun mappings, use the cmdlet: “(Get-IscsiServerTarget <name>).LunMappings”

Properties

  • TargetName (System.String)
  • VirtualDiskIndex (System.Int32)
  • LUN (System.Int32)

3. Class Diagram

Here’s a simplified class diagram showing the related classes, their properties and methods.

image

Note 1: The Initiator is implemented as the InitiatorIds collection, which is a property of iSCSIServerTarget
Note 2: The LUN Mapping is implemented as the LunMappings collection, which is a property of iSCSIServerTarget

4. Cmdlet Details

Here is a list of the 10 cmdlets in the MicrosoftIscsiTarget module, with a description, syntax and examples.

Note: The optional –ComputerName parameter, available for all cmdlets, is used to execute the task on a remote computer running the Microsoft iSCSI Target. In order to use the cmdlets remotely you need to use another computer running Windows Storage Server 2008 R2 or Windows Server 2008 R2 with the Microsoft iSCSI Target installed. You also need to be running with an account that has local administrator rights for the computer you are managing.

4.1. New-IscsiServerTarget

DESCRIPTION:
Creates a new iSCSI target object with the specified name.  Afterwards, the iSCSI target can be assigned to an iSCSI initiator, and then a virtual disk can be associated with the target.

SYNTAX:
New-IscsiServerTarget [-TargetName] <string> [-ComputerName <string>] [-InitiatorId <InitiatorId[]>]

EXAMPLES:
New-IscsiServerTarget -TargetName "TargetOne"
New-IscsiServerTarget -TargetName "TargetOne" -InitiatorId IPAddress:10.10.1.1,IPAddress:10.10.1.2 -ComputerName vcoName1
New-IscsiServerTarget -TargetName "targetone" -ComputerName iSCSIsvr

4.2. Get-IscsiServerTarget

DESCRIPTION:
Obtains the iSCSI targets and their associated properties from the local server or specified computer.

SYNTAX:
Get-IscsiServerTarget [[-TargetName] <string>] [-ComputerName <string>]

EXAMPLES:
Get-IscsiServerTarget
Get-IscsiServerTarget -ComputerName vcoName1
Get-IscsiServerTarget -TargetName "TargetOne"

4.3. Set-IscsiServerTarget

DESCRIPTION:
Modifies settings for the iSCSi target and returns the corresponding iSCSI target object if the PassThru parameter is specified.

SYNTAX:
Set-IscsiServerTarget [-TargetName] <string> [-Chap <PSCredential>] [-ComputerName <string>] [-Description <string>] [-Enable <Boolean>] [-EnableChap <Boolean>] [-EnableReverseChap <Boolean>] [-EnforceIdleTimeoutDetection <Boolean>] [-FirstBurstLength <int>] [-Force] [-InitiatorId <InitiatorId[]>] [-InputObject <IscsiServerTarget>] [-MaxBurstLength <int>] [-MaxReceiveDataSegmentLength <int>] [-PassThru] [-ReceiveBufferCount <int>] [-ReverseChap <PSCredential>] [-TargetIqn <Iqn>]

EXAMPLES:
Set-IscsiServerTarget "TargetOne" -Description "new description"
Set-IscsiServerTarget "TargetOne" -EnableChap 1 -Chap chapUserName

4.4. Remove-IscsiServerTarget

DESCRIPTION:
Deletes an iSCSI target object. An iSCSI initiator cannot access the VHD or LUN after the target is deleted.

SYNTAX:
Remove-IscsiServerTarget [-TargetName] <string> [-ComputerName <string>] [-Force] [-InputObject <IscsiServerTarget>]

EXAMPLES:
Remove-IscsiServerTarget “Target One”
Get-IscsiServerTarget “Target One” | Remove-IscsiServerTarget

4.5. New-IscsiVirtualDisk

DESCRIPTION:
Creates a new iSCSI virtual hard disk (VHD) object with the specified file path and size.  Afterwards, the virtual disk can be assigned to an iSCSI target. Once a virtual disk has been assigned to a target, an iSCSI initiator can access the virtual disk after the initiator connects to the target.

SYNTAX:
New-IscsiVirtualDisk [-DevicePath] <WindowsPath> [-Size] <StorageSize> [-ComputerName <string>]

EXAMPLES:
New-IscsiVirtualDisk "E:\temp\test.vhd" -Size 10GB
New-IscsiVirtualDisk "E:\temp\test.vhd"
New-IscsiVirtualDisk "E:\temp\test.vhd" -Size 10GB -ComputerName iscsisvr

4.6. Get-IscsiVirtualDisk

DESCRIPTION:
Obtains the iSCSI virtual disks and their associated properties.

SYNTAX:
Get-IscsiVirtualDisk [[-DevicePath] <WindowsPath>] [-ComputerName <string>]

EXAMPLES:
Get-IscsiVirtualDisk
Get-IscsiVirtualDisk "E:\temp\test.vhd"
Get-IscsiVirtualDisk "E:\temp\test.vhd" -ComputerName vcoName1

4.7. Set-IscsiVirtualDisk

DESCRIPTION:
Modifies the settings for the virtual disk and returns the corresponding iSCSI virtual disk object if the PassThru parameter is specified.

SYNTAX:
Set-IscsiVirtualDisk [-DevicePath] <WindowsPath> [-ComputerName <string>] [-Description <string>] [-Enable <Boolean>] [-Force] [-InputObject <IscsiVirtualDisk>] [-PassThru] [-SnapshotStorageSize <StorageSize>]

EXAMPLE:
Set-IscsiVirtualDisk "e:\temp\vhd1.vhd" -Description "disk for data"

4.8. Remove-IscsiVirtualDisk

DESCRIPTION:
Deletes the iSCSI virtual disk object. The VHD file is not deleted.

SYNTAX:
Remove-IscsiVirtualDisk [-DevicePath] <WindowsPath> [-ComputerName <string>] [-Force] [-InputObject <IscsiVirtualDisk>]

EXAMPLE:
Remove-IscsiVirtualDisk "e:\temp\vhd1.vhd"

4.9. Add-VirtualDiskTargetMapping

DESCRIPTION:
Assigns a virtual disk to an iSCSI target. Once a virtual disk has been assigned to a target, an iSCSI initiator can access the virtual disk after the initiator connects to the target. All the virtual disks assigned to the same iSCSI target will be accessible by the connected iSCSI initiator.

SYNTAX:
Add-VirtualDiskTargetMapping [-TargetName] <string> [-DevicePath] <WindowsPath> [-ComputerName <string>] [-Lun <int>]

EXAMPLE:
Add-VirtualDiskTargetMapping -TargetName "TargetOne" -DevicePath "e:\temp\vhd1.vhd"

4.10. Remove-VirtualDiskTargetMapping

DESCRIPTION:
Removes the assignment between a virtual disk and iSCSI target. The virtual disk will be no longer accessible by an iSCSI initiator once the assignment is removed.

SYNTAX:
Remove-VirtualDiskTargetMapping [-TargetName] <string> [-DevicePath] <WindowsPath> [-ComputerName <string>] [-Force]

EXAMPLE:
Remove-VirtualDiskTargetMapping "TargetOne" "e:\temp\vhd1.vhd"

5. Examples with output

5.1. Listing existing targets in a server (only one target listed):

PS C:\> Get-IscsiServerTarget

Id                          : Server0.contoso.local:FileCluster
TargetName                  : FileCluster
TargetIqn                   : iqn.1991-05.com.microsoft:server0-filecluster-target
Description                 : Storage for File Server Cluster
Enable                      : True
Status                      : Connected
LastLogin                   : 9/16/2010 2:38:51 PM
EnableChap                  : False
EnableReverseChap           : False
ComputerName                : Server0.contoso.local
MaxReceiveDataSegmentLength : 65536
FirstBurstLength            : 65536
MaxBurstLength              : 262144
ReceiveBufferCount          : 10
EnforceIdleTimeoutDetection : True
InitiatorIds                : {IPAddress:192.168.100.1, IPAddress:192.168.100.2}
LunMappings                 : {TargetName:FileCluster;WTD:0;LUN:0, TargetName:FileCluster;WTD:1;LUN:1}
Version                     : 3.3.16543
ServerInfo                  : Server0.contoso.local

5.2. Listing existing virtual disks in a server (two virtual disks listed):

PS C:\> Get-IscsiVirtualDisk

Id                  : Server0.contoso.local:E:\LU0.VHD
VirtualDiskIndex    : 0
DevicePath          : E:\LU0.VHD
Description         : LU0
Size                : 1.00 GB
Status              : InUse
Flags               : None
SerialNumber        : BBCB1D5A-3942-446B-87A7-D264B2C77216
SnapshotStorageSize : 3.20 GB
LocalMountStatus    : NotMounted
LastLocalMountTime  : 12/31/1600 4:00:00 PM
LocalMountDeviceId  :
LocalMountPaths     : {}
Enabled             : True
ComputerName        : Server0.contoso.local
Version             : 3.3.16543
ServerInfo          : Server0.contoso.local

Id                  : Server0.contoso.local:E:\LU1.VHD
VirtualDiskIndex    : 1
DevicePath          : E:\LU1.VHD
Description         : LU1
Size                : 10.0 GB
Status              : InUse
Flags               : None
SerialNumber        : 152E24BF-DC02-46B6-98E2-1F517CB18A48
SnapshotStorageSize : 3.20 GB
LocalMountStatus    : NotMounted
LastLocalMountTime  : 12/31/1600 4:00:00 PM
LocalMountDeviceId  :
LocalMountPaths     : {}
Enabled             : True
ComputerName        : Server0.contoso.local
Version             : 3.3.16543
ServerInfo          : Server0.contoso.local

5.3. Listing existing LUN mappings for one Target (two mappings listed):

PS C:\> (Get-IscsiServerTarget "FileCluster").LunMappings

TargetName    VirtualDiskIndex    Lun
----------    ----------------    ---
FileCluster                  0      0
FileCluster                  1      1

5.4. Add new Target

PS C:\> New-IscsiServerTarget -TargetName SQLTarget -InitiatorId IPAddress:10.1.1.3

Id                          : Server0.contoso.local:SQLTarget
TargetName                  : SQLTarget
TargetIqn                   : iqn.1991-05.com.microsoft:server0-sqltarget-target
Description                 :
Enable                      : True
Status                      : Idle
LastLogin                   : 12/31/1600 4:00:00 PM
EnableChap                  : False
EnableReverseChap           : False
ComputerName                : Server0.contoso.local
MaxReceiveDataSegmentLength : 65536
FirstBurstLength            : 65536
MaxBurstLength              : 262144
ReceiveBufferCount          : 10
EnforceIdleTimeoutDetection : True
InitiatorIds                : {IPAddress:10.1.1.3}
LunMappings                 : {}
Version                     : 3.3.16543
ServerInfo                  : Server0.contoso.local

5.5. Add new Virtual Disk

PS C:\> New-IscsiVirtualDisk  "E:\SQL-LU0.VHD" -Size 10GB

Id                  : Server0.contoso.local:E:\SQL-LU0.VHD
VirtualDiskIndex    : 2
DevicePath          : E:\SQL-LU0.VHD
Description         :
Size                : 10.0 GB
Status              : Idle
Flags               : None
SerialNumber        : CD296DCA-A2CE-412D-8D0C-0D3E5077DEC7
SnapshotStorageSize : 3.20 GB
LocalMountStatus    : NotMounted
LastLocalMountTime  : 12/31/1600 4:00:00 PM
LocalMountDeviceId  :
LocalMountPaths     : {}
Enabled             : True
ComputerName        : Server0.contoso.local
Version             : 3.3.16543
ServerInfo          : Server0.contoso.local

5.6. Add new Virtual Disk Target mapping (LUN mapping) and then list it.

PS C:\> Add-VirtualDiskTargetMapping -TargetName SQLTarget -DevicePath "E:\SQL-LU0.VHD"

PS C:\> (Get-IscsiServerTarget SQLTarget).LunMappings

TargetName    VirtualDiskIndex    Lun
----------    ----------------    ---
SQLTarget                    2      0

5.7. Listing existing targets in a server (now two targets listed):

PS C:\> Get-IscsiServerTarget

Id                          : Server0.contoso.local:FileCluster
TargetName                  : FileCluster
TargetIqn                   : iqn.1991-05.com.microsoft:server0-filecluster-target
Description                 : Storage for File Server Cluster
Enable                      : True
Status                      : Connected
LastLogin                   : 9/16/2010 2:38:51 PM
EnableChap                  : False
EnableReverseChap           : False
ComputerName                : Server0.contoso.local
MaxReceiveDataSegmentLength : 65536
FirstBurstLength            : 65536
MaxBurstLength              : 262144
ReceiveBufferCount          : 10
EnforceIdleTimeoutDetection : True
InitiatorIds                : {IPAddress:192.168.100.1, IPAddress:192.168.100.2}
LunMappings                 : {TargetName:FileCluster;WTD:0;LUN:0, TargetName:FileCluster;WTD:1;LUN:1}
Version                     : 3.3.16543
ServerInfo                  : Server0.contoso.local

Id                          : Server0.contoso.local:SQLTarget
TargetName                  : SQLTarget
TargetIqn                   : iqn.1991-05.com.microsoft:server0-sqltarget-target
Description                 :
Enable                      : True
Status                      : Idle
LastLogin                   : 12/31/1600 4:00:00 PM
EnableChap                  : False
EnableReverseChap           : False
ComputerName                : Server0.contoso.local
MaxReceiveDataSegmentLength : 65536
FirstBurstLength            : 65536
MaxBurstLength              : 262144
ReceiveBufferCount          : 10
EnforceIdleTimeoutDetection : True
InitiatorIds                : {IPAddress:10.1.1.3}
LunMappings                 : {TargetName:SQLTarget;WTD:2;LUN:0}
Version                     : 3.3.16543
ServerInfo                  : Server0.contoso.local

5.8. Listing existing LUN mappings for all Targets (three mappings listed):

PS C:\> Get-IscsiServerTarget | % { $_.LunMappings}

TargetName     VirtualDiskIndex    Lun
----------     ----------------    ---
FileCluster                   0      0
FileCluster                   1      1
SQLTarget                     2      0

6. Conclusion

I hope you enjoy the new cmdlets. The best way to learn how to use them is to practice, so I encourage you to install the evaluation software on a test machine and experiment with the cmdlets yourself.

If you are an MSDN or TechNet subscriber, find the details on how to obtain an evaluation copy of the Microsoft iSCSI Software Target 3.3 at http://blogs.technet.com/b/josebda/archive/2010/09/27/windows-storage-server-2008-r2-and-the-microsoft-iscsi-software-target-3-3-are-available-on-msdn-technet-here-s-how-to-install-them.aspx

For more details about Window Storage Server and the Microsoft iSCSI Software target, check the Windows Storage Server blog at http://blogs.technet.com/b/storageserver/ and the other posts on Windows Storage Server on this blog at http://blogs.technet.com/b/josebda/archive/tags/windows+storage+server/


Using PowerShell and the the iSCSI Target 3.3 WMI classes to create a differencing VHD for OS boot

$
0
0

I recently blogged about the PowerShell cmdlets included with the Microsoft iSCSI Software Target 3.3. That included the details on all the 10 cmdlets available, including the one used to create VHD files, which is New-IscsiVirtualDisk. If you’re paying close attention to the list of new features in the iSCSI Target 3.3, you probably noticed that it also supports using differencing VHDs for OS boot. However, the parameters for New-IscsiVirtualDisk cmdlet do not mention differencing disks at all:

New-IscsiVirtualDisk [-DevicePath] <WindowsPath> [-Size] <StorageSize> [-ComputerName <string>]

Although there is no iSCSI Target cmdlet to directly create a differencing VHD, I dug a little deeper and found that the iSCSI Target also exposes a number of WMI classes. They include more functionality than the included PowerShell cmdlets expose. The good news is that PowerShell is really good at using WMI directly. So I set out to find how to create an iSCSI Target differencing disk using PowerShell and the WMI classes.

First, to get a full list of the iSCSI WMI classes related to the iSCSI Target, you need to use the –List option of the Get-WMIObject cmdlet (or gwmi for short). You need to know the specific namespace of your WMI object (you’ll find the iSCSI Target classes under “root/WMI”) and you can also filter by a portion of the class name (the iSCSI Target classes use “WT_” as a prefix). This must be done on a server with the Microsoft iSCSI Software Target 3.3 installed. So, here’s the cmdlet to list the iSCSI Target WMI classes:

PS C:\> Get-WmiObject -Namespace "root/wmi" -List "WT_*"

   NameSpace: ROOT\wmi

Name                                Methods              Properties
----                                -------              ----------
WT_SnapshotEvent                    {}                   {Id, OrigWTD, SECURITY_DESCRIPTOR, State...}
WT_DVMountedPath                    {}                   {MountedPath, WTD}
WT_LUNMapping                       {}                   {HostName, LUN, WTD}
WT_Portal                           {}                   {Address, Listen, Port}
WT_Connection                       {}                   {CID, DataDigestEnabled, HeaderDigestEnabled, InitiatorIPAd...
WT_Disk                             {NewWTDisk, NewDi... {AllocatedSize, CacheParent, Description, DevicePath...}
WT_Host                             {NewHost, AddWTDi... {CHAPSecret, CHAPUserName, Description, Enable...}
WT_IDMethod                         {}                   {HostName, Method, Value}
WT_ISnsServer                       {}                   {ServerName}
WT_Session                          {}                   {Connections, HostName, InitiatorIQN, ISID...}
WT_General                          {}                   {Index, Version}
WT_CachedInitiatorInfo              {}                   {Name}
WT_Snapshot                         {Create, Delete, ... {ExportedWTD, Id, OrigWTD, Status...}

That list alone shows that there’s a treasure trove of functionality beyond the cmdlets in the MicrosoftiSCSITarget module. But let’s focus on the problem at hand: differencing disks. I then looked at the details of the WT_Disk WMI class, which is used to manage the iSCSI Target Virtual Disks. So I put a single class name in the –List parameter and piped the result to Get-Member to see all static methods and properties.

PS C:\> Get-WmiObject -Namespace "root/wmi" -List "WT_Disk" | Get-Member

   TypeName: System.Management.ManagementClass#ROOT\wmi\WT_Disk

Name                MemberType    Definition
----                ----------    ----------
Name                AliasProperty Name = __Class
NewDiffWTDisk       Method        System.Management.ManagementBaseObject NewDiffWTDisk(System.String DevicePath, Sys...
NewWTDisk           Method        System.Management.ManagementBaseObject NewWTDisk(System.String DevicePath, System....
__CLASS             Property      System.String __CLASS {get;set;}
__DERIVATION        Property      System.String[] __DERIVATION {get;set;}
__DYNASTY           Property      System.String __DYNASTY {get;set;}
__GENUS             Property      System.Int32 __GENUS {get;set;}
__NAMESPACE         Property      System.String __NAMESPACE {get;set;}
__PATH              Property      System.String __PATH {get;set;}
__PROPERTY_COUNT    Property      System.Int32 __PROPERTY_COUNT {get;set;}
__RELPATH           Property      System.String __RELPATH {get;set;}
__SERVER            Property      System.String __SERVER {get;set;}
__SUPERCLASS        Property      System.String __SUPERCLASS {get;set;}
ConvertFromDateTime ScriptMethod  System.Object ConvertFromDateTime();
ConvertToDateTime   ScriptMethod  System.Object ConvertToDateTime();

As you can see, there is a static method NewDiffWTDisk. Now I only need the complete definition with all the required parameters. A little more work on the output (focusing on methods only and formatting as a list) did the trick:

PS C:\> Get-WmiObject -Namespace "root/wmi" -List "WT_Disk" | Get-Member -MemberType Method | Format-List

TypeName   : System.Management.ManagementClass#ROOT\wmi\WT_Disk
Name       : NewDiffWTDisk
MemberType : Method
Definition : System.Management.ManagementBaseObject NewDiffWTDisk(System.String DevicePath, System.String ParentPath, System.String Description, System.Boolean CacheParent)

TypeName   : System.Management.ManagementClass#ROOT\wmi\WT_Disk
Name       : NewWTDisk
MemberType : Method
Definition : System.Management.ManagementBaseObject NewWTDisk(System.String DevicePath, System.String Description, System.Boolean ClearPartTable, System.UInt32 SizeInMB)

You see we have two static methods for the WT_Disk class. One is the “NewWTDisk”, which maps closely to the functionality of the New-IscsiVirtualDisk cmdlet. The second is the “NewDiffWTDisk”, which creates a differencing disk. There’s a parameter to point to the parent (or base) VHD and an even more interesting parameter to tell whether we want to cache the parent VHD file in memory. This should come in handy to improve the target performance when using a single parent with multiple differencing disks. Make sure to specify a full file path for both the differencing and the parent, since the API does not take relative paths.

Now you have all you need to know to create an iSCSI Target 3.3 differencing VHD from an existing base. Just use the Get-WmiObject command syntax below:

(Get-WmiObject -Namespace "root/wmi" -List "WT_Disk").NewDiffWTDisk("<diff VHD path>","<base VHD path>","<description>",<cache parent?>)

Next, let’s go ahead and use the differencing disk feature to create an OS boot image, as an example. Before you create the differencing disk itself, you want to create a fixed-size Base.VHD, install an operating system on it, prepare it using sysprep and finally dismount it and/or remove any of its LUN mappings. In our case, I already had a Base.VHD file available, so had all I needed to create a Diff.VHD from it using NewDiffWTDisk:

PS C:\> (Get-WmiObject -Namespace "root/wmi" -List "WT_Disk").NewDiffWTDisk("E:\Diff.VHD","E:\Base.VHD","Diff", $True)

__GENUS          : 2
__CLASS          : __PARAMETERS
__SUPERCLASS     :
__DYNASTY        : __PARAMETERS
__RELPATH        :
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
ReturnValue      : System.Management.ManagementBaseObject

Once the diff disk is created, you can use the regular PowerShell cmdlets to list it, associate with a target, etc.

PS C:\> Import-Module MicrosoftIscsiTarget

PS C:\> Get-IscsiVirtualDisk

Id                  : Server0.contoso.local:E:\Diff.VHD
VirtualDiskIndex    : 0
DevicePath          : E:\Diff.VHD
Description         : Diff
Size                : 10 GB
Status              : Idle
Flags               : None
SerialNumber        : DDC8DEBA-C4F1-4AE5-B137-9CA530538AD8
SnapshotStorageSize : 0.00 B
LocalMountStatus    : NotMounted
LastLocalMountTime  : 12/31/1600 4:00:00 PM
LocalMountDeviceId  :
LocalMountPaths     : {}
Enabled             : True
ComputerName        : Server0.contoso.local
Version             : 3.3.16543
ServerInfo          : Server0.contoso.local

Note that the size is returned as 10 GB, which was the size of my base VHD. As you saw, the WMI method to create the differencing disk does not take a size parameter. The size property actually comes from the base VHD. Also note that the iSCSI Target does not use dynamically expanding VHD files, so your base VHD must be of fixed size. You can use the New-IscsiVirtualDisk PowerShell cmdlet to create the base VHD, since it’s just a regular fixed-sized VHD file. Just make sure you never mount the base VHD or expose it to an initiator after your create any diffs from it. Any changes to the base VHD will corrupt the differencing disk.

I hope you enjoyed this tip on how to use the iSCSI Target WMI classes to create a differencing VHD. You could do much more with those WMI classes, though. For instance, you could use them to manage iSCSI Target snapshots. But that’s a topic for another blog post…

If you are an MSDN or TechNet subscriber, find the details on how to obtain an evaluation copy of the Microsoft iSCSI Software Target 3.3 at http://blogs.technet.com/b/josebda/archive/2010/09/27/windows-storage-server-2008-r2-and-the-microsoft-iscsi-software-target-3-3-are-available-on-msdn-technet-here-s-how-to-install-them.aspx. For more details about Window Storage Server and the Microsoft iSCSI Software target, check the Windows Storage Server blog at http://blogs.technet.com/b/storageserver/ and the other posts on Windows Storage Server on this blog at http://blogs.technet.com/b/josebda/archive/tags/windows+storage+server/

Great SQL Server Storage advice from a team deploying SQL with LOB apps

$
0
0

During an internal conference this week I came across a group at Microsoft Services that works directly with customers that are deploying SQL Server to support line-of-business applications like like SAP and JD Edwards. They pointed me to their recent blog (started in September 2010) which already produced excellent technical and business content. Out of the 36 posts so far (that’s over 4 a month!) I was most impressed with the quality technical content around SQL Server as it relates to Storage. The tips for LUN creation, advice on SQL data file configuration and guidance on using SQLIO for performance testing are really insightful. Here are some direct links to a few of their posts to get you started:

This is highly recommended reading for SQL DBAs that want to understand Storage management and for Storage Administrators that want to go deeper on how SQL works. I would definitely recommend adding http://blogs.technet.com/b/lobapps to your blog roll.

New white paper providing guidance for sizing NTFS volumes

$
0
0

A new white paper covering "NTFS CHKDSK Best Practices and Performance" was posted today at microsoft.com/downloads, covering the CHKDSK improvement in Windows 7 and Windows Server 2008 R2.

This was first highlighted in a blog post by Claus Joergensen in the Filecab blog. Claus mentioned: "Today, Microsoft released a new white paper discussing best practices and guidance for sizing NTFS volumes and some details on CHKDSK execution times on Windows Server 2008 R2. When planning Windows File Server deployments. We are often asked questions such as 'How large can I make my volumes?' or 'How long will it take to repair a volume?'. This white paper helps answer these questions."

Scott M. Johnson also covered the the white paper release on Storage Server blog. Scott said "If you are planning a Windows file server deployment or is looking to upgrade an existing Windows file server deployment to Windows Server 2008 R2, you should consult the white paper. It outlines how with Windows Server 2008 R2, NTFS can scale to easily support 15 TB file systems with 10 million files! Even with hundreds of millions of files the CHKDSK execution times are really fast."

Claus' complete post (with additional details is at) is at http://blogs.technet.com/b/filecab/archive/2011/02/22/new-white-paper-providing-guidance-for-sizing-ntfs-volumes.aspx

Scott's complete post (including a table of contents) is at http://blogs.technet.com/b/storageserver/archive/2011/02/23/guidance-for-sizing-ntfs-volumes.aspx

The actual white paper can be downloaded from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35a658cb-5dc7-4c46-b54c-8f3089ac097a

SQL over SMB2 - One of the top 10 hidden gems in SQL Server 2008 R2

$
0
0

Introduction 

The SQL CAT team has posted a blog last year about the "Top 10 hidden gems in SQL Server 2008 R2", which included the support for placing SQL database files on an SMB network file share. This works even better if you use the SMB2 version of the protocol, which is included in Windows Server 2008 and Windows Server 2008 R2. In a recent presentation about the performance, scalability and availability improvements in the Windows Server 2008 R2 file services, I used this "SQL over SMB2" scenario in one of my demos. It was interesting that many in the audience were unaware of this feature in SQL Server and were actually surprised by it. I guess at least this one feature continues to be a "hidden gem".

 

Here's a quote from that SQL CAT post:

 

SMB stands for Server Message Block and this protocol is now officially supported by SQL Server 2008 R2 and beyond. This improvement has formalized the support status of placing SQL database files on SMB network file shares. From Kevin Farlee, the owner of this feature in SQL Server: “This presents a better-together story with the work that Windows has done in Windows 7 and Windows Server 2008 R2 to make the Windows SMB stack far more performant and resilient than in the past. It is also a recognition that with the increasing acceptance of iSCSI, customers are viewing Ethernet as a viable way to connect to their storage. Finally, it gives customers in consolidation environments a very simple to manage method for moving databases between servers without investing in a large SAN infrastructure.”

 

How to use “SQL over SMB2”

 

To use “SQL over SMB2” in SQL Server 2008 R2, you simply have to use a UNC path like “\\fileserver\share\database.mdf” in the FILENAME parameter when creating a new database. Here’s a sample command to create a database:

 

CREATE DATABASE Sales

ON (NAME=Sales_data, FILENAME='\\JOSE-S4\SQLDATA\SALESDATA.MDF')

LOG ON (NAME=Sales_log, FILENAME='\\JOSE-S4\SQLLOGS\SALESLOG.LDF');

 

You want to make sure that the account used to run SQL Server has “Full Control” permissions to the file share and NTFS folder where you want to place the database files and log files. If your SQL Server instance is running under “Network Service”, you should grant the share and folder permissions to the computer account of the computer running SQL Server.

 

In SQL Server 2008 R2, you can’t place a system database on an SMB2 share or configure SQL Server in a failover cluster using SMB2 as shared storage.

 

“SQL over SMB2” and earlier versions of SQL Server

 

In SQL Server 2008 and earlier versions, trying to create a database in an SMB2 file share will return an error like this:

 

Msg 5110, Level 16, State 2, Line 1

The file "\\JOSE-S4\SQLDATA\SALESDATA.MDF" is on a network path that is not supported for database files.

Msg 1802, Level 16, State 1, Line 1

CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

 

In SQL Server versions before SQL Server 2008 R2, you could enable this behavior using trace flag 1807 (running the “DBCC TRACEON(1807)” command), but this was not a supported scenario for that version of SQL Server. This old behavior is described in KB article 304261 (http://support.microsoft.com/kb/304261).

 

Performance Recommendations

 

Obviously, you want to make sure your file server is configured properly and can deliver the throughput and IOPS required for your specific scenario, just like you would using other types of storage like DAS, FC SAN and iSCSI SAN. Here are a few recommendations to improve performance of “SQL over SMB2”:

 

·         Use Windows Server 2008 R2 on both the SQL Server and File Server site, so they can negotiate up to SMB version 2.1.

·         Create different shares for database files and log files, each using a different volume and a different set of spindles.

·         Create the file shares on volumes using multiple spindles, in a RAID-10 configuration.

·         Use at least 1GbE NIC (10GbE if possible) and watch if the network is becoming a bottleneck.

·         Use multiple network paths between the SQL Server and the File Server, with different paths for database files and log files.

 

As you can probably recognize, many of these recommendations are similar to the recommendations regarding other types of storage used with SQL Server, specially iSCSI SANs.

 

Conclusion

 

If you never experimented with “SQL over SMB2” before, give it a try. You will find a whole lot of flexibility and, with the right storage subsystem and network infrastructure, it will should perform beyond your expectations.

 

Related Links

 

Post from the SQL CAT team and details on main features and the 10 hidden gems in SQL Server 2008 R2:

http://sqlcat.com/technicalnotes/archive/2010/05/07/top-10-hidden-gems-in-sql-2008-r2.aspx

 

Details on the differences between SMB1 and SMB2:

http://blogs.technet.com/b/josebda/archive/2008/12/09/smb2-a-complete-redesign-of-the-main-remote-file-protocol-for-windows.aspx

 

Details on the differences between SMB2 to SMB 2.1:

http://www.snia.org/events/storage-developer2009/presentations/tuesday/DavidKruse_SMBv21.pdf

 

Details on which SMB version your configuration is using:

http://blogs.technet.com/b/josebda/archive/2010/10/26/what-version-of-smb2-am-i-using-on-my-windows-file-server.aspx

Microsoft iSCSI Software Target 3.3 for Windows Server 2008 R2 available for public download

$
0
0

Introduction

For the last few years, I’ve been blogging about the Microsoft iSCSI Software Target and its many uses related to Windows Server Failover Clustering, Hyper-V and other server scenarios. Today, Microsoft has made this software publicly available to all users of Windows Server 2008 R2.

The Microsoft iSCSI Software Target has been available for production use as part of Windows Storage Server since early 2007. It has also been available for development and test use by MSDN and TechNet subscribers starting in May 2009. However, until now, there was no way to use the Microsoft iSCSI Software Target in production on a regular server running Windows Server 2008 R2. This new download offers exactly that.

Now available as a public download, the software is essentially the same software that ships with Windows Storage Server 2008 R2. Windows Storage Server 2008 R2 and the public download package will be refreshed (kept in sync) with any software fixes and updates. Those updates are described at http://technet.microsoft.com/en-us/library/gg232597.aspx.

This release was preceded by intense testing by the Microsoft iSCSI Target team, especially in scenarios where the iSCSI Target is used with Hyper-V and with Windows Server Failover Clusters. We do imagine these to be amongst the most commons deployment scenarios.

Testing included running the Microsoft iSCSI Software Target in a two-node Failover Cluster and configuring 92 individual Hyper-V VMs, each running a data intensive application and storing data on a single node of that iSCSI Target cluster. The exciting part of the test was to force an unplanned failure of the iSCSI Target node being used by all the VMs and verify that we had a successful failover to the other node with all 92 VMs continuing to run the application without any interruption.

How to download and install

To download the Microsoft iSCSI Software Target 3.3 for Windows Server 2008 R2, go to http://www.microsoft.com/downloads/en/details.aspx?FamilyID=45105d7f-8c6c-4666-a305-c8189062a0d0 and download a single file called “iSCSITargetDLC.EXE”. (Note: This was just released at 10AM PST on 04/04/2011, so the download might still be replicating to your closest download server. If the link does not work, try again later). This is a self-extracting archive that will show this screen when run:

clip_image002

Select a destination folder and click “Install”. Once it finishes, you will find a few files available to you in  that folder:

Files Description
<folder>\autorun.inf
<folder>\bkgd-page-servers-dynagrid.jpg
<folder>\copyright.jpg
< folder>\Documentation
<folder>\Index.htm
<folder>\wsr2logo.bmp
Welcome page. Start with Index.htm
<folder>\Documentation\iSCSItarget_Gstart_R2.doc Getting Started Guide
<folder>\Documentation\iSCSI_33_relnotes.doc Release Notes
<folder>\x64\iscsitarget_public.msi Microsoft iSCSI Software Target installer (64-bit only)
<folder>\x64\iscsitargetClient_public.msi VSS and VDS providers for the iSCSI Target (64-bit)
<folder>\x86\iscsitargetClient_public.msi VSS and VDS providers for the iSCSI Target (32-bit)

 

If you click on the index.htm file on the main folder, you will see the welcome page with a few links to the items included:

clip_image003

To install the iSCSI Target on a computer running Windows Server 2008 R2, simply run the “iscsitarget_public.msi” MSI file from a command line or right-click it on Windows Explorer and choose “Install”.

Frequently Asked Questions (FAQ)

Q: Can I install the Microsoft iSCSI Software Target 3.3 on Windows Server 2008 or Windows Server 2003?
A: No. The Microsoft iSCSI Software Target 3.3 can only be installed on Windows Server 2008 R2.

Q: Can I install the Microsoft iSCSI Software Target on Windows Server 2008 R2 with Service Pack 1 (SP1)?
A: Yes. In fact, that’s what is recommended.

Q: Can I install the Microsoft iSCSI Software Target on a Core install of Windows Server 2008 R2?
A: No. The Microsoft iSCSI Software Target 3.3 is only supported in a Full install.

Q: I don’t have a copy of Windows Server 2008 R2. Where can I get an evaluation copy?
A: You download an evaluation version of Windows Server 2008 R2 with Service Pack 1 from http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx

Q: Where is the x86 (32-bit) version of the Microsoft iSCSI Software Target 3.3?
A: The Microsoft iSCSI Software Target 3.3, is provided in only in an x64 (64-bit) version, as is Windows Server 2008 R2,

Q: What are these “iSCSITargetClient” MSI files included in the download?
A: Those are the optional VSS and VDS providers for the Microsoft iSCSI Software Target 3.3. You should install them in the same computer that runs the iSCSI Initiator if you intend to use VSS or VDS. For details on VSS, see http://blogs.technet.com/b/josebda/archive/2007/10/10/the-basics-of-the-volume-shadow-copy-service-vss.aspx. For details on VDS, see http://blogs.technet.com/b/josebda/archive/2007/10/25/the-basics-of-the-virtual-disk-services-vds.aspx

Q: Where is the Windows Storage Server 2008 R2 documentation?
A: There is some documentation inside the package. Additional documentation is available on the web at http://technet.microsoft.com/en-us/library/gg232606.aspx

Q: Can I use the Microsoft iSCSI Software Target 3.3 as shared storage for a Windows Server Failover Cluster?
A: Yes. That is one of its most common uses.

Q: Can I install the Microsoft iSCSI Software Target 3.3 in a Hyper-V virtual machine?
A: Yes. We do it all the time.

Q: Can I use the downloaded Microsoft iSCSI Software Target 3.3 in my production environment?
A: Yes. Make sure to perform the proper evaluation and testing before deploying any software in a production environment. But you knew that already…

Q: What are the support policies for the Microsoft iSCSI Software Target 3.3 on Windows Server 2008 R2?
A: The support policies are listed at http://technet.microsoft.com/en-us/library/gg983493.aspx

Links

I would recommend that you download and read my previous blog posts about the Microsoft iSCSI Software Target. Here are some of the most popular ones.

Please keep in mind that some of these posts mention previous versions of the Microsoft iSCSI Software Target that ran on different Windows Server versions. The overall guidance, however, still applies. 

Conclusion

I hope you are as excited as we are about this release. Download it and experiment with it. And don’t forget to post a comment about your experience or send us your feedback.

Updated iSCSI Initiator Users Guide for Windows 7 and Windows Server 2008 R2

$
0
0

We just got an updated version of the “iSCSI Initiator Users Guide for Windows 7 and Windows Server 2008 R2“ posted on the Microsoft Download Center by Bruce Langworthy, the iSCSI Initiator PM.

 

Here’s a summary of the contents of this 82-page Word document:

 

·         Microsoft iSCSI Initiator Step-by-Step Guide

·         Understanding Microsoft iSCSI Initiator Features and Components

-          What’s new in Microsoft iSCSI Initiator in Windows Server 2008 R2 and Windows 7

-          SAN components in Microsoft iSCSI Initiator

-          Microsoft iSCSI Initiator implementation

-          Microsoft iSCSI Initiator components

-          Services that depend on iSCSI devices

-          How Microsoft iSCSI Initiator accesses targets

n  Node names

n  Initiator Instance

n  Discovery mechanisms

·         Installing and Configuring Microsoft iSCSI Initiator

-          Security

n  CHAP

n  IPsec

-          Microsoft iSCSI Initiator best practices

n  Storage array performance best practices

n  Security best practices

n  Networking best practices

n  Networking hardware best practices

-          Easier Firewall configuration for Windows Server 2008 R2 and Windows 7

-          Connecting to an iSCSI target device

-          Connecting to an iSCSI target by using advanced settings

·         Using Microsoft iSCSI Initiator in Windows Server 2008 R2 and Windows 7

-          Opening Microsoft iSCSI Initiator

-          Initiator IQN Name

-          Favorite targets

-          Running automatic start services on iSCSI disks

-          Generating iSCSI configuration reports

-          Using Microsoft iSCSI Initiator on the Server Core installation of Windows Server 2008 R2

-          Management application

-          Determining if a drive is connected via iSCSI

·         Appendix A: Advanced Configuration Settings

-          Using registry settings to configure advanced settings for the iSCSI Initiator

-          The following MPIO timers and timeout values may be used to tune the configuration of MPIO.   MPIO Timer Key Values

-          Microsoft iSCSI Initiator Service Timers

-          Microsoft iSCSI Initiator Driver Timers

-          Other Timers

·         Appendix B - Event Tracing in MS iSCSI Drivers

·         Appendix C - iSCSI Eventlog messages

-          Microsoft iSCSI Initiator Service

-          Microsoft Software Initiator Kernel Mode Driver

·         Appendix D – iSCSICLI command reference

-          Manually Configured Targets

n  iscsicli AddTarget

n  iscsicli QAddTarget

n  iscsicli RemoveTarget

-          Target Portals

n  iscsicli AddTargetPortal

n  iscsicli QAddTargetPortal

n  iscsicli RemoveTargetPortal

n  iscsicli RefreshTargetPortal

n  iscsicli ListTargetPortals

-          iSNS

n  iscsicli AddiSNSServer

n  iscsicli RemoveiSNSServer

n  iscsicli RefreshiSNSServer

n  iscsicli ListiSNSServers

-          Target Operations

n  iscsicli TargetInfo

n  iscsicli LoginTarget

n  iscsicli ListTargets

n  iscsicli QLoginTarget

n  iscsicli LogoutTarget

n  iscsicli PersistentLoginTarget

n  iscsicli ListPersistentTargets

n  iscsicli RemovePersistentTarget

n  iscsicli AddConnection

n  iscsicli QAddConnection

n  iscsicli RemoveConnection

-          SCSI Commands

n  iscsicli ScsiInquiry

n  iscsicli ReadCapacity

n  iscsicli ReportLUNs

n  iscsicli ReportTargetMappings

-          IPSEC Commands

n  iscsicli TunnelAddr

n  iscsicli GroupKey

n  iscsicli PSKey

-          Volume Binding Commands

n  iscsicli BindPersistentVolumes

n  iscsicli BindPersistentDevices

n  iscsicli ReportPersistentDevices

n  iscsicli AddPersistentDevice

n  iscsicli RemovePersistentDevice

n  iscsicli ClearPersistentDevices

-          Miscellaneous Commands

n  iscsicli ListInitiators

n  iscsicli NodeName

n  iscsicli SessionList

n  iscsicli CHAPSecret

n  iscsicli VersionInfo

·         Appendix E – Microsoft iSCSI Software Initiator Error Messages and Status Codes

·         Appendix F – Sample iSCSICLI login Script

 

This is a great guide and mandatory reading for those deploying an iSCSI solution in the Windows platform.

Download now from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=00d7c33c-93cc-4449-8d5e-3fd12d820b56

Using 4k sector and advanced format drives in Windows. HotFix and support info for Windows Server 2008 R2 and Windows 7

$
0
0

If you work with storage, you probably already heard about the “4K Sector Drives”, “Advanced Format Drives” and “512e drives”. These new “4K sector drives” abandon the traditional use of 512 bytes per sector in favor of a new structure that uses 4096 bytes. The migration to the new formats is eased by the use of 4K drives that simulate the old format, known as “512 Emulation Drives” or “512e Drives” or Advanced Format Drives”.
 
Native 4K sector drives are currently not supported with Windows. However, 512e drives (or Advanced Format Drives) are supported with recent versions of Windows, provided that you follow the guidance in the following support article: http://support.microsoft.com/kb/2510009. There are specific requirements to be met and specific details for different Microsoft applications like Hyper-V, SQL Server and Exchange Server.
 
For Windows 7 and Windows Server 2008 R2, the KB article above mentions the requirement to install a specific hotfix described at http://support.microsoft.com/kb/982018. Please note that most of this fix is part of Windows 7 Service Pack 1 (SP1) or Windows Server 2008 R2 SP1, except for updates to the FSUTIL tool.

For you developers, head on over to MSDN to read on the nitty gritty details of this storage transition, and how it may impact your applications. Details are published at http://msdn.microsoft.com/en-us/library/hh182553.aspx.

If you’re interested in these new 4K sector drives, you might also want to look at these other links:

Note: The updated version of FSUTIL is available as a download from the support KB page and, since 4/26/2011, via Windows Update labeled as "Update for Windows 7 (KB982018)".

-----

After I posted this blog, MikeH asked on FileCab: Is there any way I can figure out if the installed drive uses 4K or emulation mode?

Answer: You can recognize "Advanced Format" drives (also known as 512e or 512 emulation) by using FSUTIL FSINFO NTFSINFO <drive> and looking at the "Bytes per Sector" and "Bytes Per Physical Sector". Those drives will show 512 bytes per sector but 4096 (4K) bytes per physical sector. For more details, read the section titled "Issue 6" at http://support.microsoft.com/kb/982018.


Diskless server boot using the Microsoft iSCSI Software Target and a regular network card

$
0
0

The new Microsoft iSCSI Software Target 3.3 is commonly deployed to provide data storage for servers that boot from a local hard drive. However, there are interesting cost savings and management advantages in deploying servers that have no local disk at all and get their syste and boot volumes from the iSCSI target. The iSCSI Target team has worked closely with the Windows HPC Server team to enable this specific solution, common in HPC environments.

Jian Yan, the Program Manager for the iSCSI Software Target, has a new blog post on Filecab that describes in details how to configure diskless servers and boot from the Microsoft iSCSI Target 3.3 (which is now available as a free download for Windows Server 2008 R2). This is a great, lengthy post that includes pictures, screenshot and script samples. Here's an outline:

  • Overview
    • Terminology
    • Deployment
    • Boot process
  • Hardware/Software options
    • An iSCSI boot-capable NIC
    • An iSCSI boot-capable HBA
    • An iSCSI boot loader
  • Boot Process
    • Pre-boot
    • Windows boot
  • Various deployment configurations
    • Using an iSCSI boot-capable NIC or HBA
    • Using a Software boot loader with DHCP and TFTP servers
    • Using a Software Boot Loader without DHCP and TFTP
  • Step-by-step deployment guide
    • Create a Golden Image
    • Customize the boot loader script
    • Deploy diskless clients using a Golden image

This is highly recommended reading for anyone deploying diskless servers (or anyone about to buy a few servers who wants to save some money on storage :-).

Read the post at http://blogs.technet.com/b/storageserver/archive/2011/05/04/diskless-servers-can-boot-and-run-from-the-microsoft-iscsi-software-target-using-a-regular-network-card.aspx

For details on how to download the Microsoft iSCSI Software Target 3.3, read http://blogs.technet.com/b/josebda/archive/2011/04/04/microsoft-iscsi-software-target-3-3-for-windows-server-2008-r2-available-for-public-download.aspx

For a technical presentation about the performance of the iSCSI Target in Windows diskless boot scenarios, see this SDC presentation: http://www.snia.org/events/storage-developer2010/presentations/thursday/QiangWang_Analyzing_Large-scale_Network.pdf

Links to //build/ sessions on Storage, Networking and Hyper-V

$
0
0

Last month at the //Build/ conference we had a large number of presentations delivered and made available to download and stream. Several Microsoft Partners and Developers that are focused on Storage, Networking or Hyper-V have asked me for a list of links to help them find the Widows Server 8 sessions more closely related to those topics. Here is my attempt to create that list:

Sessions related to Continuous Availability:

Sessions related to Private Clouds:

Sessions related to Claims-based Access Control and Branch Cache:

Related blog posts on official Microsoft blogs:

Other interesting links released since the //build/ conference:

Have fun reading and/or watching them… :-)

SNIA’s Storage Developer Conference - SDC 2011 content (slides and videos) now available for download, including SMB 2.2 details

$
0
0

The Storage Networking Industry Association (SNIA) hosted the 8th Storage Developer Conference (SDC) in the Hyatt Regency in beautiful Santa Clara, CA (Silicon Valley) earlier this year. As usual, Microsoft was the underwriter of the CIFS/SMB/SMB2 PlugFest, which was co-located with the SDC event.

For developers working with storage-related technologies, this event gathers a unique crowd and includes a rich agenda. Key industry players were represented and offered presentations. It’s always worth reminding you that the SDC presentations were usually delivered to developers by the actual product development teams and frequently the actual developer of the technology either delivered the presentation or was in the room to take questions. That kind of deep insight is not common in every conference out there.

Microsoft presentations this year included:

Title Presenter
SMB 2.2: Bigger. Faster. Scalier - Part 1 David Kruse Principal Development Lead
SMB 2.2: Bigger. Faster. Scalier - Part 2 Mathew George Senior Software Development Engineer
Advancements in Backup to Support Application Storage on a File Server Molly Brown Principal Development Lead
SMB 2.2 over RDMA Thomas Talpey Software Architect
Greg Kramer Software Development Engineer
SMB2: Advancements for WAN Molly Brown Principal Development Lead
Speeding Up Cloud/Server Applications Using Flash Memory Sudipta Sengupta Research Scientist
Windows 8: Storage Provisioning and Management Shiv Rajpal Principal Development Lead
Windows 8 File System Performance and Reliability Enhancements in NTFS Neal Christiansen Principal Development Lead
Windows Server 8 and SMB 2.2 - Advancements in Management Jose Barreto Principal Program Manager
NFS High Availability in Windows Roopesh Battepati Principal Development Lead
Microsoft SMI-S Roadmap Update Jeff Goldner Principal Architect
IETF NFSv4 Working Group: What's Next? Spencer Shepler Performance Architect
Converting an Enterprise Application to Run on CIFS/SMB/SMB2 File Access Protocols Kevin Farlee Storage Engine Program Manager, SQL Server
SMB2: Advancements in Server Application Performance Dan Lovinger Principal Software Architect
Advancements in Hyper-V Storage Todd Harris Senior Software Design Engineer
Senthil Rajaram Senior Program Manager

 

SNIA has now released the content publicly, including video recordings for many of the talks. Check these and other presentations (all with slides and many with video recordings) at http://www.snia.org/events/storage-developer2011/2011presentations

If you like the content, be sure to mark your calendars for next year’s SDC 2012. It’s always a great event and the details are already out at http://www.snia.org/about/calendar/2012-storage-developer-conference

Bill Laing announces Windows Server 2012 Beta - Enjoy your pre-release SMB 2.2 File Server

$
0
0

Bill Laing, Corporate VP for Server and Cloud, just announced the availability of Windows Server 2012 Beta. That means you can now install this pre-release version of the OS, which brings a number of Storage and Continuous Availability enhancements. We started talking about those back in the //build conference in September, but now it’s your time to experiment with it yourself. You can read more about those enhancements in the blog post by Thomas Pfenning (General Manager, Server and Tools).

I’m obviously interested in the SMB 2.2 File Server features. After working on this for the last couple of years, I’m glad you can now enjoy the new Continuously Available File Server first hand and try the new Hyper-V over SMB scenario. More blogs posts are coming, but I would like to highlight that TechNet now includes new content on the Windows Server 2012 beta. Here are a few pointers to pages covering specifically the new version of the File Server:

That’s it for now. Grab some coffee, download the bits, read the posts and start up the machines on your test lab. This is going to be fun…

Windows Server 2012 Beta Scale-Out File Server for SQL Server 2012 - Step-by-step Installation

$
0
0

IMPORTANT: This blog post is now obsolete. For the latest version of this content, please visit:
http://blogs.technet.com/b/josebda/archive/2012/08/23/windows-server-2012-scale-out-file-server-for-sql-server-2012-step-by-step-installation.aspx

 


 

1. Introduction

1.1. Overview

In this document, I am sharing all the steps I used to create a Windows Server 2012 Beta demo, so you can experiment with some of the new technologies yourself. You only need a single computer (the specs are provided below) and the ISO file with the Windows Server 2012 Beta available right now as a free download. For the SQL part, you will need the SQL Server 2012 evaluation version, which is also available as a free download.

The demo setup includes 5 virtual machines: one domain controller, one iSCSI target, two file servers and a SQL server. You need the iSCSI target and two file servers because we’re using Failover Clustering to showcase SMB Transparent Failover and SMB Scale-Out. We’ll also use multiple Hyper-V virtual networks, so we can showcase SMB Multichannel. Here’s what it should look like:

clip_image001

This will probably require a few hours of work end-to-end, but it is a great way to experiment with a large set of Microsoft technologies in Windows Server 2012 Beta, including:

  • Hyper-V
  • Networking
  • Domain Name Services (DNS)
  • Active Directory Domain Services (AD-DS)
  • iSCSI Target
  • iSCSI Initiator
  • Failover Clustering
  • File Servers
  • PowerShell

Follow the steps and let me know how it goes in the comment section. If you run into any issues or found anything particularly interesting, don’t forget to mention the number of the step.

1.2. Hardware

You will need the following hardware to perform the steps described here:

  • Computer capable of running Windows Server 2012 Beta and Hyper-V (64-bit, virtualization technology) with at least 8GB of RAM
  • An 8GB USB stick, if you’re installing Windows Server from USB and copying the downloaded software around (you can also burn the software to a DVD)
  • Internet connection for downloading software and updates (DHCP enabled)

1.3. Software

You will need the following software to perform the steps described here:

1.4. Notes and disclaimers

  • This document does not include a screenshot for every single step in the process. I focused the screenshots on specific decision points where defaults are not used or the course of action is not clear.
  • The text for each step also focuses on the specific actions that deviate from the default or where a clear default is not provided. If you are asked a question or required to perform an action that you do not see described in these steps, go with the default option.
  • Obviously, a single-computer solution can never be tolerant to the failure of that computer. So, the configuration described here is not really continuously available. It’s just a simulation.
  • The configuration described here is for demo, testing or learning. You would definitely need a different configuration for a production deployment.
  • A certain familiarity with Windows administration and configuration is assumed. If you're new to Windows, this document is not for you. Sorry...
  • There are usually several ways to perform a specific configuration or administration task. What I describe here is one of those many ways. It's not necessarily the best way, just the one I personally like best at the moment.

2. Install Windows Server 2012 Beta

2.1. Preparations

  • Format a USB disk using Windows 8 Consumer Preview or Windows Server 2012 Beta.
  • Copy the contents of the Windows Server 2012 Beta ISO file to the USB disk.
  • To read the files from within the ISO file using Windows 8 Consumer Preview or Windows Server 2012 beta, just double click the ISO file to mount it.
  • Make sure the computer BIOS is configured for Virtualization.
  • Each computer BIOS is different, so you need to find the right settings.

2.2. Install the OS

  • Use your computer’s BIOS option to boot from the USB disk.
  • After “Windows Setup” starts from the USB disk, enter the required information to install the OS:
  • Select language, time and currency format and keyboard. Then click “Next”.
  • Click “Install Now”.
  • Select the “Windows Server 8 Beta Datacenter - Server with a GUI” option and click “Next”.
     
    clip_image002[7]
     
  • Accept the license agreement and click “Next”.
  • Select the “Custom: Install Windows only” option.
  • Select the install location for Windows Server and click “Next”.
  • Wait for the installation to complete. This will take a few minutes.
  • After the installation is completed, the OS will boot.
  • Type the administrator password twice, then click on “Finish”.

2.3. Rename the computer

  • Login to the computer using the Administrator password and rename the computer.

2.3.PS. Using PowerShell

Rename-Computer DEMO-HV0 -Restart

2.3.GUI. Using Server Manager

  • In Server Manager, click on “Local Server” on the list on left.
  • Click on the default name next to “Computer Name”.
  • Click on “Change”.
  • Enter “DEMO-HV0” as the new Computer Name and click “OK”.
  • Accept the option to restart the computer.

2.4. Enable Remote Desktop

  • Log in using the Administrator account and enable Remote Desktop.
  • After completing this step, you will be able work from a Remote Desktop connection.

2.4.GUI. Using Server Manager

  • In Server Manager, click on “Local Server” on the list on left.
  • Click on the “Disabled” item next to “Remote Desktop”.
  • Select the option to “Allow connections from computers running any version…”
  • Click “OK” multiple times until you’re back to the “Local Server” screen.

3. Configure the Hyper-V Host

3.1. Install the Hyper-V role to the server

  • Install the Hyper-V role and the required management tools. The computer will restart.

3.1.PS. Using PowerShell

Install-WindowsFeature Hyper-V, Hyper-V-PowerShell, Hyper-V-Tools -Restart

3.1.GUI. Using Server Manager

  • In Server Manager, click on “Dashboard” on the list on left.
  • Click on the “Add Roles and Features”, which is option 2 under “Configure this local server”.
  • On the “Before You Begin” page, just click “Next”.
  • On the “Installation Type” page, click “Role-base or feature-based installation” and click “Next”.
  • On the “Server Selection” page, select your server and click “Next”.
  • On the “Server Role” page, select “Hyper-V”.
  • On the “Add features that are required for Hyper-V” dialog, click “Add features”, then click “Next”.
     
    clip_image003
     
  • On the “Features” page, just click “Next”.
  • On the “Hyper-V” page, just click “Next”.
  • On the “Create Virtual Switches” page, just click “Next”.
  • On the “Virtual Machine Migration” page, just click “Next”.
  • On the “Default Stores” page, just click “Next”.
  • On the “Confirmation” page, click “Restart target machine automatically if needed”, click “Yes” to confirm and then click “Install”.
  • The role will be installed and the computer will restart in the end.

3.2. Create the VM switches

  • Create one external virtual network (VM switch that is connected to the external network interface).
  • Create three internal virtual networks (VM switches used just to communicate between the VMs).

3.2.PS. Using PowerShell

Get-NetAdapter

clip_image004

Rename-NetAdapter –InterfaceDescription *Gigabit* -NewName External
New-VMSwitch –Name External -NetAdapterName External
1..3 | % { New-VMSwitch -Name Internal$_ -SwitchType Internal }
Get-VMSwitch
Get-NetAdapter

clip_image005

  • Note: If you’re connected via “Remote Desktop” to the server, you might temporarily lose the connection when you create the External VMSwitch.
    If using DHCP on that interface, you will be able to reconnect. If you’re using static IP addresses, you should run this step locally, not via “Remote Desktop”.

3.2.GUI. Using Hyper-V Manager

  • In Server Manager, click on “Tools” in the upper left and select “Hyper-V Manager”
  • In Hyper-V Manager, click on the server name (DEMO-HV0) on the pane on the left
  • On the task pane on the right, click on the “Virtual Switch Manager”
     
    clip_image006
     
  • Use the “New virtual switch” option to add 1 network named “External”, select “External” for type and select your physical NIC. Click “Apply” to confirm.
  • Use the “New virtual switch” option to add 3 networks named “Internal1”, “Internal2” and “Internal3”, each of type “Internal”.

    clip_image007
  • After creating the four new NICs, you should see the four new NICs in Server Manager, under Local Server:
     
    clip_image008
     

3.3. Rename the network adapters

  • You should now configure the 4 virtual network interfaces on the parent.
  • This includes renaming them to the names of the switches and configuring static IP addresses for the 3 internal NICs (the external NIC should be DHCP enabled, so it does not need IP address configuration).

3.3.PS. Using PowerShell

1..3 | % {Rename-NetAdapter –InterfaceDescription Internal$_ -NewName Internal$_}
Rename-NetAdapter –InterfaceDescription External -NewName VirtualExternal
Get-NetAdapter

clip_image009
 

3.3.GUI. Using Server Manager

  • In Server Manager, click on “Local Server” on the list on left.
  • In the properties pane on the right, scroll to see the list of “Wired Internet Connections” (there will be 4 of them, as we showed in the previous Server Manager screenshot).
  • Click on the “Ipv4 address…” link next to one of the interfaces, the “Network Connections” window will show.
  • Select the interface that shows as “Enabled” and click on “Rename this connection” to rename it to “External”.
  • Rename the 3 interfaces on an “Unidentified network” to “Internal1”, “Internal2” and “Internal3”
     
    clip_image010
     
  • Close the “Network Connections” and refresh the “Local Server” view. You should see the results below:
     
    clip_image011
     

3.4. Assign static IP addresses for the Hyper-V host

  • In this step, you will assign a static IP address to the 3 internal virtual NICs on the parent partition.
  • These NICs initially use the default setting (DHCP), but there is no DHCP server for the internal network.
  • The table below shows the desired configuration for each interface.

Machine

Virtual
External

Internal1

Internal2

Internal3

Parent

DHCP

192.168.101.100

192.168.102.100

192.168.103.100

  • Note 1: The VirtualExternal network does not need any further configuration, since the default is already to use DHCP.
  • Note 2: The preferred DNS IP address for all 3 internal interfaces should be set to 192.168.101.1 (that will be the IP address of the DNS server we will configure later).

3.4.PS. Using PowerShell

1..3 | % {
Set-NetIPInterface –InterfaceAlias Internal$_ -DHCP Disabled
Remove-NetIPAddress –InterfaceAlias Internal$_ -AddressFamily IPv4 -Confirm:$false
New-NetIPAddress –InterfaceAlias Internal$_ -AddressFamily IPv4 -IPv4Address "192.168.10$_.100" -PrefixLength 24 -Type Unicast
Set-DnsClientServerAddress –InterfaceAlias Internal$_ -ServerAddresses 192.168.101.1
}

Get-NetIPAddress –AddressFamily Ipv4 | FT
 
clip_image012
 

  • Note: The static IPv4 address has to be added twice because you need to add both to the active configuration and to the persistent configuration that is re-applied when you reboot.

3.4.GUI. Using Server Manager

  • In Server Manager, click on “Local Server” on the list on left.
  • In the properties pane on the right, scroll to see the list of Ethernet interfaces (there will be 4 of them)
  • Click on the “Ipv4 address…” link next to one of the interfaces, the “Network Connections” window will show
  • On the list of network connections, right click the Internal1 interface and click “Properties”
  • On the “Internal1 Properties” window, select “Internet Protocol Version 4 (TCP/IPv4)” and click “Properties”.
  • On TCP/IPv4 Properties window, select the option to “Use the following IP address”.
  • Enter the IP address 192.168.101.100 and the subnet mask 255.255.255.0 (as shown below).
  • Select the option “Use the following DNS server address”, enter 192.168.101.1 and click “OK”
  • Repeat this for the Internal2 and Internal3 networks, making sure to use the correct IP address (see table shown in item 3.4) and use the same Preferred DNS server IP address.
  • Close the “Network Connections” and refresh the “Local Server” view.

4. Create the Base VM

4.1. Preparations

  • Create a folder for your ISO files at C:\ISO and a folder for your VMs at C:\VMS
  • Copy the Windows Server 2012 Beta ISO file to C:\ISO

4.2. Create a Base VM

  • Create a new VM that will be used as the base image for our 5 VMs.
  • Store it in the C:\VMS folder and attach the Windows Server 2012 Beta ISO file to it.

4.2.PS. Using PowerShell

MD C:\VMS
New-VHD -Path C:\VMS\BASE.VHDX -Dynamic -SizeBytes 127GB
New-VM -Name Base -VHDPath C:\VMS\BASE.VHDX -SwitchName External -Memory 1GB
Set-VMDvdDrive –VMName Base -Path C:\ISO\WindowsServer8-Beta-64bit-English.iso
Start-VM Base

4.2.GUI. Using Hyper-V Manager

  • In Windows Explorer, create a new C:\VMS folder.
  • In Server Manager, click on “Tools” in the upper left and select “Hyper-V Manager”.
  • In Hyper-V Manager, click on the server name on the pane on the left.
  • On the task pane on the right, click on “New”, then click on “Virtual Machine…”.
  • On the “Before you begin” page, just click “Next”.
  • On the “Specify Name and Location” page, use “Base” for the name, and “C:\VMS” for location. Click “Next”.
     
    clip_image013
     
  • On the “Assign Memory” page, use “1024” MB and click “Next”.
  • On the “Configure Networking” page, use “External”.
  • On the “Connect Virtual Disk” page, select the option to “Create a virtual hard disk”.
  • Use “Base.vhdx” for name, “C:\VMS” for location and “127” GB for size. Click “Next”.
     
    clip_image014
     
  • On the “Installation Options” page, select the option to install from DVD, select the option to use an ISO file and enter the path to the Windows Server 2012 beta ISO file on your C:\ISO folder. Click “Finish”.
     
    clip_image015
     
  • In Hyper-V Manager, right-click the VM and select “Start”

4.3. Install Windows Server 2012 Beta on the VM

  • In Server Manager, click on “Tools” in the upper left and select “Hyper-V Manager”.
  • In Hyper-V Manager, click on the server name on the pane on the left.
  • On the list of VMs, right-click the VM called “Base” and click on “Connect…”
  • Follow the instructions on the screen, as you did in item 2.2.
  • Set a password, but don’t install any roles.
  • Don’t bother renaming the computer, since we’re sysprep’ing the VM anyway.

4.4. Sysprep the VM

  • After you have the OS installed on the VM, sign in and run C:\Windows\System32\Sysprep\Sysprep.exe
  • Select the options to run the OOBE, generalize and shutdown:
     
    image
     
  • After Sysprep completes, the VM will be shut down.

4.5. Remove the base VM

  • Remove the BASE VM, leaving just the BASE.VHDX.
  • You should have a new base VHD ready to use at C:\VMS\BASE.VHD. Its size should be around 9GB.

4.5.PS. Using PowerShell

Remove-VM Base

4.5.GUI. Using Hyper-V Manager

  • In Hyper-V Manager, click on the server name on the pane on the left
  • On the list of VMs, right-click the VM called “Base” and click on “Delete”

5. Configure the 5 VMs

5.1. Create 5 new differencing VHDs using the Base VHD

5.1.PS. Using PowerShell

1..5 | % { New-VHD -ParentPath C:\VMS\BASE.VHDX –Path C:\VMS\VM$_.VHDX }

5.1.GUI. Using Hyper-V Manager

  • In Hyper-V Manager, click on the server name on the pane on the left.
  • On the task pane on the right, click on “New”, then click on “Hard disk…”
  • On the “Before you begin” page, just click “Next”.
  • On the “Choose disk format” page, select “VHDX” and click “Next”.
  • On the “Choose disk type” page, select “Differencing”.
     
    clip_image018
     
  • On the “Specify Name and Location” page, use “VM1.VHDX” for name and “C:\VMS” for location. Click “Next”.
  • On the “Configure disk” page, use “C:\VMS\BASE.VHDX” for the location of the parent VHD.
  • After this, you will have a new differencing VHD at VM1.VHD that’s 4MB in size.
  • Since we’re creating 5 VMS, copy that file into VM2.VHD, VM3.VHD, VM4.VHD and VM5.VHD.
     
    clip_image019
     

5.2. Create 5 similarly configured VMs

  • You should create five VMs as follows:

VM

Role

Computer Name

External

Internal 1

Internal 2

Internal 3

VM1

DNS, DC

DEMO-DC.DEMO.TEST

DHCP

192.168.101.1

N/A

N/A

VM2

iSCSI Target

DEMO-IT.DEMO.TEST

DHCP

192.168.101.2

N/A

N/A

VM3

File Server 1

DEMO-F1.DEMO.TEST

DHCP

192.168.101.3

192.168.102.3

192.168.103.3

VM4

File Server 2

DEMO-F2.DEMO.TEST

DHCP

192.168.101.4

192.168.102.4

192.168.103.4

VM5

SQL Server

DEMO-DB.DEMO.TEST

DHCP

192.168.101.5

192.168.102.5

192.168.103.5

  • Note 1: Each VM will use one of the VHD files we created in the previous step.
  • Note 2: Each VM will use 1GB of memory.

5.2.PS. Using PowerShell

1..5 | % { New-VM -Name VM$_ -VHDPath C:\VMS\VM$_.VHDX -Memory 1GB -SwitchName External}
1..5 | % { Add-VMNetworkAdapter VM$_ –SwitchName Internal1 }
3..5 | % { Add-VMNetworkAdapter VM$_ –SwitchName Internal2 }
3..5 | % { Add-VMNetworkAdapter VM$_ –SwitchName Internal3 }

5.2.GUI. Using Hyper-V Manager

  • In Hyper-V Manager, click on the server name on the pane on the left.
  • On the task pane on the right, click on “New”, then click on “Virtual Machine…”
  • On the “Before you begin” page, just click “Next”.
  • On the “Specify Name and Location” page, use “VM1” for the name, and “C:\VMS” for location. Click “Next”.
  • On the “Assign Memory” page, use “1024” MB and click “Next”.
  • On the “Configure Networking” page, use “External”.
  • On the “Connect Virtual Disk” page, select the option to “Use an existing virtual hard disk”.
  • Use “C:\VMS\VM1.vhdx” for name. Click on “Finish”.
  • In Hyper-V Manager, click on the server name on the pane on the left.
  • On the list of VMs, right-click the VM you just created (VM1) and click on “Settings…”
  • On the “Settings for VM1” window, select “Add Hardware”, then “Network Adapter”.
  • Select the “Internal1” interface and click OK.
  • Repeat the process for VMs 2 to 5.
  • For VMs 3 to 5, make sure to add networks Internal2 and Internal3 as well Internal1.

5.3. Start the 5 VMs

5.3.PS. Using PowerShell

Start-VM VM*

5.3.GUI. Using Hyper-V Manager

  • In Hyper-V Manager, click on the server name on the pane on the left
  • In Hyper-V Manager, multi-select VMs 1 to 5, right click them and click on “Start”

5.4. Complete the mini-setup for the 5 VMs

  • Using Hyper-V manager, multi-select VMs 1 to 5, right click them and click on “Connect…”
  • Let the mini-setup complete, and configure each of the five VMs.
  • You will be prompted for a product key (you can skip that), license agreement, clock/language/region settings and a password.

5.5. Change the computer name for each VM

  • Change the computer name for each VM, using the names defined in item 5.2
  • The examples below are for VM1 (the DNS and Domain Controller).
  • You should repeat this for each of the 5 VMs.
  • At this point, you can also use this opportunity to enable Remote Desktop for each VM.
  • This would be done for each VM as you did for the host in item 2.4, if you want to access the VMs remotely.

5.5.PS. Using PowerShell (for VM1, for instance)

Rename-Computer DEMO-DC -Restart

5.5.GUI. Using Server Manager (for VM1, for instance)

  • In Server Manager, click on “Local Server” on the list on left.
  • Click on the default name next to “Computer Name”.
  • Click on “Change”.
  • Enter the new computer name as “DEMO-DC”.
  • Click “OK” accept the changes.
  • Click “OK” to acknowledge that you need to restart to apply changes.
  • Click “Restart Now”.

5.6. For each VM, configure the networks

  • In this step you will configure the network for each VM as shown on the table in item 5.2
  • We first rename the Network Connections in each guest for easy identification.
  • The External network is identified as being the only one with a DHCP address.
  • The remaining networks are renamed to Internal1, Internal2 and Internal3.
  • For internal networks static IPs are configured, with mask 255.255.255.0 and DNS set to 192.168.101.1.
  • The Internal 1 network will be used for DNS, Active Directory and the iSCSI Target.
  • The External network is useful for downloading from the Internet and remotely connecting to the 5 VMs.
  • You could configure a DHCP server for the internal interfaces.
  • However, due to the risk of accidentally creating a rogue DHCP server in your network, fixed IPs are used.

5.6.PS. Using PowerShell (for VM1, for instance)

## External NIC is the only one with a DHCP server
Get-NetIPAddress -PrefixOrigin “DHCP” | % `
{Rename-NetAdapter -InterfaceAlias $_.InterfaceAlias –NewName External}

## $IC – Internal Count – Number of Internal networks
$IC=0
Get-NetAdapter Wired* | Sort MacAddress | % { `
   $IC++
   Rename-NetAdapter -InterfaceAlias $_.InterfaceAlias –NewName Internal$IC
}

## $VM is the VM Number, between 1 and 5. Used as the last portion of the IP address.
$VM=1
1..$IC | % {
   Set-NetIPInterface –InterfaceAlias Internal$_ -DHCP Disabled
   Remove-NetIPAddress –InterfaceAlias Internal$_ -AddressFamily IPv4 –Confirm:$false
   New-NetIPAddress –InterfaceAlias Internal$_ -AddressFamily IPv4 -IPv4Address "192.168.10$_.$VM" -PrefixLength 24 -Type Unicast 
   Set-DnsClientServerAddress –InterfaceAlias Internal$_ -ServerAddresses 192.168.101.1
}

5.6.GUI. Using Server Manager (For VM1, for instance)

  • This step is similar to step 3.4, but this time performed on the 5 VM.
  • Inside the VM, in Server Manager, click on “Local Server” on the list on left.
  • In the properties pane on the right, Click on the “Ipv4 address…” link next to one of the interfaces.
  • The “Network Connections” window will show.
  • As you did with the Hyper-V host, rename the NIC with the DHCP connection to “External”.
    This NIC needs no further configuration.
  • Rename the remaining NIC to “Internal1”. (Other VMs will also have Internal2 and Internal3).
  • For each internal NIC, right click the Internal1 interface and click “Properties”.
  • On the “Internal1 Properties” window, select “Internet Protocol Version 4 (TCP/IPv4)” and click “Properties”.
  • On TCP/IPv4 Properties window, select the option to “Use the following IP address”.
  • Enter the corresponding IP address (see table on item 5.2) and the subnet mask 255.255.255.0.
  • Select the option “Use the following DNS server address”, enter 192.168.101.1 and click “OK”.
  • Repeat this for the Internal2 and Internal3 networks using the corresponding IP address and the DNS above.
  • Close the “Network Connections” and refresh the “Local Server” view.

 

  • Note: If you can’t tell which Internal network is which inside the VMs with multiple Internal networks, you can temporarily set one of the adapters to “Not Connected” in the VM Settings and verify which one shows as “Network cable unplugged”.

5.7. Review VM name and network configuration

  • After renaming the computer, renaming the network and configuring IP addresses, review the configuration on each VM to make sure you did not miss any step. Examples are shown below for VM1 and VM3.

5.7.PS. Using PowerShell

Get-WmiObject Win32_ComputerSystem
Get-NetAdapter
Get-NetIPAddress -AddressFamily IPv4 -Store Active | Sort IfIndex | FT
 
clip_image020
 
clip_image021
 

5.7.GUI. Using Server Manager

  • In Server Manager, click on “Local Server” on the list on left.
  • Verify the network configuration.

6. Configure DNS and Active Directory

6.1. Install DNS and Active Directory Domain Services

  • Install the required DNS and Active Directory Domain Services roles to VM1 (DEMO-DC)

6.1.PS. Using PowerShell

Install-WindowsFeature DNS, AD-Domain-Services, RSAT-AD-PowerShell, RSAT-ADDS-Tools

6.1.GUI. Using Server Manager

  • In Server Manager, click on “Dashboard” on the list on left.
  • Click on the “Add Roles and Features”, which is option 2 under “Configure this local server”.
  • On the “Before You Begin” page, just click “Next”.
  • On the “Installation Type” page, click “Role-base or feature-based installation” and click “Next”.
  • On the “Server Selection” page, select your server and click “Next”.
  • On the “Server Role” page, select “Active Directory Domain Services”.
  • On the dialog about adding required services, click “Add Features”.
  • On the “Server Role” page, select “DNS Server” and click “Next”.
  • On the dialog about adding required services, click “Add Features”. 
     
    clip_image022
     
  • On the “Feature” page, just click “Next”.
  • On the “Active Directory Domain Services” page, just click “Next”.
  • On the “DNS Server” page, just click “Next”.
  • On the “Confirmation” page, click “Install”.
  • The roles will be installed.

6.2. Configure Active Directory

  • Create a new domain and forest for the DEMO.TEST domain.

6.2.PS. Using PowerShell

Import-Module ADDSDeployment
Install-ADDSForest `
-CreateDNSDelegation:$false `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "Win2008R2" `
-DomainName "DEMO.TEST" `
-DomainNetBIOSName "DEMO" `
-ForestMode "Win2008R2" `
-InstallDNS:$true `
-LogPath "C:\Windows\NTDS" `
-RebootOnCompletion `
-SafeModeAdministratorPassword (Read-Host -AsSecureString -Prompt "Enter Password") `
-SYSVOLPath "C:\Windows\SYSVOL"

6.2.GUI. Using Server Manager

  • Open Server Manager and click on the “AD DS” option on the right.
  • On the yellow band showing “Configuration Required for Active Directory...” click “More…”
  • On the “All Server Task Details”, click on the action to “Promote this server…”
  • The “Active Directory Domain Services Configuration Wizard” will start.
  • On the “Deployment Configuration” page, select “Add a new forest”.
  • Enter “DEMO.TEST” as the root domain name and click “Next”.
  • On the “Domain Controller Option”, enter the password twice and click “Next”.
  • On the “DNS Options” page, click “Next”.
  • On the “Additional Options” page, click “Next”. (NETBIOS name check takes a while)
  • On the “Paths” page, click “Next”.
  • On the “Review Options” page, click “Next”.
  • On the “Pre-requisites” page, click “Next”. (Pre-requisite checks takes a while)
  • Click “Install”.

6.3. Join the other VMs to the domain

  • After the Domain Controller reboots, for every one of the other 4 VMs, join the domain
  • You will need to provide the domain name (DEMO.TEST) and the Administrator credentials
  • From now on, always log on to any of the VMs using the domain credentials: DEMO.TEST\Administrator

6.3.PS. Using PowerShell (for VM2 to VM5)

Add-Computer -DomainName DEMO.TEST -Restart

6.4. Create the SQL Service account

  • In the Domain Controller, use Active Directory Users and Computers to create a new user account for SQL.
  • The account should be called SQLService and should not require change in the next logon.
  • Set a password for the SQLService account.

6.4.PS. Using PowerShell

New-ADUser -Name SQLService –Enabled $True -UserPrincipalName SQLService@DEMO.TEST `
-DisplayName SQLService -ChangePasswordAtLogon $False -PasswordNeverExpires $True `
-AccountPassword (Read-Host -AsSecureString "Enter password")

6.4.GUI. Using Server Manager

  • Open Server Manager
  • In the Tools menu on the upper right, select “Active Directory Users and Computers”
  • Right click the “Users” container on the tree on the left, then select “New”, then “User”
  • Enter “SQLService” as Full Name and User Logon Name, then click “Next”
  • Enter the password twice as required
  • Uncheck “user must change password at next logon” and check “Password never expires”
  • Click “Next”, then click “Finish”

7. Configure iSCSI

  • We’ll create a single Target with 3 Devices (LUNs or VHD files) and used by 2 initiators (DEMO-F1 and DEMO-F2).
  • The devices will include a 1GB VHD for the Cluster Witness volume and two 20GB VHDs for the data volumes.
  • We’ll then configure the initiators and volumes from the File Server side.

7.1. Add the iSCSI Software Target

  • Add the iSCSI Software Target role service to VM2 (DEMO-IT.DEMO.TEST)

7.1.PS. Using PowerShell

Install-WindowsFeature FS-iSCSITarget-Server

7.1.GUI. Using Server Manager

  • In Server Manager, click on “Dashboard” on the list on left
  • Click on the “Add Roles and Features”, which is option 2 under “Configure this local server”
  • On the “Before You Begin” page, just click “Next”
  • On the “Installation Type” page, click “Role-base or feature-based installation” and click “Next”
  • On the “Server Selection” page, expand “File and Storage Services”, then “File Services”
  • Select the “iSCSI Target Server”
  • On the dialog about adding required services, click “Add Features” 
     
    clip_image023
     
  • Click “Next”
  • On the “Feature” page, just click “Next”
  • On the “Confirmation” page, click “Install”
  • The role will be installed

7.2. Create the LUNs and Target

  • Create the 1st LUN with the file at C:\LUN0.VHD, 1GB in size, description “LUN0”.
  • Create the 2nd and 3rd LUNs at C:\LUN1.VHD and C:\LUN2.VHD, both with 20GB.
  • Add those to a single target, exposed to two initiators by IP address (192.168.101.3 and 192.168.101.4)

7.2.PS. Using PowerShell

New-IscsiServerTarget -TargetName FileCluster `
-InitiatorID IPAddress:192.168.101.3, IPAddress:192.168.101.4
New-IscsiVirtualDisk -DevicePath C:\LUN0.VHD -Size 1GB
1..2 | % {New-IscsiVirtualDisk -DevicePath C:\LUN$_.VHD -Size 20GB}
0..2 | % {Add-iSCSIVirtualDiskTargetMapping -TargetName FileCluster -DevicePath C:\LUN$_.VHD}

7.2.GUI. Using Server Manager

  • In Server Manager, click on “File and Storage Services” on the list on left
  • Click on “iSCSI Virtual Disks”
  • On the “Tasks” menu on the right, select “New Virtual Disk…”
  • The “New iSCSI Virtual Disk Wizard” will start
  • On the “Virtual Disk Location” page, with the DEMO-IT server and “C:” volume selected, click “Next”
  • On the “Virtual Disk Name” page, enter “LUN0” as the Name, then click “Next”
  • On the “Virtual Disk Size” page, enter 1GB as the size, then click “Next”
  • On the “iSCSI Target” page, with the “New iSCSI target” option selected, click “Next”
  • On the “iSCSI Target Name” page, enter “FileCluster” as the name, then click “Next”
  • On the “Access Servers” page, click on “Add…”
  • Select “Enter a value...”, select “IP Address”, enter “192.168.101.3”, then click “OK”
  • On the “Access Servers” page, click on “Add…” again
  • Select “Enter a value...”, select “IP Address”, enter “192.168.101.4”, then click “OK”
  • With the two iSCSI Initiators specified, click “Next”
  • On the “Enable Authentication” page, click “Next”
  • On the “Confirmation” page, click “Create”
  • When the wizard is done, click “Close”.
  • On the “Tasks” menu on the right, select “New Virtual Disk…”
  • The “New iSCSI Virtual Disk Wizard” will start
  • On the “Virtual Disk Location” page, with the DEMO-IT server and “C:” volume selected, click “Next”
  • On the “Virtual Disk Name” page, enter “LUN1” as the Name, then click “Next”
  • On the “Virtual Disk Size” page, enter 20GB as the size, then click “Next”
  • On the “iSCSI Target” page, with the “Select Existing iSCSI target” option selected, click “Next”
  • On the “Confirmation” page, click “Create”
  • When the wizard is done, click “Close”.
  • Repeat the steps above to create a LUN2 with 20GB and add to the same target.

7.3. Configure the iSCSI Initiators

  • Now we shift to the two File Servers, which will run the iSCSI Initiator.
  • We’ll do this on VM3 and VM4 (or DEMO-F1 and DEMO-F2).
  • Make sure to log on using the domain administrator (DEMO\Administrator), not the local Administrator.
  • You will then start the iSCSI Initiator, configuring the service to start automatically.
  • You will then connect the initiator to the iSCSI Target we just configured on DEMO-IT

7.3.PS. Using PowerShell

Set-Service MSiSCSI -StartupType automatic
Start-Service MSiSCSI
New-iSCSITargetPortal -TargetPortalAddress 192.168.101.2
Get-iSCSITarget | Connect-iSCSITarget
Get-iSCSISession | Register-iSCSISession

7.3.GUI. Using Server Manager

  • Open Server Manager
  • In the Tools menu on the upper right, select “iSCSI Initator”
  • Click on “Yes” on the prompt about automatically starting the iSCSI Initiator.
  • Enter “192.168.101.2” on the Target field and click the “Quick Connect…” button next to it.
  • Verify the status shows as “Connect” and click on “Done”
  • Click on the “Volume and Devices” tab and click on the “Auto Configure” button.
  • Verify that three volumes show up on the Volume List.
  • Click “OK” to close the iSCSI Initiator.

7.4. Configure the disks

  • In only one of the two file server nodes, configure the three disks (the iSCSI LUNs).
  • They first need to be onlined, initialized and partitioned (we’re using MBR partitions, since the disks are small).
  • Then you will format them and assign each one a driver letter (W:, X: and Y:).
  • Drive W: will be the used as witness disks, while X: and Y: will be data disks for the file server cluster.

7.4.PS. Using PowerShell

1..3 | % {
$d = “-WXY”[$_]
Set-Disk -Number $_ -IsReadOnly 0
Set-Disk -Number $_ -IsOffline 0
Initialize-Disk -Number $_ -PartitionStyle MBR
New-Partition -DiskNumber $_ -DriveLetter $d –UseMaximumSize
Initialize-Volume -DriveLetter $d -FileSystem NTFS -Confirm:$false
}

7.4.GUI. Using Server Manager

  • Open the Disk Management tool
  • Online all three offline disks (the iSCSI LUNs)
  • Initialize them (you can use MBR partitions, since they are small)
  • Create a new Simple Volume on each one using all the disk space on the LUN
  • Quick-format them with NTFS as the file system
  • Assign each one a drive letter (W:, X: and Y:)

8. Configure the File Server

8.1 Install the required roles and features

  • Now we need to configure VM3 and VM4 as file servers and cluster nodes

8.1.PS. Using PowerShell (From both VM3 and VM4)

Install-WindowsFeature File-Services, FS-FileServer, Failover-Clustering
Install-WindowsFeature RSAT-Clustering -IncludeAllSubFeature
Install-WindowsFeature RSAT-File-Services -IncludeAllSubFeature

8.1.GUI. Using Server Manager

  • For both DEMO-F1 and DEMO-F2, from Server Manager, select Add Role and check File and Storage Services.
  • Next, select Add Feature and check Failover Clustering

8.2. Validate the Failover Cluster Configuration

8.2.PS. Using PowerShell (From VM3, DEMO-F1)

Test-Cluster -Node DEMO-F1, DEMO-F2

8.2.GUI. Using Server Manager

  • On VM3 (DEMO-F1), open Server Manager.
  • On the Tools menu on the upper right, select “Failover Cluster Manager”
  • In Failover Cluster Manager and click on the option to “Validate a Configuration…”
  • The “Validate a Configuration Wizard” will start. Click “Next”
  • Add the two file servers: DEMO-F1 and DEMO-F2. Then click “Next”
  • Select the option to “Run all tests”. Click “Next”. Click “Next” again to confirm.
  • Let the validation process run. It will take a few minutes to complete.
  • Validation should not return any errors.
  • If it does, review the previous steps and make sure to address any issues listed in the validation report.

8.3. Create a Failover Cluster

8.3.PS. Using PowerShell (From VM3, DEMO-F1)

New-Cluster –Name DEMO-FC -Node DEMO-F1, DEMO-F2

8.3.GUI. Using Server Manager

  • On VM3 (DEMO-F1), open Server Manager.
  • On the Tools menu on the upper right, select “Failover Cluster Manager”
  • In Failover Cluster Manager and click on the option to “Create a Cluster…”
  • The “Create a Cluster Wizard” will start. Click “Next”
  • Add the two file servers: DEMO-F1 and DEMO-F2. Then click “Next”
  • Enter the Cluster Name: DEMO-FC. Then click “Next”
  • Click “Next” again to confirm.
  • Click “Finish” after the cluster is created.

8.4. Configure the Cluster Networks

  • For consistency, you should rename the Cluster networks to match the names used previously.
  • You should also configure the Internal networks to be used by cluster, but not the External one.

8.4.PS. Using PowerShell (From VM3, DEMO-F1)

(Get-ClusterNetwork | ? Address -like 192.168.101.* ).Name = "Internal1"
(Get-ClusterNetwork | ? Address -like 192.168.102.* ).Name = "Internal2”
(Get-ClusterNetwork | ? Address -like 192.168.103.* ).Name = "Internal3”
(Get-ClusterNetwork | ? Name -notlike Internal* ).Name = "External"
(Get-ClusterNetwork Internal1).Role = 3
(Get-ClusterNetwork Internal2).Role = 3
(Get-ClusterNetwork Internal3).Role = 3
(Get-ClusterNetwork External).Role = 1

8.4.GUI. Using Server Manager

  • In Failover Cluster Manager, expand the nodes until you find the “Networks” node.
  • For each network, right-click the name and click “Properties”.
  • Enter the name Internal1, Internal2, Internal3 or External, according to their IP addresses.
  • For the External network, make sure “Allow cluster…” is selected and “Allow clients…” is *not* checked.
  • For all Internal networks, select “Allow cluster…” and check the “Allow clients…” checkbox.

8.5. Add data disks to Cluster Shared Volumes (CSV)

  • Add the disks to the list of Cluster Shared Volumes.

8.5.PS. Using PowerShell (From VM3, DEMO-F1)

Get-ClusterResource | ? OwnerGroup -like Available* | Add-ClusterSharedVolume

8.5.GUI. Using Server Manager

  • In Failover Cluster Manager, expand the nodes until you find the “Storage” node.
  • Select the two disks currently assigned to “Available Storage”.
  • Right click the two selected disks and click on “Add to Cluster Shared Volumes”

8.6. Create the Scale-Out File Server

  • Create a Scale-Out File Server.

8.6.PS. Using PowerShell (From VM3, DEMO-F1)

Add-ClusterScaleOutFileServerRole -Name DEMO-FS

8.6.GUI. Using Server Manager

  • On the Failover Cluster Manager, select the main node on the tree (with the cluster name)
  • On the actions menu on the right, select “Configure Role…”
  • The “High Availability Wizard” will start. Click “Next”
  • On the “Select Role” page, select “File Server” and click “Next”
  • On the “File Server Type” page, select “File Server for scale-out application data” and click “Next”
  • On the “Client Access Point” page, specify the name of the service as DEMO-FS
  • On the “Confirmation” page, click “Next”.
  • Click “Finish” after the configuration is completed.

8.7. Create the folders and shares

  • In this step, you will create two shares: one for database files and one for log files

8.7.PS. Using PowerShell (From VM3, DEMO-F1)

MD C:\ClusterStorage\Volume1\DATA
ICACLS.EXE C:\ClusterStorage\Volume1\DATA --% /grant DEMO.TEST\Administrator:(CI)(OI)F
ICACLS.EXE C:\ClusterStorage\Volume1\DATA --% /grant DEMO.TEST\SQLService:(CI)(OI)F

MD C:\ClusterStorage\Volume2\LOG
ICACLS.EXE C:\ClusterStorage\Volume2\LOG --% /grant DEMO.TEST\Administrator:(CI)(OI)F
ICACLS.EXE C:\ClusterStorage\Volume2\LOG --% /grant DEMO.TEST\SQLService:(CI)(OI)F

New-SmbShare -Name DATA -Path C:\ClusterStorage\Volume1\DATA `
-FullAccess DEMO.TEST\Administrator, DEMO.TEST\SQLService

New-SmbShare -Name LOG -Path C:\ClusterStorage\Volume2\LOG `
-FullAccess DEMO.TEST\Administrator, DEMO.TEST\SQLService

8.7.GUI. Using Server Manager

  • On the Failover Cluster Manager, select the Roles node on the tree on the left.
  • Click on the DEMO-FS role and then click on “Add Shared Folder” on the actions menu on the right.
  • The “New Share Wizard” will start.
  • On the “Select Profile” page, select “SMB Share – Server Application” and click “Next”
  • On the “Share Location” page, select “C:\ClusterStorage\Volume1” as the location. Click “Next”.
  • On the “Share Name” page, enter “Data” as the share name, click “Next”.
  • On the “Other Settings” page, just click “Next”
  • On the “Permissions” page, click on “Customize permissions…”
  • Click on “Add”, then click on “Select a Principal”.
  • Enter “DEMO\Administrator”, click on “Check Names” and then click “OK”.
  • Click “Full Control” and click “OK”.
  • Click on “Add”, then click on “Select a Principal”.
  • Enter “DEMO\SQLService”, click on “Check Names” and then click “OK”.
  • Click “Full Control” and click “OK”.
  • Click “OK”, then click on “Next”, then click on “Create”
  • Click on “Close” after the wizard finishes creating the share.
  • Repeat the process for a share called “LOG” on Volume2.

9. Configure the SQL Server

9.1. Mount the SQL Serve ISO file

  • Copy the SQL Server 2012 ISO file to the C:\ISO folder.
  • Mount that in the DVD for VM5, DEMO-DB.

9.1.PS. Using PowerShell

Set-VMDvdDrive –VMName VM5 -Path C:\ISO\SQLFULL_ENU.iso

9.1.GUI. Using Hyper-V Manager

  • In Server Manager, click on “Tools” in the upper left and select “Hyper-V Manager”
  • In Hyper-V Manager, click on the server name on the pane on the left
  • Right-click VM5 and click on “Connect…”
  • In the “Media” menu, select “DVD Drive” and then “Insert Disk…”
  • Point to the SQL Server 2012 ISO file under the C:\ISO folder.

9.2. Run SQL Server Setup

  • From VM5 (DEMO-DB), run SQL Server 2012 setup from the DVD.
  • In the “SQL Server Installation Center”, click on “Installation”, then select “New SQL Server stand-alone…”
  • Let it verify the SQL Server Setup Support Rules pass and click “OK”
  • Select “Evaluation” under “Specify a free edition” and click “Next”
  • Review the licensing terms and click “Next”
  • “SQL Server 2012 Setup” will start. Let it verify Setup Support Rules pass and click “Next”.
  • In the “Setup Role” page, select “SQL Server Feature Installation” and click “Next”.
  • In the “Feature selection” page, select only the “Database Engine Services” and the “Management Tools”.
  • Use the default directories. Click “Next”.
  • In the “Installation Rules” page, click “Next”.
  • In the “Instance Configuration” page, click “Next”
  • In the “Disk Space Requirements” page, click “Next”.
  • In the “Server Configuration” page, enter “DEMO.TEST\SQLService” as the account name for the SQL Server Database Engine and the SQL Server Agent, set them both to start automatically. Click “Next”
     
    clip_image024
     
  • In the “Database Engine Configuration” page, click on “Add Current User”.
  • Click on the “Data Directories” tab. Enter “\\DEMO-FS\DATA” as the “Data Root Directory”.
  • Fix the two path for Log directories to use “\\DEMO-FS\LOG” instead of the data folder.
     
    clip_image025
     
  • You will be prompted to confirm the right permissions are assigned on the share. Click “Yes”.
     
    clip_image026
     
  • On the “Error reporting” page, click “Next”
  • On the “Installation Configuration Rules” page, click “Next”
  • On the “Ready to Install” page, click “Install”
  • The installation will complete.

9.3. Create a database using the clustered file share

  • On the SQL Server VM, open SQL Server Management Studio.
  • On the “Connect to Server” window, accept the default server name and authentication. Click “Connect”.
  • Right click the main node, select Properties and click on the “Database Settings”.
  • Verify that that the “Database default locations” point to the file shares entered earlier.
     
    clip_image027
     
  • Click “OK” to close the “Server Properties”.
  • Expand the tree on the left to find the Databases node.
  • Right-click “Databases” and select “New Database…”
  • Enter “Orders” as the database name and note the path pointing to the clustered file share.
  • Scroll the bar to the right to see the Path column:
     
    clip_image028
     
  • Click “OK” to create the database.

10. Verify SMB features

10.1. Verify that SMB Multichannel is working

  • Use PowerShell to verify that SMB is indeed using multiple interfaces.

10.1.PS. Using PowerShell (from VM5, DEMO-DB)

Get-SmbConnection
Get-SmbMultichannelConnection
 
clip_image029

10.2. Query the SMB Sessions and Open Files

  • Use PowerShell to verify sessions and open files.

10.2.PS. Using PowerShell (from VM3, DEMO-F1 or VM4, DEMO-F2)

Get-SmbSession
Get-SmbOpenFile | Sort Path
Get-SmbOpenFile | Sort Path | FT Path
 
clip_image030
 

10.3. Transparently move SQL Client between file server nodes

  • Use SMB Transparent Failover and Witness to move the SMB Client (SQL Server) between the two File Server cluster nodes.

10.3.PS. Using PowerShell (from VM3, DEMO-F1 or VM4, DEMO-F2)

Get-SmbWitnessClient | FT ClientName, NetworkName, FileServerNodeName
Move-SmbWitnessClient -ClientName DEMO-DB -DestinationNode DEMO-F1
Get-SmbWitnessClient | FT ClientName, NetworkName, FileServerNodeName
 
clip_image031

10.4. Survive the loss of a client NIC

  • Observe that SMB Multichannel will protect the SQL Server from the failure of a NIC.

10.4.PS. Using PowerShell (from VM5, DEMO-DB)

Get-SmbMultichannelConnection
Disable-NetAdapter -InterfaceAlias Internal3 –Confirm:$false ; Start-Sleep 20

Get-SmbMultichannelConnection

Enable-NetAdapter -InterfaceAlias Internal3 ; Start-Sleep 20
Get-SmbMultichannelConnection
 
clip_image032[4]

11. Shut down, startup and install final notes

  • Keep in mind that there are dependencies between the services running on each VM.
  • To shut them down, start with VM5 and end with VM1, waiting for each one to go down completely before moving to the next one.
  • To bring the VMs up, go from VM1 to VM5, waiting for the previous one to be fully up (with low to no CPU usage) before starting the next one.
  • You might want to also take a snapshot of the VMs after you shut them down, just in case you want to bring them back to the original state after experimenting with them for a while.
  • If you do, you should always snapshot all of them, again due to dependencies between them. Just right-click the VM and select the “Snapshot” option.
  • As a last note, the total size of the VHD files (base plus 5 diffs), after all the steps were performed, was around 19 GB.
     
    clip_image033

12. Conclusion

I hope you enjoyed these step-by-step instructions. I strongly encourage you to try them out and perform the entire installation yourself. It’s a good learning experience.

Windows Server 2012 Beta – Hyper-V over SMB – Quick Provisioning a VM on an SMB File Share

$
0
0

One of the preferred methods for creating VMs in a shared environment is to have one or more base VHDs that you use as a template for new VMs. While having a base VHD is a constant, there are a few different methods to choose when you implement your provisioning process for new VMs. This post looks at the provisioning options available when using SMB file shares as shared storage for your VMs.

 

Option 1 – Differential VHD

You can easily provision new VMs using differential VHD, which creates a second VHD file that contains the difference between your new VM and the base. Creating a differential VHD is practically instantaneous. However, the base needs to remain unchanged during the lifetime of the differential VHDs. If you need to apply a change to the base, you essentially need to create a new version of it and you need to keep the previous one around for as long as there are differentials based on it. You could end up with several generations of base VHDs. This might be a great choice if you don’t keep your VMs around for a long time.

Here’s how you would do it:

New-VHD -Path \\FS\VMSHARE\VM7.VHDX -ParentPath \\FS\VMSHARE\BASE.VHDX
New-VM VM7 -Path \\FS\VMSHARE\VM7 -VHDPath \\FS\VMSHARE\VM7.VHDX -Memory 1GB
Start-VM VM7

 

Option 2 – Copy the base VHD

Another approach is to simply create a copy of the base VHD and use that copy as the VHD for your new VM. This will give you a completely separate VHD for every new VM, independent of the base VHD. However, this option will typically use more disk space and take longer to complete, since most base VHD files are a few gigabytes in size. The delay in the provisioning of a VM, while acceptable in some scenarios, might be a nuisance for your users, especially if you are using a self-service portal for provisioning. If you use this approach, though, you can change the base VHD at any time, without having to worry about dependencies by previously created VMs. This could be a great choice if your base changes frequently and your VMs will live for a long time. This is also a good choice if your system can leverage the new ODX (offloaded data transfers) capability, which will greatly accelerate the copy process.

Here’s how you would do it:

Copy-Item \\FS\VMSHARE\BASE.VHDX \\FS\VMSHARE\VM8.VHDX
New-VM VM8 -Path \\FS\VMSHARE\VM8 -VHDPath \\FS\VMSHARE\VM8.VHDX -Memory 1GB
Start-VM VM8

 

Option 3 – A little bit of both

In Windows Server “8” Beta, due to the ability to perform online VHDs merges and re-parent VHDs, there is a third way to do this. It essentially involves creating a snapshot before you start the VM, copying the base VHD while the VM is already running and then merging the snapshot with its own copy of the base. The end result gives you a quick provisioning process, where the VM starts almost immediately, but it become completely independent of the base VHD just a few minutes later. The down side of this solution is that the provisioning process gets a bit more complex, and you will have some extra work to do in the first few minutes of the VM lifecycle. Here are the details on how to do it…

 

Step 1 – Create the VM using the base

Start with a file share that contains the base VHD you want to use. Create a new VM using the base VHD. The base is a read-only file, so don’t start the VM just yet!

Dir \\FS\VMSHARE\
New-VM VM9 -Path \\FS\VMSHARE\VM9 -VHDPath \\FS\VMSHARE\BASE.VHDX | FL Name, State
Get-VMHardDiskDrive VM9 | Get-VHD | FL Path, VhdType, ParentPath

 

Step 2 – Snapshot and start

Create a temporary snapshot of the VHD file. Verify it succeeded. Now you can start the VM and hand it over to the end user, just a few seconds into the process.

Checkpoint-VM VM9
Dir
\\FS\VMSHARE\
Get-VMHardDiskDrive VM9 | Get-VHD | FL Path, VhdType, ParentPath
Start-VM VM9

 

Step 3 – Copy the base

Now make a copy of the read-only base VHD into a unique instance for the VM. That might take a while, but that’s OK. The user is already happily using the VM. You can use whatever tool you want to copy the file. This could also leverage ODX (offloaded data transfers) if available on that system.

Copy-Item \\FS\VMSHARE\BASE.VHDX \\FS\VMSHARE\VM9.VHDX
Dir \\FS\VMSHARE\

 

Step 4 – Re-parent to the copy

After the copy is done, you can “re-parent” your snapshot while your VM is running. This is new in this release. After this operation, the VM is no longer using the original base VHD.

Get-VMHardDiskDrive VM9 | Set-VHD -ParentPath \\FS\VMSHARE\VM9.VHDX
Get-VMHardDiskDrive VM9 | Get-VHD | FL Path, VhdType, ParentPath

 

Step 5 – Merge the snapshot

The last step is to remove the temporary snapshot, which will merge it into the VHD you created for this unique VM instance. Note that this operation is also done while the VM is running, which is also new in this release.

Remove-VMSnapshot VM9
Get-VMHardDiskDrive VM9 | Get-VHD | FL Path, VhdType, ParentPath
Dir
\\FS\VMSHARE\
Get-VM VM9 | FL Name, State, Uptime

 

Reviewing the output of the entire set of commands

 

PS C:\> Dir \\FS\VMSHARE\
 
    Directory:
\\FS\VMSHARE
 
Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---         3/14/2012   7:53 PM 8996782080 BASE.VHDX
 
PS C:\> New-VM VM9 -Path \\FS\VMSHARE\VM9 -VHDPath \\FS\VMSHARE\BASE.VHDX | FL Name, State
 
Name             : VM9
State            : Off
 
PS C:\> Get-VMHardDiskDrive VM9 | Get-VHD | FL Path, VhdType, ParentPath
 
Path                    :
\\FS\VMSHARE\BASE.VHDX
VhdType                 : Dynamic
ParentPath              :
 
PS C:\> Checkpoint-VM VM9
PS C:\> Dir \\FS\VMSHARE\
 
    Directory: \\FS\VMSHARE
 
Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         3/14/2012   7:54 PM            VM9
-a---         3/14/2012   7:55 PM 8996782080 BASE.VHDX
-a---         3/14/2012   7:55 PM    4194304 BASE_2691830B-9046-4818-930E-D7D7C41A7028.avhdx
 
PS C:\> Get-VMHardDiskDrive VM9 | Get-VHD | FL Path, VhdType, ParentPath
 
Path                    : \\FS\VMSHARE\BASE_2691830B-9046-4818-930E-D7D7C41A7028.avhdx
VhdType                 : Differencing
ParentPath              : \\FS\VMSHARE\BASE.VHDX
 
PS C:\> Start-VM VM9
PS C:\> Copy-Item \\FS\VMSHARE\BASE.VHDX \\FS\VMSHARE\VM9.VHDX
PS C:\> Dir \\FS\VMSHARE\
 
    Directory: \\FS\VMSHARE
 
Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         3/14/2012   7:54 PM            VM9
-a---         3/14/2012   7:55 PM 8996782080 BASE.VHDX
-a---         3/14/2012   7:57 PM  205520896 BASE_2691830B-9046-4818-930E-D7D7C41A7028.avhdx
-a---         3/14/2012   7:57 PM 8996782080 VM9.VHDX
 
PS C:\> Get-VMHardDiskDrive VM9 | Set-VHD -ParentPath \\FS\VMSHARE\VM9.VHDX
PS C:\> Get-VMHardDiskDrive VM9 | Get-VHD | FL Path, VhdType, ParentPath
 
Path                    : \\FS\VMSHARE\BASE_2691830B-9046-4818-930E-D7D7C41A7028.avhdx
VhdType                 : Differencing
ParentPath              : \\FS\VMSHARE\VM9.VHDX
 
PS C:\> Remove-VMSnapshot VM9
PS C:\> Get-VMHardDiskDrive VM9 | Get-VHD | FL Path, VhdType, ParentPath
 
Path                    :
\\FS\VMSHARE\VM9.VHDX
VhdType                 : Dynamic
ParentPath              :
 
PS C:\> Dir \\FS\VMSHARE\
 
    Directory:
\\FS\VMSHARE
 
Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         3/14/2012   7:54 PM            VM9
-a---         3/14/2012   7:55 PM 8996782080 BASE.VHDX
-a---         3/14/2012   7:57 PM 8996782080 VM9.VHDX
 
PS C:\> Get-VM VM9 | FL Name, State, Uptime
 
Name             : VM9
State            : Running
Uptime           : 00:01:45
 
PS C:\>

 

Conclusion

As you see, the VM was running since Step 2, seconds into the whole process. It took us a few minutes to copy the base and merge the snapshot, but the end user was happily using the VM after just a few seconds into the process.

Analyzing Storage Performance using the Windows Performance Analysis ToolKit (WPT)

$
0
0

Robert Smith (Platforms Field Engineer) has recently posted a new blog that cover one important area of Windows performance that few people understand well. In his blog post he talks about how to use Windows Performance Toolkit (WPT) in general and the XPerf tool in particular. Xperf.exe is the command line tool used to start, stop, and manage traces.  He then goes on to outline how to use the toolkit to look into Storage and know where to start looking when you hit a performance issue.

Here's the outline of his post:

  • Introduction
    • Obtaining the WPT Tools
    • More About the WPT
  • Getting Started: Capturing Storage Performance Data
    • Scenarios
    • Considerations for Starting a Trace
    • Stopping a Trace
  • Trace Analysis
    • How to perform Trace Analysis
    • What to Look For
  • What are We Doing Here?
    • High Disk Service Times
    • Storport Tracing (For Storport storage devices)
    • High IO Times
  • Conclusion

If you're interested in Performance (and specially Storage Performance) and you never used the WPT or XPerf.exe before, this is a must read.

Full post at http://blogs.technet.com/b/robertsmith/archive/2012/02/07/analyzing-storage-performance-using-the-windows-performance-toolkit.aspx


Preliminary performance results with Windows Server 2012 Beta and SMB Direct (SMB over RDMA)

$
0
0

If you’re reading up on Windows Server 2012, you probably saw that using file storage for your Hyper-V and SQL Server data is one of our key new scenarios. You can read more about this in the TechNet article called “High-Performance, Continuously Available File Share Storage for Server Applications” at http://technet.microsoft.com/en-us/library/hh831399.aspx. We have already shared some preliminary data on the improved performance of the Windows Server 2012 file server and this post provides an update on those numbers.

 

Windows Server 2012 Developer Preview - September 2011

Back in September of 2011, we released a white paper providing a preliminary analysis of the performance of Windows Server 2012 SMB with four 10GbE adapters. This paper focused on the SMB Multichannel feature using the Windows Developer Preview. You can find it at http://msdn.microsoft.com/en-us/library/windows/hardware/hh457617. This paper shows the use of four 10GbE adapters combined via SMB Multichannel to achieve a maximum throughput of 4300 MB/sec and over 300,000 1KB IOPs.

At that time, we also shared performance data as part of the multiple presentations at the //build conference and SNIA’s Storage Developers Conference (SDC 2011). You can find details on those presentations at http://blogs.technet.com/b/josebda/archive/2011/11/27/links-to-build-sessions-on-storage-networking-and-hyper-v.aspx and http://blogs.technet.com/b/josebda/archive/2011/12/16/snia-s-storage-developer-conference-sdc-2011-content-slides-and-videos-now-available-for-download-including-smb-2-2-details.aspx. The SDC presentation on SMB Direct included details like delivering 160,000 1KB IOPs using a Mellanox ConnectX-2 QDR InfiniBand card.

 

Windows Server 2012 Beta – February 2012

Details on the Windows Server 2012 Beta release and its new SMB capabilities were recently posted on the Windows Server blog at http://blogs.technet.com/b/windowsserver/archive/2012/03/15/windows-server-8-taking-server-application-storage-to-windows-file-shares.aspx.

With that, many partners and customers have been asking us about the performance for File Servers and the new SMB with this new pre-release version, especially with SMB Direct. The team is hard at work testing and producing additional white papers, but we don’t have any documents planned for release this month.

In the meantime, since I’m delivering a presentation at SNW Spring and sharing some new numbers, I thought of using this blog post to share some limited performance results for a specific configuration, so we can show some of the progress we made since last September.

 

Windows Server 2012 Beta results – SMB Direct IOPs, bandwidth and latency

These results come from a couple of servers that play the role of SMB Server and SMB client. The client in this case was a typical server-class computers using an Intel Westmere motherboard with two Intel Xeon L5630 processors (2 sockets, 4 cores each, 2.10 GHz). For networking, it was equipped with a single RDMA-capable Mellanox ConnectX-2 QDR InfiniBand card sitting on a PCIe Gen2 x8 slot. For these tests, the IOs went all the way to persistent storage (using 14 SSDs). We tested three IO sizes: 512KB, 8KB and 1KB, all reads.

 

Workload

IO Size

IOPS

Bandwidth

Latency

Large IOs, high throughput (SQL Server DW)

512 KB

4,210

2.21GB/s

4.41ms

Small IOs, typical application server (SQL Server OLTP)

8 KB

214,000

1.75GB/s

870µs

Very small IOs (high IOPs)

1 KB

294,000

0.30GB/s

305µs

 

Here are some snapshots of the performance counters for the SMB client computer while the tests were running:

clip_image001

clip_image002

clip_image003

While doing large IOs (512KB, typical in data warehousing workloads), you can see good throughput with low latency. You can also see a healthy number of 8 KB IOs (common in several workloads, including online transaction processing) with even lower latency. The third line uses 1KB reads which is not a typical workload,  but is commonly used to showcase high IOPs.

Please keep in mind that the results above use a single network interface. Using SMB Multichannel, we can use several interfaces at once to achieve better results, as we did in the white paper that covered four non-RDMA 10GbE cards, mentioned at the beginning of this post.

Note that the latency value on the table maps to the “Average seconds per data request” performance counter shown in the screenshots. This essentially measures the time it takes to fulfill the IO from the SMB client perspective, including the round trip time to the SMB server and the time it takes to complete the IO to disk on the SMB server side.

 

Even better results on the horizon

The SMB team is still working on performance tuning the software, so the work is not quite done yet. The performance team is also hard at work using the latest generation of motherboards and CPUs. For instance, we just got a hold of new PCIe Gen 3 cards for both storage and networking, including the latest InfiniBand cards that can transfer 54Gbps. They are looking into results for systems using multiple RDMA cards at once with SMB Multichannel. We’re not quite ready to release the results of those tests yet, but the numbers are better :-)

 


P.S.: Even better results became available after this post. Read more at http://blogs.technet.com/b/josebda/archive/2012/05/06/windows-server-2012-beta-with-smb-3-0-demo-at-interop-shows-smb-direct-at-5-8-gbytes-sec-over-mellanox-connectx-3-network-adapters.aspx

 

Windows Server 2012: Which version of the SMB protocol (SMB 1.0, SMB 2.0, SMB 2.1 or SMB 3.0) you are using on your File Server?

$
0
0

1. Introduction

With the upcoming release of SMB 3.0 as part of Windows 8 and Windows Server 2012, I am frequently asked about how older versions of Windows will behave when connecting to or from these new versions. Upgrading to a new version of SMB is something that happened a few times over the years and we established a process in the protocol itself by which clients and servers negotiate the highest version that both support.

 

2. Versions

There are several different versions of SMB used by Windows operating systems:

  • CIFS – The ancient version of SMB that was part of Microsoft Windows NT 4.0 in 1996. SMB1 supersedes this version.
  • SMB 1.0 (or SMB1) – The version used in Windows 2000, Windows XP, Windows Server 2003 and Windows Server 2003 R2
  • SMB 2.0 (or SMB2) – The version used in Windows Vista (SP1 or later) and Windows Server 2008
  • SMB 2.1 (or SMB2.1) – The version used in Windows 7 and Windows Server 2008 R2
  • SMB 3.0 (or SMB3) – The version used in Windows 8 and Windows Server 2012

Windows NT is no longer supported, so CIFS is definitely out. Windows Server 2003 R2 with a current service pack is under Extended Support until 2015, so SMB1 is still around for a little while. SMB 2.x in Windows Server 2008 and Windows Server 2008 R2 will be around at least until 2018, when Extended Support for those products is scheduled to expire. You can find the most current information on the support lifecycle page for Windows Server. The information is subject to the Microsoft Policy Disclaimer and Change Notice.  You can use the support pages to also find support policy information for Windows XP, Windows Vista and Windows 7.

 

3. Negotiated Versions

Here’s a table to help you understand what version you will end up using, depending on what Windows version is running as the SMB client and what version of Windows is running as the SMB server:

Client / Server OS Windows 8
Windows Server 2012
Windows 7
Windows Server 2008 R2
Windows Vista
Windows Server 2008
Previous versions
of Windows
Windows 8
Windows Server 2012
SMB 3.0 SMB 2.1 SMB 2.0 SMB 1.0
Windows 7
Windows Server 2008 R2
SMB 2.1 SMB 2.1 SMB 2.0 SMB 1.0
Windows Vista
Windows Server 2008
SMB 2.0 SMB 2.0 SMB 2.0 SMB 1.0
Previous versions
of Windows
SMB 1.0 SMB 1.0 SMB 1.0 SMB 1.0

 

 

4. Using PowerShell to check the SMB version

In Windows 8 or Windows Server 2012, there is a new PowerShell cmdlet that can easily tell you what version of SMB the client has negotiated with the File Server. You simply access a remote file server (or create a new mapping to it) and use Get-SmbConnection. Here’s an example:
 

PS C:\> Get-SmbConnection
ServerName   ShareName  UserName            Credential          Dialect   NumOpens
----------   ---------  --------            ----------          -------   --------
FileServer1  IPC$       DomainName\UserN... DomainName.Testi... 3.00      0
FileServer1  FileShare  DomainName\UserN... DomainName.Testi... 3.00      14
DomainCtrl1  netlogon   DomainName\Compu... DomainName.Testi... 2.10      1

 
In the example above, a server called “FileServer1” was able to negotiate up to version 3.0. That means that both the client and the server support the latest version of the SMB protocol. You can also see that another server called “DomainCtrl1” was only able to negotiate up to version 2.1. You can probably guess that it’s a domain controller running Windows Server 2008 R2.

If you just want to find the version of SMB running on your own computer, you can use a loopback share combined with the Get-SmbConnection cmdlet. Here’s an example:
 

PS C:\> dir \\localhost\c$
 
Directory:
\\localhost\c$
 
Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         5/19/2012   1:54 AM            PerfLogs
d-r--          6/1/2012  11:58 PM            Program Files
d-r--          6/1/2012  11:58 PM            Program Files (x86)
d-r--         5/24/2012   3:56 PM            Users
d----          6/5/2012   3:00 PM            Windows

PS C:\> Get-SmbConnection -ServerName localhost

ServerName  ShareName  UserName            Credential          Dialect  NumOpens
----------  ---------  --------            ----------          -------  --------
localhost   c$         DomainName\UserN... DomainName.Testi... 3.00     0

 
Please note that you have about 10 seconds after you issue the “dir” command to run the “Get-SmbConnection” cmdlet. The SMB client will tear down the connections if there is no activity between the client and the server. It might help to know that you can use the alias “gsmbc” instead of the full cmdlet name.

 

5. Features and Capabilities

Here’s a very short summary of what changed with each version of SMB:

  • From SMB 1.0 to SMB 2.0 - The first major redesign of SMB
    • Increased file sharing scalability
    • Improved performance
      • Request compounding
      • Asynchronous operations
      • Larger reads/writes
    • More secure and robust
      • Small command set
      • Signing now uses HMAC SHA-256 instead of MD5
      • SMB2 durability
  • From SMB 2.0 to SMB 2.1
    • File leasing improvements
    • Large MTU support
    • BranchCache
  • From SMB 2.1 to SMB 3.0
    • Availability
      • SMB Transparent Failover
      • SMB Witness
      • SMB Multichannel
    • Performance
      • SMB Scale-Out
      • SMB Direct (SMB 3.0 over RDMA)
      • SMB Multichannel
      • Directory Leasing
      • BrachCache V2
    • Backup
      • VSS for Remote File Shares
    • Security
      • SMB Encryption using AES-CCM (Optional)
      • Signing now uses AES-CMAC
    • o Management
      • SMB PowerShell
      • Improved Performance Counters
      • Improved Eventing

You can get additional details on the SMB 2.0 improvements listed above at
http://blogs.technet.com/b/josebda/archive/2008/12/09/smb2-a-complete-redesign-of-the-main-remote-file-protocol-for-windows.aspx

You can get additional details on the SMB 3.0 improvements listed above at
http://blogs.technet.com/b/josebda/archive/2012/05/03/updated-links-on-windows-server-2012-file-server-and-smb-3-0.aspx

   

6. Recommendation

We strongly encourage you to update to the latest version of SMB, which will give you the most scalability, the best performance, the highest availability and the most secure SMB implementation. The motto we used at SDC 2011 for the new version was “Bigger. Faster. Scalier.”

Please note that Windows Server 2012 Hyper-V only supports SMB 3.0 for remote file storage. This is due mainly to the availability features (SMB Transparent Failover, SMB Witness and SMB Multichannel), which did not exist in previous versions of SMB. The additional scalability and performance is also very welcome in this scenario. The Hyper-V Best Practices Analyzer (BPA) will warn you if an older version is detected.

   

7. Conclusion

We’re excited about SMB 3.0, but always concerned about keeping as much backwards compatibility as possible. This release brings several must-have new capabilities and we encourage you to learn more about them. We hope you will be convinced to start planning your upgrades as early as possible.

 


 

Note 1: SMB 2.2

You might have heard of an SMB version 2.2. We actually used that version number in some pre-release versions of Windows 8 and Windows Server 2012 and several events that happened before April 2012. However, we decided to rename SMB 2.2 to SMB 3.0 to better convey the amount of change included in this new release. You can get details about that version number change at http://blogs.technet.com/b/windowsserver/archive/2012/04/19/smb-2-2-is-now-smb-3-0.aspx.

 

Note 2: Protocol Documentation

If you consider yourself an SMB geek and you actually want to understand the SMB NEGOTIATE command in greater detail, you can read the [MS-SMB2-Preview] protocol documentation (which covers SMB 2.0, 2.1 and 3.0), currently available from http://msdn.microsoft.com/en-us/library/ee941641.aspx. In regards to protocol version negotiation, you should pay attention to the following sections of the document:

  • 1.7: Versioning and Capability Negotiation
  • 2.2.3: SMB2 Negotiate Request
  • 2.2.4: SMB2 Negotiate Response

Section 1.7 includes this nice state diagram describing the inner workings of protocol negotiation:

SMB 3.0 Protocol Negotiation

 

Note 3: Third-party implementations

There are several implementations of the SMB protocol from someone other than Microsoft. If you use one of those implementations of SMB, you should ask whoever is providing the implementation which version of SMB they implement for each version of their product.

During the keynote at the SNIA’s Storage Developers Conference in September 2011, two major storage vendors (NetApp and EMC) announced their commitment to implementing SMB 3.0 (back then called SMB 2.2) by the time Windows Server 2012 is generally available. You can view the recording of that keynote at http://www.snia.org/news_events/multimedia/video/events/featured#pfenning_pinkerton_file_protocols (watch the entire keynote and or fast forward to minute 50 to see the partner comments).

Also, a member of the Samba team posted a blog in March 2012 about their work on a Samba implementation of SMB 3.0 (back then called SMB 2.2) at http://blog.obnox.de/samba-team-visits-microsoft-for-smb2-2-interop-event/. Samba runs on several non-Windows operating systems and it’s the default SMB implementation for Linux.

We are hoping for many more implementations and we’ll all be meeting at the next SMB Plugfest in Santa Clara, CA in September 2012.

Microsoft Partners showcase solutions related to Windows Server 2012 at TechEd 2012 North America

$
0
0

The Microsoft TechEd 2012 North America conference is happening this week in Orlando, FL. As part of that event, a number of partners are showing their hardware and/or software at the exhibit area called the TechExpo.

I have spent some time there and took a few pictures of a few partners that have solutions related to the File Server or SMB 3.0 (storage, networking, servers). I tried to capture the signage on each booth, but you need to click on each picture to see a larger version of it.

 

Chelsio

www.chelsio.com

Chelsio

DataOn

www.dataonstorage.com

dataon

EMC

www.emc.com

emc

Fujitsu

www.fujitsu.com

fujitsu

Hitachi

www.hds.com

hitachi

HP

www.hp.com

hp

IBM

www.ibm.com

ibm

Intel

www.intel.com

intel

LSI

www.lsi.com

lsi

Mellanox

www.mellanox.com

mellanox

NetApp

www.netapp.com

netapp

Quanta

www.quantaqct.com

quanta

RAID Inc.

www.raidinc.com

raidinc

Violin Memory

www.violin-memory.com

violin

X-IO

www.x-io.com

xio

 

A big THANKS to each and every one of them for their hard work with Windows Server 2012. There are more partners at the expo, but I did not have time to visit them all. Sorry if I missed your booth.

If you're attending the event, a reminder that the TechExpo will be open tomorrow from 10:30 AM to 2:00 PM.

File Server team sessions at TechEd 2012 North America available for streaming/download

$
0
0

We had a great time showing Windows Server 2012 at TechEd North America and I wanted to share that the recording for our team’s sessions are now publicly available.

That includes our sessions on SMB 3.0 and a number of demos, many of them using one of the Cluster-in-box configurations we were showing at the Technical Learning Center.

Find the links in the table below, sorted by session code:

 

Code Title Speaker(s)
SIA207 Windows Server 2012 Dynamic Access Control Overview Gunjan Jain, Nir Ben Zvi
SIA316 Windows Server 2012 Dynamic Access Control Best Practices and Case Study Deployments in Microsoft IT Brian Puhl, Matthias Wollnik
VIR306 Hyper-V over SMB: Remote File Storage Support in Windows Server 2012 Hyper-V Jose Barreto
WSV303 Windows Server 2012 High-Performance, Highly-Available Storage Using SMB Claus Joergensen, Gene Chellis
WSV308 Standards Support and Interoperability in Windows Server 2012: Storage, Networking, and Management Gene Chellis, Jeffrey Snover,
See-Mong Tan, Wojtek Kozaczynski
WSV310 Windows Server 2012: Cluster-in-a-Box, RDMA, and More John Loveall, Spencer Shepler
WSV314 Windows Server 2012 NIC Teaming and SMB Multichannel Solutions Don Stanwyck, Jose Barreto
WSV322 Update Management in Windows Server 2012: Revealing Cluster-Aware Updating and the New Generation of WSUS Erin Chapple, Mallikarjun Chadalapaka
WSV328 The Path to Continuous Availability with Windows Server 2012 Gene Chellis, Jim Pinkerton
WSV330 How to Increase SQL Availability and Performance Using Window Server 2012 SMB 3.0 Solutions Claus Joergensen, Gunter Zink
WSV334 Windows Server 2012 File and Storage Services Management Fabian Uhse, Mathew Dickson
WSV410 Continuously Available File Server: Under the Hood Claus Joergensen

 

Also check this blog post showing the partner booths in the TechExpo area.

The basics of SMB Multichannel, a feature of Windows Server 2012 and SMB 3.0

$
0
0

1. Introduction

Windows Server 2012 includes a new feature called SMB Multichannel, part of the SMB 3.0 protocol, which increases the network performance and availability for File Servers.

 

1.1. Benefits

SMB Multichannel allows file servers to use multiple network connections simultaneously and provides the following capabilities:

  • Increased throughput. The file server can simultaneously transmit more data using multiple connections for high speed network adapters or multiple network adapters.
  • Network Fault Tolerance. When using multiple network connections at the same time, the clients can continue to work uninterrupted despite the loss of a network connection.
  • Automatic Configuration: SMB Multichannel automatically discovers the existence of multiple available network paths and dynamically adds connections as required.

 

1.2. Requirements

SMB Multichannel requires the following:

  • At least two computers running Windows Server 2012 or Windows 8.

At least one of the configurations below:

  • Multiple network adapters
  • One or more network adapters that support RSS (Receive Side Scaling)
  • One of more network adapters configured with NIC Teaming
  • One or more network adapters that support RDMA (Remote Direct Memory Access)

 

2. Configuration

 

2.1. Installing

SMB Multichannel is enabled by default. There is no need to install components, roles, role services or features.
The SMB client will automatically detect and use multiple network connections if a proper configuration is identified.

 

2.2. Disabling

SMB Multichannel is enabled by default and there is typically no need to disable it.
However, if you want to disable SMB Multichannel (for testing purposes, for instance), you can use the following PowerShell cmdlets:

On the SMB server side:

Set-SmbServerConfiguration -EnableMultiChannel $false

On the SMB client side:

Set-SmbClientConfiguration -EnableMultiChannel $false

Note: Disabling the feature on either the client or the server prevent the systems from using it.

 

2.3. Re-enabling

You can re-enable SMB Multichannel after you disabled it by using:

On the SMB server side:

Set-SmbServerConfiguration -EnableMultiChannel $true

On the SMB client side:

Set-SmbClientConfiguration -EnableMultiChannel $true

Note: You need to enable the feature on both the client or the server to start using it again.

 

3. Sample Configurations

This section provides details on how SMB Multichannel works with a few different configurations using a variety of Network Interface Cards (NIC). Please note that these are only samples and many other configurations not detailed here are possible.

 

3.1. Single RSS-capable NIC

This typical configuration involves an SMB client and SMB Server configured with a single 10GbE NIC. Without SMB multichannel, if there is only one SMB session established, SMB uses a single TCP/IP connection, which naturally gets affinitized with a single CPU core. If lots of small IOs are performed, it��s possible for that core to become a performance bottleneck.

Most NICs today offer a capability called Receive Side Scaling (RSS), which allows multiple connections to be spread across multiple CPU cores automatically. However, when using a single connection, RSS cannot help.

With SMB Multichannel, if the NIC is RSS-capable, SMB will create multiple TCP/IP connections for that single session, avoiding a potential bottleneck on a single CPU core when lots of small IOs are required.

image

 

3.2. Multiple NICs

When using multiple NICs without SMB multichannel, if there is only one SMB session established, SMB creates a single TCP/IP connection using only one of the many NICs available. In this case, not only it’s not possible to aggregate the bandwidth of the multiple NICs (achieve 2Gbps when using two 1GbE NICs, for instance), but there is a potential for failure if the specific NIC chosen is somehow disconnected or disabled.

With Multichannel, SMB will create multiple TCP/IP connections for that single session (at least one per interface or more if they are RSS-capable). This allows SMB to use the combined NIC bandwidth available and makes it possible for the SMB client to continue to work uninterrupted if a NIC fails.

image

 

3.3. Teamed NICs

Windows Server 2012 supports the ability to combine multiple NICs into one using a new feature commonly referred to as NIC teaming. Although a team always provides fault tolerance, SMB without Multichannel will create only one TCP/IP connection per team, leading to limitations in both the number of CPU cores engaged and the use of the full team bandwidth.

SMB Multichannel will create multiple TCP/IP connections, allowing for better balancing across CPU cores with a single SMB session and better use of the available bandwidth. NIC Teaming will continue to offer the failover capability, which will work faster than using SMB Multichannel by itself. NIC Teaming is also recommended because it offers failover capabilities to other workloads that do not rely on SMB and therefore cannot benefit from the failover capabilities of SMB Multichannel.

image

Note: A team of RDMA-capable NICs is always reported as non-RDMA capable. If you intend to use the RDMA capabilities of the NIC, do not team them.

 

3.4. Single or Multiple RDMA NICs

SMB Multichannel is the feature responsible for detecting the RDMA capabilities of NICs to enable the SMB Direct feature (SMB over RDMA). Without SMB Multichannel, SMB will use regular TCP/IP with these RDMA-capable NICs (they all provide a TCP/IP stack side-by-side with the new RDMA stack).

With SMB Multichannel, SMB will detect the RDMA capability and create multiple RDMA connections for that single session (two per interface). This allows SMB to use the high throughput, low latency and low CPU utilization offered by these RDMA NICs. It will also offer fault tolerance if you’re using multiple RDMA interfaces.

image

Note 1: A team of RDMA-capable teams is reported as non-RDMA capable. If you intend to use the RDMA capability of the NIC, do not team them.

Note 2: After at least one RDMA connection is created, the TCP/IP connection used for the original protocol negotiation is no longer used. However, that connection is kept around in case the RDMA connections fail.

 

3.5. Multichannel, RDMA and NIC Teaming compatibility

Here’s a table summarizing the different capabilities available when combining SMB Multichannel, RDMA (SMB Direct) and NIC Teaming:

image

For non-RDMA NICs, your best bet is combining NIC Teaming with SMB Multichannel. This will give you the best throughput, plus fault tolerance for applications using SMB and other protocols.

When using RDMA NICs, LBFO is not a good option, since it disables the RDMA capability of the NIC.

 

3.6. Sample Configurations that do not use SMB Multichannel

The following are sample network configurations that do not use SMB Multichannel:

  • Single non-RSS-capable network adapters. This configuration would not benefit from multiple network connections, so SMB Multichannel is not used.
  • Network adapters of different speeds. SMB Multichannel will choose to use the faster network adapter. Only network interfaces of same type (RDMA, RSS or none) and speed will be used simultaneously by SMB Multichannel, so the slower adapter will be idle.

 

4. Operations

Here are a few common scenarios for testing SMB Multichannel:

 

4.1. Compare a file copy with and without SMB Multichannel

To measure the increased throughput provided by SMB Multichannel, follow these steps:

  • Setup SMB Multichannel in one the configurations described earlier
  • Measure the time to perform a long-running file copy using SMB Multichannel
  • Disable SMB Multichannel (see instructions in previous topic).
  • Measure the time it takes to perform the same file copy without SMB Multichannel
  • Re-enable SMB Multichannel (see instructions in previous topic).
  • Compare the two results.

Note: to avoid the effects of caching, you should:

  • Copy a large amount of data (more data than would fit on memory).
  • Perform the copy twice, using first copy as a warm-up and timing only the second copy.
  • Restart both the server and the client before each test to make sure they operate under similar conditions.

 

4.2. Fail one of multiple NICs during a file copy with SMB Multichannel

To confirm the failover capability of SMB Multichannel, follow these steps:

  • Make sure SMB Multichannel is operating in a multi-NIC configuration.
  • Perform a long-running file copy.
  • While the file copy is running, simulate a failure one of the network paths by disconnecting one of the cables (or by disabling one of the NICs)
  • Confirm that the file copy continues using the surviving NIC, without any file copy errors.

Note: Make sure there are no other workloads using the disconnected/disabled path, to avoid failures in workloads that do not leverage SMB Multichannel.

 

5. Troubleshooting

Here are troubleshooting tips for SMB Multichannel.

 

5.1. Verifying if you’re using SMB Multichannel

You can use the following steps to verify you are using SMB Multichannel.

Step 1: Verify network adapter configuration

Use the following PowerShell cmdlets to verify you have multiple NICs and/or to verify the RSS and RDMA capabilities of the NICs. Run on both the SMB server and the SMB client.

Get-NetAdapter

Get-NetAdapterRSS

Get-NetAdapterRDMA

Get-NetAdapterHardwareInfo

 

Step 2: Verify SMB configuration

Use the following PowerShell cmdlets to make sure SMB Multichannel is enabled, confirm the NICs are being properly recognized by SMB and that their RSS and RDMA capabilities are being properly identified.

On the SMB client, run the following PowerShell cmdlets:

Get-SmbClientConfiguration | Select EnableMultichannel

Get-SmbClientNetworkInterface

On the SMB server, run the following PowerShell cmdlets:

Get-SmbServerConfiguration | Select EnableMultichannel

Get-SmbServerNetworkInterface

 

Step 3: Verify the SMB connection

On the SMB client, start a long-running file copy to create a lasting session with the SMB Server. While the copy is ongoing, open a PowerShell window and run the following cmdlets to verify the connection is using the right version of SMB and that SMB Multichannel is working:

Get-SmbConnection

Get-SmbMultichannelConnection

Get-SmbMultichannelConnection -IncludeNotSelected

 

5.2. View SMB Multichannel Events (Optional)

SMB 3.0 offers a “Object State Diagnostic” event log that can be used to troubleshoot Multichannel (and therefore RDMA) connections.
Keep  in mind that this is a debug log, so it’s very verbose and requires a special procedure for gathering the events. You can follow the steps below:

Step 1: Capture the events

First, enable the log in Event Viewer:

  • Open Server Manager
  • In Server Manager, click on “Tools”, then “Event Viewer”
  • On the menu, select “View” then “Show Analytic and Debug Logs”
  • Expand the tree on the left: Applications and Services Log, Microsoft, Windows, SMB Client, ObjectStateDiagnostic
  • On the “Actions” pane on the right, select “Enable Log”
  • Click OK to confirm the action.

After the log is enabled, perform the operation that requires an RDMA connection. For instance, copy a file or run a specific operation.
If  you’re using mapped drives, be sure to map them after you enable the log, or else the connection events won’t be properly captured.

Next, disable the log in Event Viewer:

  • In Event Viewer, make sure you select Applications and Services Log, Microsoft, Windows, SMB Client, ObjectStateDiagnostic
  • On the “Actions” page on the right, “Disable Log”

Step 2: Option 1: View the events in Event Viewer

You can review the events on the log in Event Viewer. You can filter the log to include only the SMB events that confirm that you have an SMB Multichannel or only error events.

The “Smb_MultiChannel” keyword will filter for connection, disconnection and error events related to SMB. You can also filter by event numbers 30700 to 30706.

  • Click on the “ObjectStateDiagnostic” item on the tree on the left.
  • On the “Actions” pane on the right, select “Filter Current Log…”
  • Click on “Filter Current Log…” on the Actions pane on the right and enter “30700-30705” on the filter for Event IDs.

To view the SMB Multichannel events using Event Viewer, use the following steps on the SMB Client:

  • In Event Viewer, expand the tree on the left to show “Applications and Service Logs”, “Microsoft”, “Windows”, “SMB Client”, “Operational”
  • Click on “Filter Current Log…” on the Actions pane on the right and enter “30700-30705” on the filter for Event IDs.

To view only errors:

  • Click on “Filter Current Log…” on the Actions pane on the right and click on the checkbox labeled “Errors”.

Step 2: Option 2: View the events using PowerShell

You can also use a PowerShell window and run the following cmdlets to view the events.

To see any RDMA-related connection events, you can use the following:

Get-WinEvent -LogName Microsoft-Windows-SMBClient/ObjectStateDiagnostic -Oldest |
? Message -match "RDMA"

To view all types of SMB Multichannel events , use the following cmdlet on the SMB Client:

Get-WinEvent -LogName Microsoft-Windows-SMBClient/ObjectStateDiagnostic –Oldest |
? { $_.Id -ge 30700 –and $_.Id –le 30705 }

To list only errors, use the following cmdlet:

Get-WinEvent -LogName Microsoft-Windows-SMBClient/ObjectStateDiagnostic -Oldest |
? { $_.Id -ge 30700 –and $_.Id –le 30705 –and $_.Level –eq 2 }

 

5.3. View SMB Performance Counters

There are several Performance counters related to SMB in Windows Server 2012. To view SMB-related performance information, follow these steps:

  • Open Server Manager
  • In the Tools menu, open Performance Monitor
  • In Performance Monitoring, click on “Performance Monitor” on the tree on the left.
  • Switch to the Report View by pressing CTRL-G twice (or using the icon on the toolbar)
  • Add performance counters to the view by pressing CTRL-N (or using the icon on the toolbar)

The following Performance Counters are useful when looking at activities related to SMB, SMB Direct and Network Direct:

Counter Name Shows information for
SMB Server Shares Shares on the SMB Server
SMB Server Sessions Sessions on the SMB Server
SMB Client Shares Shares on the SMB Client

 

6. Number of SMB Connections per Interface

SMB Multichannel will use a different number of connections depending on the type of interface:

  • For RSS-capable interfaces, 4 TCP/IP connections per interface are used
  • For RDMA-capable interfaces, 2 RDMA connections per interface are used
  • For all other interfaces, 1 TCP/IP connection per interface is used

There is also a limit of 8 connections total per client/server pair which will limit the number connections per interface.

For instance, if you have 3 RSS-capable interfaces, you will end up with 3 connections on the first, 3 connections on the second and 2 connections on the third interface.

We recommend that you keep the default settings for SMB Multichannel. However, those parameters can be adjusted.

 

6.1. Total Connections per client/server pair

You can configure the maximum total number of connections per client/server pair using:

Set-SmbClientConfiguration –MaximumConnectionCountPerServer <n>

 

6.2. Connections per RSS-capable NIC

You can configure the number SMB Multichannel connections per RSS-capable network interface using the PowerShell cmdlet:

Set-SmbClientConfiguration -ConnectionCountPerRssNetworkInterface <n>

 

6.3. Connections per RDMA-capable NIC

It is even less likely that you’ll need to adjust the number of connections per RDMA-capable interface.

That can be configured via a registry key using the following PowerShell command:

Set-ItemProperty -Path ` "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" `
ConnectionCountPerRdmaNetworkInterface -Type DWORD -Value <n> –Force

 

6.4. Connections for other types of NIC

For NICs that are not RSS-capable or RDMA-capable, there is likely no benefit of using multiple connections. In fact, this will likely reduce your performance.

However, for troubleshooting purposes, there is also a registry key to change the default settings of 1 connection per NIC.

That can be configured via a registry key using the following PowerShell command:

Set-ItemProperty -Path ` "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" `
ConnectionCountPerNetworkInterface -Type DWORD -Value <n> –Force

 

7. SMB Multichannel Constraints

Because of feedback during the Beta, we added in the Release Candidate a new set of cmdlets using the SmbMultichannelConstraint noun to allow you to control the SMB Multichannel behavior in more complex network configurations.

For instance, if you have 4 NICs in your system and you want the SMB client to use only two specific NICs when you access server FS1, you can accomplish that with the following PowerShell cmdlets:

New-SmbMultichannelConstraint -ServerName FS1 -InterfaceIndex 12, 19

Or

New-SmbMultichannelConstraint -ServerName FS1 -InterfaceAlias RDMA1, RDMA2

 

7.1. Notes on SMB Multichannel Constraints

Here are a few notes and comments on how to use SMB Multichannel Constraints:

  • This is configured on the SMB 3.0 client and it’s persisted in the registry.
  • Constraints are configured per server because you can configure different set of interfaces for each server if required.
  • You list the interfaces you want to use, not the interfaces you want to avoid.
  • You get a list of interfaces in your system using Get-NetAdapter.
  • For servers not specified, the default SMB Multichannel behavior for that client continues to apply.
  • For a reference of other cmdlets related to SMB Multichannel Constraints, check the blog post on the basics of SMB PowerShell

 

7.2. Recommendation: keep the default behavior, avoid constraints

This is an advanced setting, available only via PowerShell (or WMI). Please be careful when configuring these SMB Multichannel constraints, because you have the potential to apply a less-than-ideal configuration and end up with something that does not provide you the best level of network fault tolerance (also known as “shooting yourself in the foot”).

This is specially true if you add/remove network adapters from your system and forget to adjust your constraints accordingly. We highly recommend that you stick to the default, let-SMB-Multichannel-figure-it-out configuration if at all possible, since this will let SMB 3.0 dynamically and automatically adjust to any changes in network configuration shortly after it happens.

 

8. Conclusion

I hope this blog post has helped you understand the basics of SMB Multichannel. I would encourage you to try it out in any of the configurations shown.

For additional information on the Windows Server 2012 File Server, SMB 3.0 and SMB Direct, see the links at Updated Links on Windows Server 2012 File Server and SMB 3.0.

 


Update on 5/14: Minor content update

Update on 6/28: Added section on SMB Multichannel Constraints

Viewing all 155 articles
Browse latest View live