TechShizz | All posts tagged 'Server 2016'

Create Storage Pools, Virtual Disks and Volumes with Server Manager in Server 2012 / 2016

Here are the PowerShell Commands to complete:

# create a new storage pool
New-StoragePool -FriendlyName AllTheDisks -StorageSubSystemUniqueId (Get-StorageSubSystem).UniqueId -PhysicalDisks (Get-PhysicalDisk -CanPool $true)

# create virtual disk
New-VirtualDisk -FriendlyName CompanyData -StoragePoolFriendlyName AllTheDisks -Size 2TB -ProvisioningType Thin -ResiliencySettingName Mirror

# initialize underlying physical disks
Initialize-Disk -VirtualDisk (Get-VirtualDisk -FriendlyName CompanyData)

# partition and format volumes from virtual disk
$vd = Get-VirtualDisk -FriendlyName CompanyData | Get-Disk

$vd | 
    New-Partition -Size 100GB -Driveletter U |
            Format-Volume -FileSystem NTFS -AllocationUnitSize 4096 -NewFileSystemLabel "User Data"

$vd |     
    New-Partition -Size 500GB -Driveletter I |
        Format-Volume -FileSystem ReFS -AllocationUnitSize 4096 -NewFileSystemLabel "IT Data"

$vd | 
    New-Partition -Size 1TB -Driveletter V |
        Format-Volume -FileSystem ReFS -AllocationUnitSize 65536 -NewFileSystemLabel "VM Data"

 

Installing Nano Servers

To install a Nano server we need the Server 2016 ISO mounted and attached to the HV Host. we then run a series of PowerShell commands to installed the Nano Server.

#Import Nano server PS Module
Import-Module D:\NanoServer\NanoServerImageGenerator

#Create a basic NanoServer VHDX
New-NanoServerImage -MediaPath D: -BasePath .\Base -TargetPath .\NanoServer1.vhdx -DeploymentType Guest -Edition Datacenter -ComputerName NanoServer1 -AdministratorPassword (ConvertToSecureString -String 'Pa$$w0rd' -AsPlainText -Force)

#Create and Start the VM
New-VM -Name NanoServer1 -VHDPath .\NanoServer1.vhdx -MemoryStartupBytes 1GB -Generation 2 | Start-VM

#Begin Remote PowerShell session
Enter-PSSession -VMName NanoServer1

We can run the following to create a Nano Server with features already installed

#Import Nano server PS Module
Import-Module D:\NanoServer\NanoServerImageGenerator

#Create a NanoServer VHDX
New-NanoServerImage -MediaPath D: -BasePath .\Base -TargetPath .\NanoServer1.vhdx -DeploymentType Guest -Edition Datacenter -ComputerName NanoServer1 -InterfaceNameOrIndex Ethernet -Ipv4Address 192.168.16.10 -Ipv4SubnetMask 255.255.255.0 -Ipv4Gateway 192.168.16.1 -Ipv4Dns ("192.168.16.100","8.8.8.8") -Package Microsoft-NanoServer-IIS-Package -AdministratorPassword (ConvertToSecureString -String 'Pa$$w0rd' -AsPlainText -Force)

#View available packages
Get-NanoServerPackage -MediaPath D:

#create and start the VM
New-VM - Name NanoServer1 -VHDPath .\NanoServer1.vhdx -MemoryStartupByte 1GB -SwitchName vSwitch -Generatino 2 | Start-VM

#Start remote PS Session
Enter-PSSession -NMName NanoServer1

 

Remember, there is a GUI tool for this that can be downloaded at https://www.microsoft.com/en-us/download/details.aspx?id=54065

 

 

 

Using DISM to convert Server 2016 Evaluation License to a normal License

Scenario

We have a copy of server 2016 installed on an evaluation license and we want to license it with our company license. Datacenter edition of Server 2016 is required to do this conversion.

Solution

We can use the Automatic Virtual Machine Activation keys to convert the license. We use DISM to convert the license like this:

dism /online /Set-Edition:ServerStandardCor /ProductKey:C3RCX-M6NRP-6CXC9-TW2F2-4RHYD /AcceptEula

See More on Automatic Virtual Machine Activation https://technet.microsoft.com/en-us/library/dn303421(v=ws.11).aspx

AVMA keys
  

The following AVMA keys can be used for Windows Server 2012 R2.

Edition AVMA key
Datacenter Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TW
Standard DBGBW-NPF86-BJVTX-K3WKJ-MTB6V
Essentials K2XGM-NMBT3-2R6Q8-WF2FK-P36R2

The following AVMA keys can be used for Windows Server 2016.

Edition AVMA key
Datacenter TMJ3Y-NTRTM-FJYXT-T22BY-CWG3J
Standard C3RCX-M6NRP-6CXC9-TW2F2-4RHYD
Essentials B4YNW-62DX9-W8V6M-82649-MHBKQ