Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
MVPDays Publishing
http://www.mvpdays.com
All rights reserved. No part of this book may be reproduced or transmitted in any form or by any
means without the prior written permission of the publisher.
ISBN:TBA
Feedback Information
We’d like to hear from you! If you have any comments about how we could improve the quality
of this book, please don’t hesitate to contact us by visiting www.checkyourlogs.net or sending an
email to feedback@mvpdays.com.
iii
Acknowledgements
iii
Acknowledgements
Acknowledgements
From Dave
Cristal, you are my rock and my source of inspiration. For the past 20 + years you have been
there with me every step of the way. Not only are you the “BEST Wife” in the world you are my
partner in crime. Christian, Trinity, Keira, Serena, Mickaila and Mackenzie, you kids are so patient
with your dear old dad when he locks himself away in the office for yet another book. Taking the
time to watch you grow in life, sports, and become little leaders of this new world is incredible to
watch.
Thank you, Mom and Dad (Frank and Audry) and my brother Joe. You got me started in this crazy
IT world when I was so young. Brother, you mentored me along the way both coaching me in
hockey and helping me learn what you knew about PC’s and Servers. I’ll never forget us as
teenage kids working the IT Support contract for the local municipal government. Remember
dad had to drive us to site because you weren’t old enough to drive ourselves yet. A great
career starts with the support of your family and I’m so lucky because I have all the support one
could ever want.
A book like this filled with amazing Canadian MVP’s would not be possible without the support
from the #1 Microsoft Community Program Manager – Simran Chaudry. You have guided us
along the path and helped us to get better at what we do every day. Your job is tireless and
your passion and commitment make us want to do what we do even more.
Last but not least, the MVPDays volunteers, you have donated your time and expertise and
helped us run the event in over 20 cities across North America. Our latest journey has us
expanding the conference worldwide as a virtual conference. For those of you that will read this
book your potential is limitless just expand your horizons and you never know where life will take
you.
iv
About the Authors
Dave is well-known in the community as an evangelist for Microsoft, 1E, and Veeam
technologies. Locating Dave is easy as he speaks at several conferences and sessions each year,
including TechEd, Ignite, MVP Days Community Roadshow, and VeeamOn.
Recently Dave has been honored to take on the role of Conference Co-Chair of TechMentor with
fellow MVP Sami Laiho. The lineup of speakers and attendees that have been to this conference
over the past 20 years is really amazing. Come down to Redmond or Orlando in 2018 and you
can meet him in person.
As the founder and Managing Principal Consultant at TriCon Elite Consulting, Dave is a leading
technology expert for both local customers and large international enterprises, providing optimal
guidance and methodologies to achieve and maintain an efficient infrastructure.
BLOG: www.checkyourlogs.net
Twitter: @DaveKawula
v
About the Authors
He is an expert at scripting solutions and has an uncanny ability to reduce complexity and
maximize the functionality of PowerShell. Allan has recently rejoined the TriCon Elite Consulting
team again as a Principal Consultant.
BLOG: http://www.checkyourlogs.net
Twitter: @allanrafuse
vi
About the Authors
Cristal can be found speaking at Microsoft Ignite, MVPDays, and other local user groups. She is
extremely active in the community and has recently helped publish a book for other Women
MVP’s called Voices from the Data Platform.
BLOG: http://www.checkyourlogs.net
Twitter: @supercristal1
vii
About the Authors
Cary Sun is CISCO CERTIFIED INTERNETWORK EXPERT (CCIE No.4531) and MCSE, MCIPT, Citrix
CCA with over twenty years in the planning, design, and implementation of network technologies
and Management and system integration. Background includes hands-on experience with multi-
platform, all LAN/WAN topologies, network administration, E-mail and Internet systems, security
products, PCs and Servers environment. Expertise analyzing user’s needs and coordinating
system designs from concept through implementation. Exceptional analysis, organization,
communication, and interpersonal skills. Demonstrated ability to work independently or as an
integral part of team to achieve objectives and goals. Specialties: CCIE /CCNA / MCSE / MCITP /
MCTS / MCSA / Solution Expert / CCA
Cary’s is a very active blogger at checkyourlogs.net and always available online for questions
from the community. He passion about technology is contagious and he makes everyone around
him better at what they do.
Blog:http://www.checkyourlogs.net
Twitter:@SifuSun
viii
About the Authors
ix
Contents
Contents
Acknowledgements ...................................................................................................... iv
From Dave ............................................................................................................. iv
Contents......................................................................................................................... x
Introduction ................................................................................................................. 16
Chapter 1...................................................................................................................... 20
Pre-Requisites ............................................................................................................. 20
Lab Server Names .................................................................................................... 20
Building the Lab with BigDemo_Insider.PS1 ............................................................. 22
Enable Routing in the Lab ......................................................................................... 27
Software Requirements ............................................................................................ 41
Virtual Machine Manager Accounts Required for Build ......................................... 43
x
Contents
Add a 2 VHDx drives to the VMM Server for the SQL Install ..................................... 47
Install Windows ADK 1709 ........................................................................................ 56
SQL Command Line Utilities ..................................................................................... 59
Chapter 2...................................................................................................................... 60
Chapter 3...................................................................................................................... 80
Chapter 4...................................................................................................................... 89
xi
Contents
xiii
Contents
Host Patching of Storage Spaces Direct (S2D) with VMM ...................................... 247
Patching Storage Spaces Direct nodes with VMM .................................................. 247
Check the Health of Your Virtual Disks before going into Maintenance Mode .... 247
Scan S2D Hyper-V Hosts for Compliance .......................................................... 249
Put the Node into Maintenance Mode ................................................................ 251
Remediate Hosts................................................................................................ 254
Turn off Maintenance Mode on the Host and verify Storage Spaces Direct Health
........................................................................................................................... 256
xiv
Contents
Configuring Deduplication for ReFS and Storage Spaces Direct .......................... 290
Enable Deduplication on a Cluster Shared Volume ............................................ 290
Join us at MVPDays and meet great MVP’s like this in person .............................. 334
Live Presentations .................................................................................................. 334
Video Training......................................................................................................... 334
Live Instructor-led Classes ...................................................................................... 335
Consulting Services ................................................................................................ 335
Twitter ..................................................................................................................... 336
xv
Introduction North American MVPDays Community Roadshow
Introduction
MVPDays was founded by Cristal and Dave Kawula back in 2013. It started as a simple idea;
“There’s got to be a good way for Microsoft MVPs to reach the IT community and share their
vast knowledge and experience in a fun and engaging way” I mean, what is the point in
recognizing these bright and inspiring individuals, and not leveraging them to inspire the
community that they are a part of.
Anyone that has an interest in technology, is eager to learn, and wants to meet other like-
minded individuals. This Roadshow is not just for Microsoft MVP’s it is for anyone in the IT
Community.
Make sure you check out the MVPDays website at: www.mvpdays.com. You never know maybe
the roadshow will be coming to a city near you.
The goal of this particular book is to bring you real world step-by-step guidance from our expert
MVP Authors on Microsoft System Center Virtual Machine Manager. It has been completely
updated to feature Windows Server Insiders 17079 and the latest build of SCVMM. These are
the same experts you come to see in person at the MVPDays Roadshow. This book is written in
the format of a Step-by-Step learning guide. We really hope you find some immense value in
what we have written.
16
Introduction North American MVPDays Community Roadshow
17
Introduction North American MVPDays Community Roadshow
Sample Files
All sample files for this book can be downloaded from www.checkyourlogs.net and
www.github.com/dkawula
Additional Resources
In addition to all tips and tricks provided in this book, you can find extra resources like articles
and video recordings on our blog http://www.checkyourlogs.net.
18
Introduction North American MVPDays Community Roadshow
19
Chapter 1 Pre-Requisites
Chapter 1
Pre-Requisites
Lab Server Names
The follow table describes the required Virtual Machines to build this lab. This lab is designed to
be built on a Hyper-V Host Server with a minimum of 16 GB of RAM. An automation script called
BigDemo_Insider.PS1 has been used to provision this lab environment. A copy of this script can
be found in the appendices.
20
Chapter 1 Pre-Requisites
21
Chapter 1 Pre-Requisites
2. Open an administrative
Invoke-WebRequest -Uri "
PowerShell prompt and https://raw.githubusercontent.com/dkawula/Deploying-
System-Center-Virtual-Machine-Manager-
type: 2016/master/BigDemo_Insider.ps1" -OutFile "C:\Post-
Install\BigDemo_Insider.PS1"
22
Chapter 1 Pre-Requisites
5. Copy
BigDemo_Insider.PS1
from C:\Post-Install to
F:\DCBuild_Insider
6. Open
BigDemo_Insider.PS1
with the PowerShell ISE
edit lines 425 and 434
putting in Your Product
key received with the
EVAL Version of Windows
Server 2016 Downloaded
above
23
Chapter 1 Pre-Requisites
Save
BigDemo_Insider.PS1
8. Open an administrative
PowerShell prompt. Run
BigDemo_Insider.PS1
WorkingDir:
f:\DCBuild_Insider
Organization: MVPDays
Rockstars
TimeZone: Mountain
Standard Time
AdminPassword:
P@ssw0rd
DomainName:
MVPDays.com
DomainAdminPassword:
P@ssw0rd
24
Chapter 1 Pre-Requisites
VirtualSwitchName:
MVPDays_VMM_VSwitch
Subnet: 172.16.100.
ExtraLabFiles: C:\
9. It will take
approximately 1 hour
to build the Lab
Environment
25
Chapter 1 Pre-Requisites
26
Chapter 1 Pre-Requisites
27
Chapter 1 Pre-Requisites
28
Chapter 1 Pre-Requisites
Internet: 192.168.0.254
Subnet = 255.255.255.0
Gateway = 192.168.0.1
29
Chapter 1 Pre-Requisites
30
Chapter 1 Pre-Requisites
31
Chapter 1 Pre-Requisites
32
Chapter 1 Pre-Requisites
33
Chapter 1 Pre-Requisites
34
Chapter 1 Pre-Requisites
35
Chapter 1 Pre-Requisites
36
Chapter 1 Pre-Requisites
37
Chapter 1 Pre-Requisites
38
Chapter 1 Pre-Requisites
39
Chapter 1 Pre-Requisites
40
Chapter 1 Pre-Requisites
Software Requirements
The following table provides a summary of the Microsoft software that is used in this guide.
41
Chapter 1 Pre-Requisites
42
Chapter 1 Pre-Requisites
43
Chapter 1 Pre-Requisites
The Computer Accounts as they have been joined to the MVPDays Domain
44
Chapter 1 Pre-Requisites
45
Chapter 1 Pre-Requisites
46
Chapter 1 Pre-Requisites
Right-Click on VMM01
and click Settings
47
Chapter 1 Pre-Requisites
3. Click New
48
Chapter 1 Pre-Requisites
Name: VMM01-D.VHDX
Location:
F:\DCBuild_Insider\VMs
\
49
Chapter 1 Pre-Requisites
50
Chapter 1 Pre-Requisites
51
Chapter 1 Pre-Requisites
52
Chapter 1 Pre-Requisites
53
Chapter 1 Pre-Requisites
54
Chapter 1 Pre-Requisites
55
Chapter 1 Pre-Requisites
8. Click Next
56
Chapter 1 Pre-Requisites
Deployment Tools
Windows Pre-installation Environment
(Windows PE)
57
Chapter 1 Pre-Requisites
58
Chapter 1 Pre-Requisites
https://www.microsoft.com
/en-
ca/download/details.aspx?i
d=36434
2. Install msodbcsql.msi
3. Accept all defaults
4. Install
MSSqlCmdLnUtils.msi
5. Accept all defaults
59
Chapter 2 Install SQL Server 2016 SP1
Chapter 2
For the purpose of this book we have pre-created the SQL Service account as part of the
DCBuild_Insider1 Script.
Note: These accounts must have Log on as a Service rights on the SQL server. This can be
achieved via Group Policy or via local policy. You cannot set via local policy if a domain group
policy is already setting a list of user accounts that can log in as a service.
The policy is configured at Computer Configuration -> Policies -> Windows Settings -> Security
Settings -> Local Policies -> User Rights Assignment and the setting is Log on as a Service.
For the purpose of this book / lab we have added the SVC_SQL Service account as a local
administrator on the VMM01 Server.
60
Chapter 2 Install SQL Server 2016 SP1
1. Logon to VMM01 as
MVPDays\Administrator
4. Navigate to Inbound
rules
61
Chapter 2 Install SQL Server 2016 SP1
9. Click Next
62
Chapter 2 Install SQL Server 2016 SP1
63
Chapter 2 Install SQL Server 2016 SP1
64
Chapter 2 Install SQL Server 2016 SP1
1. Logon to VMM01 as
MVPDays\Administrator
2. Mount SQL media to the Media available from the volume license download site
media drive of the site
server
3. Open File Explorer,
navigate to Computer
and then double-click
the Media Drive
4. When prompted by
User Account Control
(UAC), click Yes to
continue with the
installation.
5. The SQL Server
Installation Center
screen launches
65
Chapter 2 Install SQL Server 2016 SP1
66
Chapter 2 Install SQL Server 2016 SP1
4. Click Next
7. Click Next
67
Chapter 2 Install SQL Server 2016 SP1
68
Chapter 2 Install SQL Server 2016 SP1
69
Chapter 2 Install SQL Server 2016 SP1
the P@ssw0rd.
70
Chapter 2 Install SQL Server 2016 SP1
71
Chapter 2 Install SQL Server 2016 SP1
72
Chapter 2 Install SQL Server 2016 SP1
73
Chapter 2 Install SQL Server 2016 SP1
1. Logon to VMM01 as
74
Chapter 2 Install SQL Server 2016 SP1
75
Chapter 2 Install SQL Server 2016 SP1
1. Logon to VMM01
as
MVPDays\Administrat
or
3. Click Connect to
connect to the
local database
76
Chapter 2 Install SQL Server 2016 SP1
4. Within the
Management
Studio, right-click
the Server and
select Properties
77
Chapter 2 Install SQL Server 2016 SP1
5. Select the
Memory node
6. Reset the
maximum
memory to one
half the memory
of the site server.
In other words, if
the site server is
configured with 16
GB of RAM,
configure SQL to
only consume 8
GB maximum.
78
Chapter 2 Install SQL Server 2016 SP1
7. Save settings.
8. If available
configure VMM01
with 16 GB of
RAM
Configuration
Manager will
perform better in
the lab with 16 GB
of RAM
79
Chapter 3 Install System Center Virtual Machine Manager Version 1711
Chapter 3
1. Logon to VMM as
MVPDays\Administrator
80
Chapter 3 Install System Center Virtual Machine Manager Version 1711
81
Chapter 3 Install System Center Virtual Machine Manager Version 1711
1. Logon to VMM01 as
MVPDays\Administr
ator
2. Browse to d:\System
Center Virtual
Machine Manager
3. Run Setup.exe
4. Click on Install
82
Chapter 3 Install System Center Virtual Machine Manager Version 1711
5. On the Select
Features to Install
page select VMM
Management Server
and VMM Console,
and then click Next
6. On the Product
Registration
Information fill in
your details. Thanks
for the Easter Egg in
the Script
@MrThomasRayner
83
Chapter 3 Install System Center Virtual Machine Manager Version 1711
8. On the Diagnostic
and Usage Data page
click Next
84
Chapter 3 Install System Center Virtual Machine Manager Version 1711
9. On the Installation
Location page
change the path to
D:\Program
Files\Microsoft
System Center
2016\Virtual
Machine Manager
85
Chapter 3 Install System Center Virtual Machine Manager Version 1711
86
Chapter 3 Install System Center Virtual Machine Manager Version 1711
87
Chapter 3 Install System Center Virtual Machine Manager Version 1711
88
Chapter 4 Base Configuration of VMM
Chapter 4
1. Logon to VMM01 as
MVPDays\Administr
ator
89
Chapter 4 Base Configuration of VMM
Name: MVPDays-
Admin
User Name:
MVPDays\MVPDays-
Admin
Password: P@ss0wrd
90
Chapter 4 Base Configuration of VMM
1. Logon to VMM01 as
MVPDays\Administr
ator
91
Chapter 4 Base Configuration of VMM
Name: MVPDays-
Admin
User Name:
MVPDays\MVPDays-
Admin
Password: P@ss0wrd
92
Chapter 4 Base Configuration of VMM
1. Logon to VMM01 as
MVPDays\Administrator
3. Type MVPDays HQ
93
Chapter 4 Base Configuration of VMM
94
Chapter 4 Base Configuration of VMM
1. Logon to VMM01 as
MVPDays\Administra
tor
95
Chapter 4 Base Configuration of VMM
3. On the Resource
Location page ensure
Windows Server
Computers in a
Trusted Active
Directory Domain is
selected and click
Next
96
Chapter 4 Base Configuration of VMM
97
Chapter 4 Base Configuration of VMM
8. On the Target
Resources page select
all of the Hyper-V
Servers and click Next
98
Chapter 4 Base Configuration of VMM
99
Chapter 4 Base Configuration of VMM
100
Chapter 5 Configuring Host Networking for S2D with VMM
Chapter 5
https://community.mellanox.com/docs/DOC-2778
We will be emulating this design in our lab by Virtualizing the components on our Nested Hyper-
V environment in Azure.
101
Chapter 5 Configuring Host Networking for S2D with VMM
102
Chapter 5 Configuring Host Networking for S2D with VMM
IP: 172.16.100.100-150/24
GW: 172.16.100.254
DNS: 172.16.100.1
103
Chapter 5 Configuring Host Networking for S2D with VMM
##
##
##
##
## MLAG protocol
##
protocol mlag
##
##
interface port-channel 1
104
Chapter 5 Configuring Host Networking for S2D with VMM
##
## LAG configuration
##
lacp
105
Chapter 5 Configuring Host Networking for S2D with VMM
##
## VLAN configuration
##
vlan 616-621
vlan 666
vlan 999
106
Chapter 5 Configuring Host Networking for S2D with VMM
107
Chapter 5 Configuring Host Networking for S2D with VMM
##
## STP configuration
##
no spanning-tree
##
## L3 configuration
##
interface loopback 0
108
Chapter 5 Configuring Host Networking for S2D with VMM
##
##
##
## LLDP configuration
##
lldp
##
##
109
Chapter 5 Configuring Host Networking for S2D with VMM
##
## MAGP configuration
##
protocol magp
##
## MLAG configurations
110
Chapter 5 Configuring Host Networking for S2D with VMM
##
no mlag shutdown
##
##
##
## SNMP configuration
##
##
##
111
Chapter 5 Configuring Host Networking for S2D with VMM
##
##
##
##
112
Chapter 5 Configuring Host Networking for S2D with VMM
System Deployment
Install and Configure Data Center Bridging – Optional
The Steps below will configure the core roles for Storage Spaces Direct Nodes including the
settings for Data Center Bridging in the lab. Failover Clustering and Hyper-V have been pre-
deployed as part of the BigDemo_Insider.PS1 Script. If you are following this lab guide in Azure
or nested in Hyper-V you can skip this step because RDMA is not supported in this configuration.
We will however document it so you can see how to deploy it. If you want refer to the book
Master Storage Spaces Direct for more details on how to Setup RDMA and RoCE properly.
It is a best practice to not configure RDMA if your adapters and environment don’t support it.
113
Chapter 5 Configuring Host Networking for S2D with VMM
114
Chapter 5 Configuring Host Networking for S2D with VMM
Note: Remember that Windows Insider build 17079 only comes as Server Core. With this we
will need to take all of our UI Steps and convert them to PowerShell Remoting for all
management tasks. In a properly managed S2D Environment this isn’t an issue as all tasks
should be performed remotely anyway.
The LOM network Adapters will be used for the MGMT SET Team and the Riser network adapters
will be used for the Storage SET Team.
115
Chapter 5 Configuring Host Networking for S2D with VMM
Note: Although in the steps below we identify the VLAN’s that will be tagged for a production
like deployment. You should just leave all the VLAN fields blank for this setup as at this time we
cannot pass VLAN Traffic over the Private Virtual Switch and the associated teams that we are
building in the Nested Virtualization environments. We are exploring some extended Software
Defined Networking options for future releases of this book. For, now these steps are pretty
much production ready and we want to leave them that way.
If you do configure with the VLANs everything will still work in the lab. You will just see a
partitioned network in Failover Cluster Manager because the VLAN’s are not passing through the
Private VSwitch.
116
Chapter 5 Configuring Host Networking for S2D with VMM
117
Chapter 5 Configuring Host Networking for S2D with VMM
118
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
119
Chapter 5 Configuring Host Networking for S2D with VMM
7. On the IP Address
Range page click Next
120
Chapter 5 Configuring Host Networking for S2D with VMM
121
Chapter 5 Configuring Host Networking for S2D with VMM
122
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
123
Chapter 5 Configuring Host Networking for S2D with VMM
124
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrato
r
125
Chapter 5 Configuring Host Networking for S2D with VMM
126
Chapter 5 Configuring Host Networking for S2D with VMM
127
Chapter 5 Configuring Host Networking for S2D with VMM
128
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
129
Chapter 5 Configuring Host Networking for S2D with VMM
130
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administra
tor
131
Chapter 5 Configuring Host Networking for S2D with VMM
7. On the IP Address
Range page click Next
132
Chapter 5 Configuring Host Networking for S2D with VMM
133
Chapter 5 Configuring Host Networking for S2D with VMM
134
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
135
Chapter 5 Configuring Host Networking for S2D with VMM
136
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administra
tor
137
Chapter 5 Configuring Host Networking for S2D with VMM
7. On the IP Address
Range page click Next
138
Chapter 5 Configuring Host Networking for S2D with VMM
139
Chapter 5 Configuring Host Networking for S2D with VMM
140
Chapter 5 Configuring Host Networking for S2D with VMM
141
Chapter 5 Configuring Host Networking for S2D with VMM
142
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
143
Chapter 5 Configuring Host Networking for S2D with VMM
7. On the IP Address
Range page change the
range to
172.16.100.150-250
click Next
144
Chapter 5 Configuring Host Networking for S2D with VMM
145
Chapter 5 Configuring Host Networking for S2D with VMM
146
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
147
Chapter 5 Configuring Host Networking for S2D with VMM
148
Chapter 5 Configuring Host Networking for S2D with VMM
149
Chapter 5 Configuring Host Networking for S2D with VMM
150
Chapter 5 Configuring Host Networking for S2D with VMM
151
Chapter 5 Configuring Host Networking for S2D with VMM
152
Chapter 5 Configuring Host Networking for S2D with VMM
153
Chapter 5 Configuring Host Networking for S2D with VMM
NOTE: In Production
we would normally
select RDMA here if we
had RDMA Adapters.
As this is a Virtual Lab
we do not so leave it
unchecked.
154
Chapter 5 Configuring Host Networking for S2D with VMM
155
Chapter 5 Configuring Host Networking for S2D with VMM
156
Chapter 5 Configuring Host Networking for S2D with VMM
157
Chapter 5 Configuring Host Networking for S2D with VMM
Name: Cluster
Static: Cluster_IP_Pool
Classification: Host
Cluster Workload
158
Chapter 5 Configuring Host Networking for S2D with VMM
43. Click on
Storage_VSW01 and
click New Virtual
Network Adapter
Name: Live Migration
Static: Live Migration
_IP_Pool
Classification: Live
Migration Workload
44. Click on
Storage_VSW01 and
click New Virtual
Network Adapter
Name: MGMT
Static: MGMT_IP_Pool
Classification: Host
Management
159
Chapter 5 Configuring Host Networking for S2D with VMM
45. Click on
Storage_VSW01 and
click New Virtual
Network Adapter
Name: SMB1
Static: Storage_IP_Pool
Classification: Storage
46. Click on
Storage_VSW01 and
click New Virtual
Network Adapter
Name: SMB2
Static: Storage_IP_Pool
Classification: Storage
47. Click Next
160
Chapter 5 Configuring Host Networking for S2D with VMM
161
Chapter 5 Configuring Host Networking for S2D with VMM
162
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
163
Chapter 5 Configuring Host Networking for S2D with VMM
164
Chapter 5 Configuring Host Networking for S2D with VMM
165
Chapter 5 Configuring Host Networking for S2D with VMM
166
Chapter 5 Configuring Host Networking for S2D with VMM
and Storage_0 in
Network Site
Name: CorpNet
Static:
CorpNet_IP_Pool
Classification: High
Bandwidth
167
Chapter 5 Configuring Host Networking for S2D with VMM
168
Chapter 5 Configuring Host Networking for S2D with VMM
VMM_Netoworking_S2D.PS1 Script
All of the steps above have been captured in the following script. We have cleaned up the code
to remove the -ID’s and replaced with -Name to make readable. This script can be easily
customized for your production VMM builds.
<#
Created: 2018-02-02
Version: 1.0
Homepage: http://www.checkyourlogs.net
Disclaimer:
This script is provided "AS IS" with no warranties, confers no rights and
Twitter: @DaveKawula
Blog : http://www.checkyourlogs.net
.Synopsis
Sample Script to create the VMM Logical Networks for the Deploying
SCVMM Book
.DESCRIPTION
#>
169
Chapter 5 Configuring Host Networking for S2D with VMM
Import-Module VirtualMachineManager
#For the purpose of this book I haven't put any -VLanID's in... You can
modify as you like.
#Base Script is just copied from the VMM Console and modified
$allHostGroups = @()
$allSubnetVlan = @()
# Network Routes
$allNetworkRoutes = @()
# Gateways
$allGateways = @()
# DNS servers
170
Chapter 5 Configuring Host Networking for S2D with VMM
$allDnsServer = @()
# DNS suffixes
$allDnsSuffixes = @()
# WINS servers
$allWinsServers = @()
#endregion
$allHostGroups = @()
$allSubnetVlan = @()
# Network Routes
$allNetworkRoutes = @()
171
Chapter 5 Configuring Host Networking for S2D with VMM
# Gateways
$allGateways = @()
# DNS servers
$allDnsServer = @()
# DNS suffixes
$allDnsSuffixes = @()
# WINS servers
$allWinsServers = @()
#endregion
$allHostGroups = @()
$allSubnetVlan = @()
172
Chapter 5 Configuring Host Networking for S2D with VMM
# Network Routes
$allNetworkRoutes = @()
# Gateways
$allGateways = @()
# DNS servers
$allDnsServer = @()
# DNS suffixes
$allDnsSuffixes = @()
# WINS servers
$allWinsServers = @()
#endregion
$allHostGroups = @()
$allSubnetVlan = @()
173
Chapter 5 Configuring Host Networking for S2D with VMM
# Network Routes
$allNetworkRoutes = @()
# Gateways
$allGateways = @()
# DNS servers
$allDnsServer = @()
# DNS suffixes
$allDnsSuffixes = @()
# WINS servers
$allWinsServers = @()
#endregion
$allHostGroups = @()
$allSubnetVlan = @()
174
Chapter 5 Configuring Host Networking for S2D with VMM
# Network Routes
$allNetworkRoutes = @()
# Gateways
$allGateways = @()
# DNS servers
$allDnsServer = @("172.16.100.1")
# DNS suffixes
$allDnsSuffixes = @()
# WINS servers
$allWinsServers = @()
#endregion
175
Chapter 5 Configuring Host Networking for S2D with VMM
#For this book we are not Using RDMA in the Lab below is a sample with
RDMA Enabled
#New-SCVirtualNetworkAdapterNativePortProfile -Name
"Storage_Port_Profile" -Description "" -AllowIeeePriorityTagging $false -
AllowMacAddressSpoofing $false -AllowTeaming $false -EnableDhcpGuard
$false -EnableGuestIPNetworkVirtualizationUpdates $true -EnableIov $false
-EnableVrss $false -EnableIPsecOffload $true -EnableRouterGuard $false -
EnableVmq $true -EnableRdma $true -MinimumBandwidthWeight "50" -
RunAsynchronously
176
Chapter 5 Configuring Host Networking for S2D with VMM
$definitions = @()
177
Chapter 5 Configuring Host Networking for S2D with VMM
178
Chapter 5 Configuring Host Networking for S2D with VMM
#endregion
179
Chapter 5 Configuring Host Networking for S2D with VMM
$definitions = @()
#endregion
180
Chapter 5 Configuring Host Networking for S2D with VMM
181
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
182
Chapter 5 Configuring Host Networking for S2D with VMM
6. On the Physical
Adapters change to
Riser_P0 and Riser_P1
183
Chapter 5 Configuring Host Networking for S2D with VMM
184
Chapter 5 Configuring Host Networking for S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
185
Chapter 5 Configuring Host Networking for S2D with VMM
6. On the Physical
Adapters change to
LOM-P0
186
Chapter 5 Configuring Host Networking for S2D with VMM
187
Chapter 5 Configuring Host Networking for S2D with VMM
188
Chapter 6 Configure Failover Cluster and S2D with VMM
Chapter 6
1. Logon to VMM01 as
MVPDays\Administrat
or
189
Chapter 6 Configure Failover Cluster and S2D with VMM
190
Chapter 6 Configure Failover Cluster and S2D with VMM
191
Chapter 6 Configure Failover Cluster and S2D with VMM
CorpNet_IP_Pool and
click Next
192
Chapter 6 Configure Failover Cluster and S2D with VMM
193
Chapter 6 Configure Failover Cluster and S2D with VMM
194
Chapter 7 Configure Storage Integration of S2D with VMM
Chapter 7
1. Logon to VMM01 as
MVPDays\Administrato
r
2. In the Fabric
WorkSpace click on
Storage, right-click on
Providers and click Add
Storage Devices
195
Chapter 7 Configure Storage Integration of S2D with VMM
196
Chapter 7 Configure Storage Integration of S2D with VMM
5. Unfortunately, at this
time it looks like the
Storage Provider for the
Insiders Build isn’t
supported in VMM.
6. It’s not a big deal for
this book as I will leave
the rest of the follow
steps in and we will just
add some steps to
manually create the
Cluster Shared Volumes
with S2D.
7. Generally, these steps
should change that
much and we will
update the book once
we know more from
Microsoft.
8.
9.
10.
11.
12.
197
Chapter 7 Configure Storage Integration of S2D with VMM
Note: At the time of writing this book the Storage Providers for the Windows Insiders Build
17079 were not working so we could not complete the steps in this task. Continue to the next
task where we show how to manually create the Cluster Shared Volumes for this book.
1. Logon to VMM01 as
MVPDays\Administrat
or
198
Chapter 7 Configure Storage Integration of S2D with VMM
3. Click on Shared
Volumes
4. On the Shared
Volumes page click
Add
5. On the Select a
Storage Pool page type
CSV01 in the Name and
select Tier 0 – SSD in
the Classification field
and then click Next
199
Chapter 7 Configure Storage Integration of S2D with VMM
Although it doesn’t
look like anything was
created the job will
proceed as soon as you
click OK
200
Chapter 7 Configure Storage Integration of S2D with VMM
201
Chapter 7 Configure Storage Integration of S2D with VMM
1. Logon to VMM01 as
MVPDays\Administrator
2. Open an Administrative
icm -ComputerName S2D1 -ScriptBlock {New-Volume -
PowerShell Prompt and StoragePoolFriendlyName S2DPool -FileSystem
CSVFS_ReFS -Size 200GB -PhysicalDiskRedundancy 2 -
run the following: FriendlyName CSV_01 -Verbose}
202
Chapter 8 VM Templates
Chapter 8
VM Templates
1. Logon to AZHVHost
with an
Administrative
Account
2. Open Hyper-V
Manager, right-click
S2D1, and click
Shutdown.
203
Chapter 8 VM Templates
204
Chapter 8 VM Templates
1. Logon to VMM01
as
MVPDays\Adminis
trator
205
Chapter 8 VM Templates
ry\ISOs
6.
10. Open an
Administrative
PowerShell Prompt
and run
BaseImageBuilder.
PS1
206
Chapter 8 VM Templates
12. BaseImageBuilder
will download the
January CU and
add it to the
Windows Server
2016 Image this
whole process will
take approximately
30 minutes.
207
Chapter 8 VM Templates
d:\MSSCVMMLibra
ry\ Templates \
208
Chapter 8 VM Templates
209
Chapter 8 VM Templates
Real World Note: During the writing of this book a bug in SCVMM was identified where the
creation of VMM Templates would fail. The issue was resolved by fully patching the S2D nodes
and SCVMM Server with the latest Cumulative Update. Once this was completed the build of
the VMM Templates succeeded.
210
Chapter 8 VM Templates
1. Logon to VMM01 as
MVPDays\Administrator
2. In the Library
Workspace, click
Templates, and then
right-click on VM
Templates and select
Create VM Template
211
Chapter 8 VM Templates
5. On the VM Template
Identify page type
WS2016_Gold
6. On Generation select
Generation 2 and then
click Next
212
Chapter 8 VM Templates
7. On the Configure
hardware for the virtual
machine. You can
import settings from a
hardware profile or save
a new profile based on
your settings page
change the following:
Memory = 2048
Network = CorpNet
Availability = High
8. Once done click Next
9. On the Configure
identity, network
settings, and scripts for
the new virtual
machine. You can
import settings from a
guest OS profile or save
a new profile based on
your settings page
configure the following:
Guest OS Profile =
Create new Windows
operating System
customization settings
Admin Password =
P@ssw0rd
213
Chapter 8 VM Templates
Domain / Workgroup =
MVPDays.com
MVPDays-Admin run As
Account
Answer File =
WS2016_Gold_Disk_1.x
ml
214
Chapter 8 VM Templates
Deploying a VM Template
1. Logon to VMM01 as
MVPDays\Administrat
or
215
Chapter 8 VM Templates
5. On the Select a VM
Template, Virtual Hard
Disk, or Virtual
Machine as the source
for the new Virtual
Machine select
WS2016_Gold VM
Template, click OK,
and then click Next
216
Chapter 8 VM Templates
7. On the Configure
hardware for the
virtual machine. You
can import settings
from a hardware
profile or save a new
profile based on your
settings page click
Next
8. On the Configure
identity, network
settings, and scripts
for the new virtual
machine. You can
import settings form a
guest OS profile or
save a new profile
based on your settings
page click Next
217
Chapter 8 VM Templates
9. On the Choose
whether to deploy or
store the virtual
machine page click
Next
218
Chapter 8 VM Templates
219
VM Templates
220
Chapter 9 Host Patch Management with VMM
Chapter 9
1. Logon to VMM01 as
MVPDays\Administra
tor
2. In Server Manager,
click Manage, and
then click add Roles
and Features.
221
Chapter 9 Host Patch Management with VMM
4. In the select
installation type
page, confirm that
Role-based or
feature-based
installation option is
selected and click
Next
5. On the select
destination server
page, click Next.
222
Chapter 9 Host Patch Management with VMM
7. On the select
features page. retain
the default selections,
and then click Next.
223
Chapter 9 Host Patch Management with VMM
8. On the Windows
Server Update
Services page, click
Next.
224
Chapter 9 Host Patch Management with VMM
225
Chapter 9 Host Patch Management with VMM
226
Chapter 9 Host Patch Management with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
227
Chapter 9 Host Patch Management with VMM
5. On the Choose
Upstream Server
page, Click Next
228
Chapter 9 Host Patch Management with VMM
229
Chapter 9 Host Patch Management with VMM
230
Chapter 9 Host Patch Management with VMM
231
Chapter 9 Host Patch Management with VMM
232
Chapter 9 Host Patch Management with VMM
233
Chapter 9 Host Patch Management with VMM
234
Chapter 9 Host Patch Management with VMM
1. Logon to VMM01 as
MVPDays\Administrator
235
Chapter 9 Host Patch Management with VMM
1. Logon to VMM01 as
MVPDays\Administrator
236
Chapter 9 Host Patch Management with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
237
Chapter 9 Host Patch Management with VMM
238
Chapter 9 Host Patch Management with VMM
8. Click on the
Assignment Scope in
the left and select
MVPDays HQ and then
click OK
239
Chapter 9 Host Patch Management with VMM
240
Chapter 9 Host Patch Management with VMM
1. Logon to VMM01
as
MVPDays\Admini
strator
241
Chapter 9 Host Patch Management with VMM
5. Select S2DCluster
and click Scan
6. The status should
chance to
Scanning
I did some
research and there
is a fix in the
October 2017
Cumulative
Update. So, I
242
Chapter 9 Host Patch Management with VMM
243
Chapter 9 Host Patch Management with VMM
244
Chapter 9 Host Patch Management with VMM
Remediate Hosts
1. Logon to VMM01 as
MVPDays\Administrator
245
Chapter 9 Host Patch Management with VMM
246
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
Chapter 10
1. Logon to S2D1 as
MVPDays\Administrat
or
Prompt as
Administrator and
type:
247
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
248
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
249
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
250
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
1. Logon to VMM01 as
MVPDays\Administrat
or
251
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
252
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
253
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
Remediate Hosts
9. Logon to VMM01 as
MVPDays\Administrator
254
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
255
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
256
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
Notice the
Storage Job
running. Re-
Run Get-
StorageJob until
there are no
more jobs
queued up and
Get-VirtualDisk
has returned to
a healthy state
257
Chapter 10 Host Patching of Storage Spaces Direct (S2D) with VMM
5. After the
Storage Jobs
have completed
you can now
return to the
VMM Console
6. At this time
once the jobs
have completed
successfully can
you repeat the
steps and patch
(Remediate) the
next node.
258
Chapter 11 Operational Maintenance of Storage Spaces Direct
Chapter 11
Operational Maintenance of
Storage Spaces Direct
Restarting Storage Spaces Direct nodes with
VMM
Direct from the Storage Spaces Direct community Kristopher Jon Turner has done a really nice
job documenting the process to properly restart S2D nodes. Thanks for letting me use your
notes in the book we really appreciate it.
One of the common maintenance tasks is restarting a node due to patching or some other task
that may require the node to be restarted. Normally within VMM you would just right click a
node in the cluster, select Start Maintenance Mode, then wait for the VM’s on that node to
migrate off to the other nodes in that cluster. Restart the node then wait for the node to come
up, right click and select Stop Maintenance Mode and bingo you are ready to put the next node
into Maintenance mode and restart that one. With S2D clusters, you can’t do that and
shouldn’t do that!
If you go to the Microsoft Doc’s page, Taking a Storage Spaces Direct server offline for
maintenance they do explain how to properly restart a node in the cluster as a standalone S2D
cluster. On the Microsoft’s Doc page for VMM the only thing I could find is how to put a node
into maintenance mode.
https://docs.microsoft.com/en-us/windows-server/storage/storage-spaces/maintain-servers
259
Chapter 11 Operational Maintenance of Storage Spaces Direct
1. Logon to S2D1 as
MVPDays\Administrat
or
Prompt as
Administrator and
type:
260
Chapter 11 Operational Maintenance of Storage Spaces Direct
1. Logon to VMM01 as
MVPDays\Administra
tor
261
Chapter 11 Operational Maintenance of Storage Spaces Direct
262
Chapter 11 Operational Maintenance of Storage Spaces Direct
PowerShell Prompt
and typing
263
Chapter 11 Operational Maintenance of Storage Spaces Direct
264
Chapter 12 Bonus Community Content - Storage Spaces Direct (S2D) Scripts
Chapter 12
https://github.com/SerreRom/TechCoffee/blob/master/PowerShell/Audit-S2D/Audit-S2D.ps1
1. Logon to
VMM01 as
MVPDays\Admi
nistrator
265
Chapter 12 Bonus Community Content - Storage Spaces Direct (S2D) Scripts
3. Open an
Administrative
PowerShell
Prompt and run
the S2D-Audit-
S2D.PS1 script
When prompter
type:
Cluster =
s2dcluster
Domain Name =
MVPDays.com
Path = .\
4. When prompted
for credentials
type
MVPDays\Admi
nistrator
266
Chapter 12 Bonus Community Content - Storage Spaces Direct (S2D) Scripts
267
Chapter 12 Bonus Community Content - Storage Spaces Direct (S2D) Scripts
At the time of writing this book I was playing around with my network settings in the lab. And
look the script picked up my issues.
268
Chapter 12 Bonus Community Content - Storage Spaces Direct (S2D) Scripts
269
Chapter 12 Bonus Community Content - Storage Spaces Direct (S2D) Scripts
270
Chapter 12 Bonus Community Content - Storage Spaces Direct (S2D) Scripts
This script works on disaggregated and Hyper-Converged S2D infrastructure. This script is written
to check the Health Service in Storage Spaces Direct Cluster across nodes. When the script
detects any issue in your S2D cluster, you will receive an HTML e-mail alert. (see example in this
repository).
$FromEmail = "fromemail@domain.com"
$ToEmail1 = "email1@domain.com"
$ToEmail2 = "email2@domain.com"
$smtpServer = "smtp.office365.com"
$Credential = Get-Credential
To run the script as recurring task, update the Cluster Name parameter in Monitor-S2D.ps1
script:
271
Chapter 12 Bonus Community Content - Storage Spaces Direct (S2D) Scripts
$ClusterName = "S2D-ClusterName"
Finally, save Monitor-S2D.ps1 script in a desired path, and then run the script named "Create-
S2DRecurringTask.ps1" in this repository to create a recurring S2D PowerShell task.
1. Logon to VMM01 as
MVPDays\Administrat
or
Invoke-WebRequest -Uri
https://raw.githubusercontent.com/CharbelNemnom/Pow
er-MVP-Elite/master/Monitor-S2D/Monitor-S2D.ps1 -
OutFile d:\Post-install\Monitor-S2D.PS1
272
Chapter 12 Bonus Community Content - Storage Spaces Direct (S2D) Scripts
Here is a sample of the automated email that can be used as part of this solution:
273
Chapter 12 Bonus Community Content - Storage Spaces Direct (S2D) Scripts
https://gallery.technet.microsoft.com/Storage-Spaces-Direct-6cafe551#content
This S2D-Monitor (v0.8.2) based on the Windows Server 2016 Health Service for daily
monitoring.
274
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
In addition, the service delivers the Faults and Actions of the cluster.
1. Logon to VMM01 as
MVPDays\Administrator
275
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
3. Execute Monitor-
S2D.PS1 and click Collect
notice the nice output
here. Marcel has done
a great job with this little
tool I highly encourage
you to download it and
check it out.
276
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
https://www.starwindsoftware.com/starwind-manager
277
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
1. Logon to VMM01
as
MVPDays\Admini
strator
278
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
4. On the Welcome
to the StarWind
Manager Setup
Wizard page click
Next
5. On the End-User
License
Agreement page
select I Accept the
terms in the
license Agreement
and click Next
279
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
6. On the Custom
Setup page only
install the
Starwind Manager
Core and click
Next
7. On the Ready to
install Starwind
Manager page
click Install
8. Logon to S2D1 as
MVPDays\Admini
strator
280
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
281
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
282
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
15. On VMM01
browse to
http://127.0.0.1:8
100/client/
283
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
284
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
immediately show
up in the UI
285
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
Well folks that is going to about wrap up our time together in this book. We at MVPDays
publishing hope that you had a great time reading it and as always, we welcome your feedback.
286
Bonus Community Content - Storage Spaces Direct (S2D) Scripts
287
Chapter 13 Integrate VMM 1711 with Azure
Chapter 13
1. Logon to VMM01 as
MVPDays\Administrator
3. On the App
Registrations blade click
288
Chapter 13 Integrate VMM 1711 with Azure
New application
registration
4.
289
Chapter 14 Configuring Deduplication for ReFS and Storage Spaces Direct
Chapter 14
1. Logon to VMM01 as
MVPDays\Administrator
291
Chapter 14 Configuring Deduplication for ReFS and Storage Spaces Direct
running Get-
Dedupstatus
292
Chapter 14 Configuring Deduplication for ReFS and Storage Spaces Direct
12. Start the Dedup Jobs icm $nodes {Get-Dedupvolume | Start-Dedupjob -Type
Optimization -Full}
manually and view the
jobs
293
Chapter 14 Configuring Deduplication for ReFS and Storage Spaces Direct
294
Appendix BigDemo_Insider.PS1
Appendix
BigDemo_Insider.PS1
Here is a copy of the BigDemo_Insider.PS1 script that we used in the book. It can be
downloaded from: https://github.com/dkawula/Deploying-System-Center-Virtual-Machine-
Manager-2016/blob/master/BigDemo_Insider.PS1
<#
Created: 2018-02-01
Version: 1.0
Homepage: http://www.checkyourlogs.net
Disclaimer:
This script is provided "AS IS" with no warranties, confers no rights and
Twitter: @DaveKawula
Blog : http://www.checkyourlogs.net
Twitter: @MrThomasRayner
Blog : http://workingsysadmin.com
295
Appendix BigDemo_Insider.PS1
.Synopsis
.DESCRIPTION
The Parameters at the beginning of the script will setup the domain
name, organization name etc.
.EXAMPLE
.PARAMETER WorkingDir
.PARAMETER Organization
.PARAMETER Owner
.PARAMETER TimeZone
296
Appendix BigDemo_Insider.PS1
.PARAMETER AdminPassword
.PARAMETER DomainName
.PARAMETER DomainAdminPassword
.PARAMETER VirtualSwitchName
.PARAMETER Subnet
#>
#region Parameters
[cmdletbinding()]
param
[Parameter(Mandatory)]
[string]
$WorkingDir = 'c:\ClusterStoreage\Volume1\DCBuild',
[Parameter(Mandatory)]
[string]
[Parameter(Mandatory)]
[string]
297
Appendix BigDemo_Insider.PS1
[Parameter(Mandatory)]
[ValidateScript({ $_ -in
([System.TimeZoneInfo]::GetSystemTimeZones()).ID })] #ensure a valid
TimeZone was passed
[string]
[Parameter(Mandatory)]
[string]
$adminPassword = 'P@ssw0rd',
[Parameter(Mandatory)]
[string]
$domainName = 'MVPDays.Com',
[Parameter(Mandatory)]
[string]
$domainAdminPassword = 'P@ssw0rd',
[Parameter(Mandatory)]
[string]
[Parameter(Mandatory)]
[string]
298
Appendix BigDemo_Insider.PS1
$Subnet = '172.16.200.',
[Parameter(Mandatory)]
[string]
$ExtraLabfilesSource =
'C:\ClusterStorage\Volume1\DCBuild\Extralabfiles'
#endregion
#region Functions
function Wait-PSDirect
param
[string]
$VMName,
[Object]
$cred
'Test'
299
Appendix BigDemo_Insider.PS1
Start-Sleep -Seconds 1
Function Wait-Sleep {
param (
[int]$sleepSeconds = 60,
[string]$titleColor = "Yellow"
Start-Sleep 1
function Restart-DemoVM
param
300
Appendix BigDemo_Insider.PS1
[string]
$VMName
stop-vm $VMName
start-vm $VMName
function Confirm-Path
param
[string] $path
if (!(Test-Path $path))
function Write-Log
param
[string]$systemName,
[string]$message
301
Appendix BigDemo_Insider.PS1
function Clear-File
param
[string] $file
if (Test-Path $file)
function Get-UnattendChunk
param
[string] $pass,
[string] $component,
[xml] $unattend
)
302
Appendix BigDemo_Insider.PS1
return $unattend.unattend.settings |
function New-UnattendFile
param
[string] $filePath
$unattend = $unattendSource.Clone()
303
Appendix BigDemo_Insider.PS1
$_.TimeZone = $Timezone
$_.UserAccounts.AdministratorPassword.Value = $adminPassword
$_.ProductKey = $WindowsKey
Clear-File $filePath
$unattend.Save($filePath)
function New-UnattendFile1
param
[string] $filePath
$unattend = $unattendSource.Clone()
304
Appendix BigDemo_Insider.PS1
$_.TimeZone = $Timezone
$_.UserAccounts.AdministratorPassword.Value = $adminPassword
Clear-File $filePath
$unattend.Save($filePath)
Function Initialize-BaseImage
Mount-DiskImage $ServerISO
Copy-Item -Path
"$($DVDDriveLetter):\NanoServer\NanoServerImageGenerator\Convert-
WindowsImage.ps1" -Destination "$($WorkingDir)\Convert-WindowsImage.ps1"
-Force
Import-Module -Name
"$($DVDDriveLetter):\NanoServer\NanoServerImagegenerator\NanoServerImageG
enerator.psm1" -Force
if (!(Test-Path "$($BaseVHDPath)\NanoBase.vhdx"))
New-UnattendFile "$WorkingDir\unattend.xml"
New-UnattendFile1 "$WorkingDir\unattend1.xml"
#Build the Windows 2016 Core Base VHDx for the Lab
306
Appendix BigDemo_Insider.PS1
if (!(Test-Path "$($BaseVHDPath)\VMServerBaseCore.vhdx"))
Set-Location $workingdir
. .\Convert-WindowsImage.ps1
$ConvertWindowsImageParam = @{
SourcePath = $ServerISO1
RemoteDesktopEnable = $True
Passthru = $True
Edition = "SERVERDATACENTERACORE"
VHDFormat = "VHDX"
SizeBytes = 60GB
WorkingDirectory = $workingdir
VHDPath = "$($BaseVHDPath)\VMServerBaseCore.vhdx"
DiskLayout = 'UEFI'
UnattendPath = "$($workingdir)\unattend1.xml"
#Build the Windows 2016 Full UI Base VHDx for the Lab
307
Appendix BigDemo_Insider.PS1
if (!(Test-Path "$($BaseVHDPath)\VMServerBase.vhdx"))
Set-Location $workingdir
. .\Convert-WindowsImage.ps1
$ConvertWindowsImageParam = @{
SourcePath = $ServerISO
RemoteDesktopEnable = $True
Passthru = $True
Edition = "ServerDataCenter"
VHDFormat = "VHDX"
SizeBytes = 60GB
WorkingDirectory = $workingdir
VHDPath = "$($BaseVHDPath)\VMServerBase.vhdx"
DiskLayout = 'UEFI'
UnattendPath = "$($workingdir)\unattend.xml"
Package = @(
"$($BaseVHDPath)\windows10.0-kb3213986-
x64_a1f5adacc28b56d7728c92e318d6596d9072aec4.msu"
308
Appendix BigDemo_Insider.PS1
Clear-File "$($BaseVHDPath)\unattend.xml"
Clear-File "$($BaseVHDPath)\unattend1.xml"
Dismount-DiskImage $ServerISO
Dismount-DiskImage $ServerISO1
#Clear-File "$($WorkingDir)\Convert-WindowsImage.ps1"
function Download-BaseImageUpdates
if (!(Test-Path "$($BaseVHDPath)\windows10.0-kb3213986-
x64_a1f5adacc28b56d7728c92e318d6596d9072aec4.msu"))
Invoke-WebRequest -Uri
http://download.windowsupdate.com/d/msdownload/update/software/secu/2016/
12/windows10.0-kb3213986-x64_a1f5adacc28b56d7728c92e318d6596d9072aec4.msu
-OutFile "$($BaseVHDPath)\windows10.0-kb3213986-
x64_a1f5adacc28b56d7728c92e318d6596d9072aec4.msu" -Verbose
function Invoke-DemoVMPrep
309
Appendix BigDemo_Insider.PS1
param
[string] $VMName,
[string] $GuestOSName,
[switch] $FullServer
remove-vm -Force
Clear-File "$($VMPath)\$($GuestOSName).vhdx"
if ($FullServer)
else
310
Appendix BigDemo_Insider.PS1
start-vm $VMName
function Create-DemoVM
param
[string] $VMName,
[string] $GuestOSName,
311
Appendix BigDemo_Insider.PS1
Set-DnsClientServerAddress -InterfaceIndex
$_.InterfaceIndex -ServerAddresses "$($Subnet)1"
Restart-DemoVM $VMName
function Invoke-NodeStorageBuild
param
312
Appendix BigDemo_Insider.PS1
[string]$VMName,
[string]$GuestOSName
Start-VM $VMName
313
Appendix BigDemo_Insider.PS1
Start-Sleep -Seconds 1
do
until ($?)
314
Appendix BigDemo_Insider.PS1
Restart-DemoVM $VMName
#endregion
$BaseVHDPath = "$($WorkingDir)\BaseVHDs"
$VMPath = "$($WorkingDir)\VMs"
#$ServerISO = "D:\DCBuild\10586.0.151029-
1700.TH2_RELEASE_SERVER_OEMRET_X64FRE_EN-US.ISO"
#$ServerISO = "d:\DCBuild\14393.0.160808-
1702.RS1_Release_srvmedia_SERVER_OEMRET_X64FRE_EN-US.ISO"
#ServerISO =
'D:\DCBuild\en_windows_server_2016_technical_preview_5_x64_dvd_8512312.is
o'
#$ServerISO =
'c:\ClusterStorage\Volume1\DCBuild\en_windows_server_2016_x64_dvd_9327751
.iso' #Updated for RTM Build 2016
315
Appendix BigDemo_Insider.PS1
$ServerISO =
'f:\dcbuild_Insider\en_windows_server_2016_x64_dvd_9718492.iso' #THIS
NEEDS to be Modified for your Lab
$ServerISO1 =
'F:\DCBuild_Insider\Windows_InsiderPreview_Server_17079.iso' #THIS NEEDS
to be Modified for your Lab
$unattendSource = [xml]@"
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<servicing></servicing>
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup"
processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>*</ComputerName>
<ProductKey><PRODUCTKEY></ProductKey>
<RegisteredOrganization>Organization</RegisteredOrganization>
<RegisteredOwner>Owner</RegisteredOwner>
<TimeZone>TZ</TimeZone>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup"
processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
316
Appendix BigDemo_Insider.PS1
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideLocalAccountScreen>true</HideLocalAccountScreen>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<AdministratorPassword>
<Value>password</Value>
<PlainText>True</PlainText>
</AdministratorPassword>
</UserAccounts>
</component>
<component name="Microsoft-Windows-International-Core"
processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-us</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UILanguageFallback>en-us</UILanguageFallback>
<UserLocale>en-us</UserLocale>
</component>
</settings>
</unattend>
"@
#endregion
317
Appendix BigDemo_Insider.PS1
Confirm-Path $BaseVHDPath
Confirm-Path $VMPath
. Download-BaseImageUpdates
. Initialize-BaseImage
. Initialize-BaseImage
318
Appendix BigDemo_Insider.PS1
$VMName = 'DC01'
$GuestOSName = 'DC01'
$IPNumber = '1'
Restart-DemoVM $VMName
319
Appendix BigDemo_Insider.PS1
Restart-DemoVM $VMName
$VMName = 'DHCP01'
$GuestOSName = 'DHCP01'
$IPNumber = '3'
Start-Sleep -Seconds 1
do
320
Appendix BigDemo_Insider.PS1
until ($?)
Restart-DemoVM $VMName
Start-Sleep -Seconds 1
foreach($i in 1..99)
321
Appendix BigDemo_Insider.PS1
Restart-DemoVM $VMName
$VMName = 'DC01'
$GuestOSName = 'DC01'
$IPNumber = '1'
param($VMName, $password)
do
Start-Sleep -Seconds 5
New-ADUser `
-Name 'Dave' `
-SamAccountName 'Dave' `
-DisplayName 'Dave' `
322
Appendix BigDemo_Insider.PS1
-ChangePasswordAtLogon $false `
until ($?)
param($VMName, $password)
do
Start-Sleep -Seconds 5
New-ADUser `
-Name 'SVC_SQL' `
-SamAccountName 'SVC_SQL' `
-DisplayName 'SVC_SQL' `
-ChangePasswordAtLogon $false `
until ($?)
323
Appendix BigDemo_Insider.PS1
param($VMName, $password)
do
Start-Sleep -Seconds 5
New-ADUser `
-Name 'SVC_VMM' `
-SamAccountName 'SVC_VMM' `
-DisplayName 'SVC_VMM' `
-ChangePasswordAtLogon $false `
until ($?)
param($VMName, $password)
do
324
Appendix BigDemo_Insider.PS1
Start-Sleep -Seconds 5
New-ADUser `
-Name 'MVPDays-Admin' `
-SamAccountName 'MVPDays-Admin' `
-DisplayName 'MVPDays-Admin' `
-ChangePasswordAtLogon $false `
until ($?)
<#>
325
Appendix BigDemo_Insider.PS1
</#>
$VMName = 'Management01'
$GuestOSName = 'Management01'
Start-Sleep -Seconds 1
do
until ($?)
326
Appendix BigDemo_Insider.PS1
Restart-DemoVM $VMName
$VMName = 'VMM01'
$GuestOSName = 'VMM01'
Start-Sleep -Seconds 1
do
until ($?)
$VMName = 'Router01'
327
Appendix BigDemo_Insider.PS1
$GuestOSName = 'Router01'
Start-Sleep -Seconds 1
do
until ($?)
328
Appendix BigDemo_Insider.PS1
$VMName = 'S2D1'
$GuestOSName = 'S2D1'
<#>
param ($domainName)
do
until ($?)
ipconfig.exe /flushdns
Start-Sleep -Seconds 1
} -ArgumentList $domainName
param ($domainName)
# This will match the configuration that was done in the book
} -ArgumentList $domainName
</#>
330
Appendix BigDemo_Insider.PS1
331
Appendix S2D-Audit.PS1
S2D-Audit.PS1
Here is a copy of the S2D-Audit.PS1 script that we used in the book. It can be downloaded from:
https://github.com/SerreRom/TechCoffee/blob/master/PowerShell/Audit-S2D/Audit-S2D.ps1
The script is quite long so grab a copy from the link above…
<#
.SYNOPSYS
.VERSION
.AUTHOR
Romain Serre
Blog: https://www.tech-coffee.net
Twitter: @RomSerre
#>
332
Appendix S2D-Audit.PS1
# ----------------------------------------------------------------
[CmdletBinding()]
param(
[Alias('S2DCluster')]
[string]$ClusterName,
[Alias('ComputerDomain')]
[String]$DomainName,
[Alias('ExportPath')]
[String]$Path,
[Alias('Cred')]
[PSCredential]$Credential
333
Contact Info Join us at MVPDays and meet great MVP’s like this in person
Contact Info
Live Presentations
Dave frequently speaks at Microsoft conferences around North America, such as TechEd,
VeeamOn, TechDays, and MVPDays Community Roadshow.
www.checkyourlogs.net
www.mvpdays.com
Video Training
For video-based training, see the following site:
www.mvpdays.com
334
Contact Info Join us at MVPDays and meet great MVP’s like this in person
www.truesec.com
www.checkyourlogs.net
Consulting Services
Dave and Cristal have worked with some of the largest companies in the world and have a
wealth of experience and expertise. Customer engagements are typically between two weeks
and six months.
335
Contact Info Join us at MVPDays and meet great MVP’s like this in person
Twitter
Dave, Cristal, Allan, Cary on Twitter tweet on the following aliases:
336