PowerShell cmdlets for managing Virtual disks
New-VHD -Path c:\mydesktop.vhdx
New-VHD -Path c:\mydesktopvhd.vhdx -sizeBytes 40GB -Dynamic
## New VHD with Format etc.
New-VHD -path C:\MyDesktopVHD.vhdx -dynamic -sizebytes 40GB | `
Mount-VHD -passthru | `
Initialize-Disk -passthru | `
New-Partition -assigndriveletter -usemaximumsize | `
Format-Volume -filesystem NTFS -confirm:$false -force
## end of new VHD
New-VHD -ComputerName hyperv1 -Path c:\vm1.vhdx -SizeBytes 40GB -Dynamic
Add-VMHardDiskDrive -ComputerName hyperv1 -VMName vm1 -Path c:\vm1.vhdx
# prepare VM for differencing disks
sysprep /generalize /oobe /shutdown
# create differencing disk
New-VHD -Path "C:\VHDs\Windows 7 Diff.VHDX" -ParentPath "C:\VHDs\Windows 7.VHDX" -Differencing
# create pass-through disk
New-VHD -path C:\Passthru.vhdx -dynamic -sizebytes 40GB | `
Mount-VHD -passthru | `
Initialize-Disk -passthru | `
set-disk -isoffline $true
#end of passthrough disk - now you can assign physical disk to VM in Hyper-V manager
 # hyper-v console - edit or inspect disk - get PowerShell cmdlets below
Get-Command | where name -like "*vhd*"
Resize-VHD -Path C:\vm1.vhdx -sizeBytes 120GB
Resize-VHD -Path C:\vm1.vhdx -ToMinimumSize
Checkpoint-VM -ComputerName hyperv1 -VMName vm2 -SnapshotName BeforeDoingSomethingAwful
vssadmin list writers  #run this in CMD prompt to see whether there is one for the application on the server
# ^ this is to determine if you can run production checkpoints ^

Step-by-Step: Creating Differencing Disks

Optimize-VHD cmdlet
- Mode Full
- Mode Quick
- Mode Retrim
- Mode Pretrimmed
- Mode Prezeroed (supports other file systems than just NTFS)
Optimize-VHD - with Mode explanation

Snapshots in VMware = Checkpoints
Choose between standard or production checkpoints in Hyper-V
- Careful with checkbox Create standard checkpoints if it's not possible to create a production checkpoint.

Fiber Channel and Hyper-V
Implement Hyper-V Virtual Fibre Channel

Shared VHDX files = new name VHD Sets
Create Hyper-V VHD Set files
Deploying VHD Sets on Windows Server 2016 Hyper-V
Configure storage QoS
Storage Quality of Service - Overview
Configure Storage Quality of Service

Hyper-V Networking
Understand NIC Teaming for Hyper-V
- Don't
- Third-party teaming
- Stand-alone LBFO (Load Balancing/Failover) teaming
- In-the-VM teaming
- Switch Embedded Teaming (new in Server 2016!, requires identical NICs)
- Full Microsoft SDN stack

Windows Server 2012 NIC Teaming (LBFO) Deployment and Management 
Remote Direct Memory Access (RDMA) and Switch Embedded Teaming (SET)

Configure NIC Teaming in VMs
- Two or more pNICs on Hyper-V host
- Multiple pSwitches on same Layer 2 subnet
- Create two external Hyper-V vSwitches, each to a different pNIC
- Connect VMs to both external vSwitches
- vNIC teams must be configured as Switch
- Independent using Address Hash mode
- Teams of >2 vNICs are possible but not supported
NIC Teaming in Virtual Machines (VMs)
Virtual Machine Queue (VMQ)

Create a virtual network - virtual switch in Hyper-V manager
Create a virtual switch for Hyper-V virtual machines

Set up a NAT network
Hyper-V Virtual Switch using NAT Configuration

New-VMSwitch -ComputerName hyperv1 -switchName NAT -switchType Internal
Get-NetAdapter #so you can get ifIndex
New-NetlPAddress -interfacelndex 16 -IPAddress 192.168.4.1 -PrefixLength 24
New-NetNat -Name NAT -InternalIPlnterfaceAddressPrefix "192.168.4.0/24"
Add-NetNatStaticMapping -NatName NAT -Protocol TCP -ExternalIPAddress 0.0.0.0 -InternalIPAddress 192.168.4.20 -InternalPort 80 -ExternalPort 80
help Add-VMNetworkAdapter
help set-VMNetworkAdapterIsolation
help set-VMNetworkAdaptervlan
Set-VMNetworkAdapter -MaximumBandwidth
Set-VMNetworkAdapter -MinimumBandwidthAbsolute
Set-VMNetworkAdapter -MinimumBandwidthWeight #number from 0-100
Set-VMNetworkAdapter -MacAddressSpoofing
Get-NetAdapterRss
set-NetAdapterVmq #disables RSS (Receive-side scaling)
New-VMSwitch -EnableEmbeddedTeammg $true -NetAdapterName "NIC1,NIC2"
help Enable-NetAdapterRdma


Understanding Hyper-V VLANs

Configure bandwidth management
Hyper-V Manager > VM > Settings > Hardware > Network Adapter > Enable Bandwidth management
Managing Virtual Machines in Hyper-V - Bandwidth Management

Legacy Network Adapter for Gen1 VMs - Hyper-V Virtual Machine Virtual Network Adapters Explained

How to Solve MAC Address Conflict on Hyper-V

Networking Blog - VMQ Deep Dive, 1 of 3
Virtual Machine Queue (VMQ) CPU assignment tips and tricks
RSS - Virtual Receive-side Scaling in Windows Server 2012 R2
Use Receive Side Scaling with Hyper-V