Deploy and Configure a SCVMM Library Server on SOFS

Hi folks, I recently noticed that I was referring to a SCVMM library server in my Server 2016 Features Series but neglected to create a guide for said library server…how rude of me. Please allow me to rectify that Smile

When deploying a highly available instance of SCVMM, you can’t have the installer create the share for you, if you’ve been following the above series though, you’ve also deployed a scale-out file server, so why not put your SCVMM library share there?

There is one massive benefit to this method (you’re getting it in bold folks). When deploying a VM from a SOFS hosted library share to the SOFS shares for your Hyper-V environment, the data copy is all done within SOFS over your SMB network(s). This means that the traffic doesn’t touch your management network and in fact, won’t even leave the Top of Rack switch (assuming both your Hyper-V hosts and SOFS nodes are connected to the same).

Although not strictly required, I tend to put the library server VM on the same management network as the Hyper-V hosts and SOFS nodes. Also, you don’t need to have a dedicated server for the role although I’d recommend it and will be going with that for the purposes of this guide. If you’re using the environment for self-service, then you probably want to make sure your library server is highly available as there’s not much point having a highly available file share being accessed by a library server that’s a single point of failure Smile

OK, that’s the whys and wherefores out of the way, let’s get on with it Smile

 

Prerequisites

Spin up a VM, this can be from template if you’ve already got one configured. The VM doesn’t need a massive amount of compute and doesn’t require any storage other than its operating system drive as the library data isn’t actually stored on the server, only accessed through it.

SCVMM will need a run as account when interacting with the library server, I’m going to use the SOFS Run As Account we configured HERE. Add this run as account as a local administrator on the library server.

 

Add the Library Server to SCVMM

Navigate to “Library”, right-click on “Library Servers” and select “Add Library Server”

clip_image001

Click “Browse”, select the “SOFS Run As Account” and click “OK”. Now click “Next”.

clip_image002

Click “Search” to launch the “Computer Search” window. Type in the name of your library server and click “Search”

Highlight your library server, click “Add” and “OK”

clip_image003

Click “Next” and “Add Library Servers”

clip_image004

clip_image005

The SCVMM job should complete successfully and the server will show under “Library Servers” in the “Library” workspace.

clip_image006

clip_image007

OK, so now we have a library server but no file shares. So let’s sort that out.

 

Create a Storage Space and File Share for Library Server

I prefer to create a separate storage space for my Library Server file share as I may want to create it with different tiering options and it lets me start small and grow it as required.

To create this storage space, we’re going to make use of the PowerShell we used back when deploying our Storage Spaces cluster. This time, it’ll prompt you to enter a name for the space.

##########################################################
# Script Name: Create a Tiered Storage Space With 5% SSD #
#                                                        #
# Version Number: 3.0                                    #
# Created By: David Fleming                              #
# Creation Date: 15th December 2015                      #
##########################################################

# This Function Gets all Storage Pools Available to the System the Script is Run on and
# Adds Them to a List Which is Ouptut to the Screen for the User to Choose From

$ErrorActionPreference = Stop

Function Choose-Pool
{
PARAM
(
[Parameter(Mandatory=$true)]
$Options,
$DisplayProperty
)
[int]$OptionPrefix = 1
# Create menu list
foreach ($Option in $Options)
{
if ($DisplayProperty -eq $null)
{
Write-Host ("{0,3}: {1}" -f $OptionPrefix,$Option)
}
else
{
Write-Host ("{0,3}: {1}" -f $OptionPrefix,$Option.$DisplayProperty)
}
$OptionPrefix++
}
Write-Host ("{0,3}: {1}" -f 0,"To Cancel")
[int]$Response = Read-Host "Please Select a Pool to Create Your New Storage Space on"
$PoolValue = $null
if ($Response -gt 0 -and $Response -le $Options.Count)
{
$PoolValue = $Options[$Response-1]
$script:PoolName = $PoolValue.FriendlyName
}
return $PoolValue
}

# This Function Asks the User the Desired Size of the Storage Space and Hands off to the UserPrompt Function
Function DataEntry
{
$script:SpaceSize = Read-Host "What Size of Storage Space Would You Like? (In the following format '5GB' or '5TB' with a Maximum Size of 10TB - TB is Assumed if Nothing Specified)"
Write-Host "`n";"Storage Space Size: $SpaceSize";"`n"
UserPrompt
}

# This Function Allows the User to Confirm the Choice Made Above is Correct and Hands off to the SSCreate Function
Function UserPrompt
{
$answer = Read-Host "Please Review Your Answers and Press 'Y' if They Are Correct or 'N' if You Would Like to Re-Enter Them"
If ($answer -match "N")
{
DataEntry
}
If ($answer -match "Y")
{
SSCreate
}
Else
{
UserPrompt
}
}

# This Function Creates a Tiered Storage Space Using 5% SSD and Hands off to the PrepSS Function
Function SSCreate
{
Write-Host "Creating a $SpaceSize Tiered Storage Pool on $PoolName" -ForegroundColor Yellow
# Format User Data For Use in Space Creation
If ($SpaceSize -like '*GB*')
{
$SpaceSizeInt = $SpaceSize -replace '[GB]',''
$SpaceSizeBytes = [int64]$SpaceSizeInt * 1024 * 1024 * 1024
}
Else
{
$SpaceSizeInt = $SpaceSize -replace '[TB]',''
$SpaceSizeBytes = [int64]$SpaceSizeInt * 1024 * 1024 * 1024 * 1024
}
$SSDCapacity = [int64]$SpaceSizeBytes * .05
$HDDCapacity = [int64]$SpaceSizeBytes * .95

# Set Correct Name for New Storage Space
$script:SpaceName = Read-Host "Please enter a name for your New Storage Space"

# Create Tiered Storage Space
$SSD_Tier = Get-StorageTier | where FriendlyName -Like "SSD-Tier*$PoolName"
$HDD_Tier = Get-StorageTier | where FriendlyName -Like "HDD-Tier*$PoolName"
Get-StoragePool $PoolName | New-VirtualDisk -FriendlyName $SpaceName `
-StorageTiers @($SSD_Tier,$HDD_Tier) `
-StorageTierSizes @($SSDCapacity, $HDDCapacity) `
-ResiliencySettingName Mirror `
-NumberOfDataCopies 3 `
-NumberOfColumns 5 `
-PhysicalDiskRedundancy 2 `
-ProvisioningType Fixed `
-Interleave 65536 `
-AutoWriteCacheSize

# Move "Available Storage" ClusterGroup to the node you're working from
Write-Host "Moving Available Storage to Locahost Cluster Node" -ForegroundColor Yellow
Move-ClusterGroup "Available Storage" -Node $env:COMPUTERNAME
Start-Sleep -Seconds 5
PrepSS
}

# This Function Carries out all Post Creation Configuration Tasks on the new Storage Space
Function PrepSS
{
Write-Host "Preparing New Storage Space For Use" -ForegroundColor Yellow

# Renaming and Suspending Cluster Resource (Disk)
$ClusterDisk = Get-ClusterResource -Name "*$SpaceName*"
$ClusterDisk.Name = $SpaceName
Suspend-ClusterResource $ClusterDisk
Get-VirtualDisk -FriendlyName $SpaceName | Get-Disk | New-Partition -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel $SpaceName -AllocationUnitSize 65536 -Force -Confirm:$false
Resume-ClusterResource $ClusterDisk | Add-ClusterSharedVolume
$CSVPath = Get-WmiObject Win32_Volume | where Label -eq $SpaceName
Rename-Item $CSVPath.Name -NewName $SpaceName

# Move new CSV ownership to the node you're working from
Move-ClusterSharedVolume -Name $SpaceName -Node $env:COMPUTERNAME
Write-Host "New Storage Space Created and Ready for Use" -ForegroundColor Green
Exit
}

# The Following Commands Kick off the Script
Clear-Host
$PoolNames = Get-StoragePool | where FriendlyName -NE "Primordial" | Sort-Object -Property FriendlyName
if ($PoolNames.count -gt 1)
{$PoolValue = Choose-Pool $PoolNames "FriendlyName"}
else {$PoolName = $PoolNames.FriendlyName}
DataEntry

We now have a tiered storage space that’s ready to accept file shares, let’s give it one.

 

Create SOFS File Server Share for SCVMM Library Server

Log on to one of your SOFS nodes and open “Server Manager”
Navigate to “File and Storage Services” and click on “Shares”

clip_image008

Click on “Tasks” and select “New Share…”

clip_image009

Select “SMB Share – Quick” and click “Next”

clip_image010

clip_image011

Select your SOFS role under “Server”, select the volume you just created and click “Next”

clip_image012

Type a name for your share (I always name this in line with the CSV it sits on) and click “Next”

clip_image013

Accept the defaults on the “Configure share settings” screen and click “Next”

clip_image014

  • Click “Customize permissions” and on the “Permissions” tab, click “Add”
  • Click “Select a principal”
  • Click “Object Types” and limit the search scope to “Users and Computer”
  • Type the name of your Hyper-V cluster computer object and click “OK”
  • Give the account “Full Control” and click “OK”

clip_image015

Repeat the above process (from “Add”) adding the computer object for all of your Hyper-V hosts and the account you used when adding your library server to SCVMM.

Now click “OK”, “Next”, “Create” and “Close”

clip_image016

clip_image017

We now have a share with the correct permissions, all that’s left to do it let SCVMM manage it and add it to our library server.

 

Add a File Share to you SCVMM Library Server

Firstly, we need to make sure that SCVMM can see the share we just added, with that in mind:

Back in our SCVMM console, navigate to “Fabric”, “Storage”, “Providers”, right-click on your storage cluster and select “Refresh”…this job may take a while to complete.

clip_image018

Once the refresh job has completed, navigate to “File Servers” (just under Providers) and right-click on the file share you just added and select “Properties”

Now tick the box labelled “File share managed by Virtual Machine Manager”

Select or create a “Classification” that makes sense for this storage and click “OK” (I’ve classed mine as “Library”)

clip_image019

clip_image020

Some of you will have noticed that the resiliency of our new share shows as “Simple”, we know this is wrong as we created it ourselves using PowerShell and it’s actually a tiered 3-way mirror Smile  I’m assuming this is either a bug or because of the way certain storage space properties are now held within the storage tiers that make up a storage space.  For example, if you want to find the number of columns or data copies, you would use PowerShell to query the storage tier:

Get-VirtualDisk "Space Name" | Get-StorageTier | FT FriendlyName, NumberOfColumns, NumberOfDataCopies

But hey, that’s a little off topic Smile

Now we can add our new share to our library server.

Navigate to “Library”, “Library Servers”, right-click on the “Library Server” and select “Add Library Shares”

clip_image021

Tick the library share you just configured, click “Next” and “Add Library Shares”

clip_image022

Aaaaaaaand there you have it. You now have a SCVMM library server backed by a SOFS file share which sits on its own CSV Smile

Leave a Reply

Your email address will not be published. Required fields are marked *