Simulating RSVD support with a Standalone Windows Server
Overview
The Remote Shared Virtual Disk (RSVD) Protocol [MS-RSVD] is used to access shared virtual disks across a network over Server Message Block Protocol version 3 (SMB3). Applications such as Microsoft Hyper-V use RSVD to enable virtual machines (VMs) to share access to virtual disks.
This article provides a reduced configuration that can be optimized to a single VM and used in a testing or lab environment. It demonstrates simulating RSVD support on plain SMB3 storage. The persistent reservations feature of RSVD is not supported by this configuration.
Following these steps can save time and resources as compared to a production-level configuration natively supporting RSVD. For Windows Server (2012 R2 and later) to fully support RSVD, Windows needs to be in a cluster configuration. One such configuration is a Scale-Out File Server (SOFS), which can require a number servers and a considerable investment in configuration.
Planning
When setting up the simulated RSVD environment, there are several options. These choices depend on available resources and intended use of the simulated environment.
[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]
1. Server version
Windows Server versions 2012 R2 and later support RSVD and can be used for this configuration. Windows Server 2016 Preview 5 (or later) is required for RSVD version 2 support. RSVD version 2 enables snapshots of shared virtual disk files. The commands in this article work for either Windows Server 2012 R2 or Windows Server 2016 Technical Preview 5.
Links to download the selected Windows version:
For this article, download the Server install as an .iso file. An ISO image is an archive file of an optical disc, such as a DVD. This file will be inserted into a virtual DVD drive in the VMs to install the operating system.
2. Domain or Workgroup environment
The RSVD storage server can be in a workgroup if your client is simulating artificial workloads (such as with the File Server Protocols Test Suite). However, most scenarios, including attaching shared disks with Hyper-V, require joining the machine to a domain. This article uses a domain environment.
If using a workgroup environment:
- Ensure all machines are in the same workgroup
- Put all static IPv4 addresses in the same subnet
- Use the same Administrator password for all machines
3. Location of RSVD-enabled SMB3 share
RSVD support can be simulated on a volume of the host, but this will prevent the RSVD traffic from appearing “on-the-wire”. By putting the RSVD-enabled share on a VM, traffic between the Hyper-V host and storage server can be captured. If network capture is not required, it is not necessary to create the RSVD storage server as guest VM, but a VM may still be needed for a domain controller. This article places the share on the OS volume (C:\ of a guest VM.
The RSVD-enabled share can be located:
- Directly on the OS disk of the Hyper-V Host
- On a separate disk or volume of the Hyper-V Host
- On the OS disk of a guest VM
- On a separate virtual volume of a guest VM
4. Number of VMs
This article separates the domain controller from the RSVD storage server for clarity. If needed, these can be combined in a single VM. For a single-VM configuration:
- Complete the step Install Failover Clustering on the domain controller, and skip the remaining steps in section Configure the RSVD storage server
- Complete the steps in section Set up the file share simulating RSVD support on the domain controller.
I. Configure the Host Machine
The Windows Hyper-V service is the client application that generates RSVD traffic. The physical machine is the Hyper-V host, which uses a guest VM as a storage server to store shared virtual disks.
1. Install Windows Server OS
At the Windows Setup screen for “Select the operating system you want to install”, it is sufficient to select the “Standard (Desktop Experience)” option.
See also:
- Windows Server 2016 Technical Preview 5 System Requirements and Installation
- Installing Windows Server 2012
2. Verify Second Level Address Translation (SLAT) support (if needed)
Windows Server 2016 requires SLAT support for Hyper-V. SLAT support can be verified using the inbox utility systeminfo. To run systeminfo, type the following from an elevated (Run as administrator) command prompt:
systeminfo
The last 4 lines of output indicate the hardware’s Hyper-V support status.
NOTE: After Hyper-V is installed, the tool will not display Hyper-V requirements.
For more information on verifying Second Level Address Translation (SLAT) support, see Windows 10 Hyper-V Requirements.
3. Install the Hyper-V role with management tools
Enter the following cmdlet in PowerShell to install Hyper-V with management tools:
Install-WindowsFeature
Hyper-V -IncludeManagementTools
Rename the machine if desired. Reboot the server to complete the Hyper-V installation.
See also:
- Hyper-V Getting Started Guide
- Windows PowerShell Overview
- Install or Uninstall Roles, Role Services, or Features
4. Create an Internal Virtual Network Switch
Enter the following cmdlet in PowerShell to create a virtual internal network. This network will be connected to the Hyper-V host and guest VMs, but has no external access. An internal network is used to isolate the test environment (particularly the domain controller).
$vNet = “vInternal”
New-VMSwitch $vNet -SwitchType Internal
NOTE: Keep the PowerShell window open to continue using the $vNet variable.
See also: Configuring Virtual Networks
II. Create VMs for the servers
In this section, two Windows Server VMs are created for the domain controller and the RSVD storage server.
1. Copy the server install .iso file to the host machine
Place the .iso file downloaded earlier where it can be referenced by the following PowerShell commands.
2. Create VMs with the server OS DVD inserted
These PowerShell cmdlets create VMs and configure their memory as Dynamic Memory. Then the .iso file is inserted in the virtual optical drive. The VM is started to initiate the OS installation.
$vmName1 = “LabDC”
$vmName2 = “RSVDServer”
$vhdPath1 = “C:\ProgramData\Microsoft\Windows\Hyper-V\ + $vmName1 + ”.vhdx”
$vhdPath2 = “C:\ProgramData\Microsoft\Windows\Hyper-V\ + $vmName2 + ”.vhdx”
New-VM $vmName1 -MemoryStartupBytes 2GB -NewVHDSizeBytes 60GB `
-NewVHDPath $vhdPath1 -SwitchName $vNet
New-VM $vmName2 -MemoryStartupBytes 2GB -NewVHDSizeBytes 60GB `
-NewVHDPath $vhdPath2 -SwitchName $vNet
Set-VMMemory $vmName1, $vmName2 -DynamicMemoryEnabled $true
Set-VMDvdDrive $vmName1 -Path “C:\ISO\14300.1000.160324-1723.RS1_RELEASE_SVC_SERVER_OEMRET_X64FRE_EN-US.ISO”
Set-VMDvdDrive $vmName2 -Path “C:\ISO\14300.1000.160324-1723.RS1_RELEASE_SVC_SERVER_OEMRET_X64FRE_EN-US.ISO”
Start-VM $vmName1, $vmName2
3. Connect to each VM to complete the Server installation steps
At the Windows Setup screen for “Select the operating system you want to install”, it is sufficient to select the option ending in “… Standard (Desktop Experience)”.
III. Configure the domain controller
Log onto the first guest VM to complete the following steps.
1. Install Active Directory Domain Services (AD DS)
Run the following command in PowerShell to install AD DS, along with the administration tools needed for the domain controller.
Install-WindowsFeature AD-Domain-Services, RSAT-ADDS, RSAT-ADDS-Tools
2. Configure the network adapter
These PowerShell cmdlets give the virtual adapter a static IP address, and configure the local machine as the preferred DNS server. The cmdlet to remove existing IP addresses will give confirmation prompts.
$vNet = “vInternal”
Get-NetAdapter | Rename-NetAdapter -NewName $vNet
Set-NetIPInterface -InterfaceAlias $vNet -DHCP Disabled
Remove-NetIPAddress -InterfaceAlias $vNet
New-NetIPAddress -InterfaceAlias $vNet -IPAddress 192.168.1.1 -PrefixLength 24
Set-DnsClientServerAddress -InterfaceAlias $vNet -ServerAddresses 127.0.0.1
For more information on managing IP addresses, see: Managing IP Addresses
The default machine name can be kept, or the machine can be renamed. If renaming the machine, the System tool will prompt to restart. Click restart later, since the next step also requires a restart.
3. Create the Domain
This PowerShell cmdlet creates a new domain and configures the local machine as the domain controller with DNS services. The Administrator account created when the OS was installed on this VM becomes the domain Administrator account for the new domain. This account can be used to log onto all machines joined to the domain (as LAB\Administrator where the domain NetBIOS name is LAB).
The cmdlet will prompt for a Safe Mode Administrator password, then prompt for confirmation. The VM will restart once the domain is created.
Install-ADDSForest -CreateDNSDelegation:$false ‘
-DatabasePath “C:\Windows\NTDS” -DomainMode “Win2012R2” ‘
-DomainName “lab.local” -DomainNetBIOSName “LAB” -ForestMode “Win2012R2” ‘
-InstallDNS:$true -LogPath “C:\Windows\NTDS” -SYSVOLPath “C:\Windows\SYSVOL”
For more information on creating AD domains, see Windows 2012 R2: Active Directory Installation
IV. Join the Host Machine to the domain
These steps are completed on the physical host, and result in restarting the host. The state of the guest VM(s) will be saved by Hyper-V during shutdown, and restored on restarting. Guest VM(s) will not have appeared to restart.
1. Reconfigure Host Network adapter
These PowerShell cmdlets give the virtual network adapter on the host a static IP in the same subnet as the VMs, and configures the DC as the preferred DNS server.
$vNet = “vInternal”
Get-NetAdapter “vEthernet ($vNet)” | Rename-NetAdapter -NewName $vNet
Set-NetIPInterface -InterfaceAlias $vNet -DHCP Disabled
Remove-NetIPAddress -InterfaceAlias $vNet
New-NetIPAddress -InterfaceAlias $vNet -IPAddress 192.168.1.10 -PrefixLength 24
Set-DnsClientServerAddress -InterfaceAlias $vNet -ServerAddresses 192.168.1.1
2. Join Host machine to new domain
This PowerShell cmdlet prompts for network credentials and adds the machine to the domain. Enter the administrator credentials for the domain created in the previous section. The machine will restart.
Add-Computer -DomainName LAB -Credential (Get-Credential) -Restart
When the machine restarts:
- At the logon screen, click Other User.
- Enter the domain administrator credentials.
V. Configure the RSVD storage server
Log onto the second guest VM to complete the following steps.
1. Install Failover Clustering
Installing the Failover Clustering feature installs the svhdxflt.sys file system mini-filter that is later attached to the volume where the RSVD-enabled share will be located. It is not necessary to create a Failover Cluster.
Install-WindowsFeature Failover-Clustering
The default machine name can be kept, or the machine can be renamed (requires a restart).
2. Configure the network adapter
Use the same PowerShell cmdlets as above for Configure the network adapter. Use a different IP address in the same subnet as the DC (such as 192.168.1.13). For the -ServerAddresses
parameter of the Set-DnsClientServerAddress
cmdlet, use the IP address of the DC (192.168.1.1 in this example).
3. Join guest VM to the domain
Enter the credentials for the domain administrator. The machine restarts when the command completes.
Add-Computer -DomainName LAB -Credential (Get-Credential) -Restart
When the machine restarts:
- At the logon screen, click Other User.
- Enter the domain administrator credentials.
VI. Set up the file share simulating RSVD support
Complete the following steps while logged onto the RSVD storage server as the domain administrator.
1. Create an SMB share
The SMB share is created after the server and host have been added to the domain to ensure the folder permissions are set correctly. Permissions are added for the domain administrator and host machine account. Finally, the NTFS folder access is updated to match the share access.
NOTE: Machine account permissions are required for Hyper-V to act as an RSVD client. In this example, the Hyper-V host machine name is LabHost and the domain NetBIOS name is LAB.
$sh = “RSVDShare”
$path = “C:\ + $sh
MD $path
New-SmbShare $sh -Path $path -FullAccess LAB\Administrator, LAB\LabHost$
Set-SmbPathAcl -ShareName $sh
2. Attach the RSVD filter driver to SMB share volume
To simulate RSVD support, attach the RSVD file system mini-filter driver svhdxflt.sys. This driver was installed as part of the Failover Clustering feature installation.
From an elevated command prompt:
fltmc attach svhdxflt C:\
To verify that the filter is attached, use the command:
fltmc instances
NOTE: The fltmc attach command above must be executed any time the guest VM is rebooted.
For more information, see Filter Manager.
3. Install a network trace tool (optional)
Install your network trace tool on the guest VM to capture SMB and RSVD network traffic. Any network packet capture tool can be used. The latest network trace tool from Microsoft is Message Analyzer.
Validate the Configuration
To validate the configuration, create a raw VM and configure it with a shared disk. It isn’t necessary to have a working VM to demonstrate RSVD, since the traffic is between the Hyper-V host and the RSVD storage server. The uninitialized test VM can be discarded when done, and the shared disk deleted.
1. Create a VM
Create a basic VM to attach a shared virtual disk to. The VM does not need to be started.
$vmName = “TestVM”
New-VM $vmName
2. Create and attach the shared disk
If you are taking a network trace, start it right before executing the Add-VMHardDiskDrive command. Stop the trace once the command completes.
$path = "\RSVDServer\RSVDShare\Shared.VHDX"
New-VHD -Path $path -Dynamic -SizeBytes 10GB
Add-VMHardDiskDrive
-VMName $vmName -Path $path -SupportPersistentReservations
There is no output from the last command if it is successful. If no errors are displayed, the SMB share is correctly simulating RSVD support.
Troubleshooting: The cmdlet may fail with the error: “The storage where the virtual hard disk is located does not support virtual hard disk sharing.” In this case, the filter driver needs to be manually re-attached by logging onto the RSVD storage server and executing fltmc attach svhdxflt C:\
WARNING: If the same error occurs on a Scale-Out File Server, this indicates a problem that needs to be diagnosed. Do not manually attach the filter driver (with fltmc attach) on any configuration that is expected to support persistent reservations and RSVD normally.
3. Review the trace (if collected)
In Message Analyzer, it is easiest to view the trace by clicking Flat Message List, and filtering on SMB2. Filtering on SMB2 in Message Analyzer also shows the RSVD traffic (which uses SMB2 as its transport).
In the trace, the RSVD exchange starts with a SVHDX_OPEN_DEVICE_CONTEXT Create Context added to a Create which also appends ":SharedVirtualDisk" to the filename. This is how a virtual disk is opened in RSVD mode. The Create is followed by several other RSVD tunneled commands and tunneled SCSI commands that Hyper-V uses to configure the shared virtual disk.
Summary
The RSVD Server can now be used for a variety of tasks that do not require production level availability.
- Use it with the Windows Protocols File Server Test Suite to review RSVD network traffic in a Windows-to-Windows configuration
- Run proof-of-concept scenarios with RSVD client workloads
- Demonstrate a variety of Windows Server technologies, such as those described in this article by Jose Barreto: