Importance to set Dynamic Memory Maximum in Hyper-V 2012

In my little lab it was quite the time to do an rearm of the servers licenses as I had installed them with the evaluation version. This can be done with the slmgr.vbs /rearm command and a reboot.

Screen Shot 2013-07-23 at 11.08.23

And when I came to the second server where the domain controller resides I noticed that it consumed a lot of memory for just having the DC role.

Screen Shot 2013-07-23 at 11.14.26

When looking a bit closer I noticed sessions where me and a colleague that have been logged in but in disconnected mode and consumed both CPU and memory. In almost every server this is not optimal where Admins can stay logged in forever and this can be handled with a GPO setting to restrict the time for a disconnected session on servers residing in a specific OU.

 

Screen Shot 2013-07-23 at 11.18.52

 Another problem was that when I created the DC VM I just activated the Dynamic memory without setting any limits and this could cause a host with no physical memory left and VM´s going crazy with allocated memory. Setting the Startup memory is important but also setting the Maximum RAM, I have as a best practice to set the startup and Maximum to the same values.

Screen Shot 2013-07-23 at 11.21.41

With PowerShell I easily could change the settings of the VM to have a more reasonable maximum value than 1TB. And as you can see with the -PassThrough parameter I can do it in one line.

Screen Shot 2013-07-25 at 11.18.34
PS C:\> get-vm dc01 | Stop-VM -Passthru | Set-VM -MemoryMaximumBytes 2GB -Passthru | Start-VM

And after the DC restarted you can see that it only consumes 624 MB RAM.

Screen Shot 2013-07-23 at 11.34.37

Download all System Center R2 eval VHD with PowerShell

I have already blogged about how to use PowerShell to download all of the System Center 2012 SP1 VHD evaluation files with PowerShell and BITS.

As Microsoft has released an updated version with Windows 2012 R2 and System Center 2012 R2 Preview I wanted to give you the script with updated url´s so you can easily download and try out the different roles! Note though that the Configuration Manager evaluation VHD has not yet been released, I still have the link in the script so when it will be available you can download it! They have also changed the packages to .bin instead of .rar.

Make sure that you have enough space on your volume and then run the following script and you will within a time that of course depends on your internet connection have all files necessary to start evaluate. I will update the script with the right size of R2 once I have downloaded all but think that 70 GB will be enough at lest now when SCCM is not available 🙂

# Download all SC 2012 R2 Preview VHD Eval
#
# Niklas Akerlund / Lumagate 2013-07-10

# Downloadfolder
$Dest = "D:\VHDEVALR2"
$SizeOfSCR2 = 70GB

# Get Space on volume
$SpaceRemaining = (Get-Volume $Dest.Split(":")[0]).SizeRemaining

if($SpaceRemaining -gt $SizeOfSCR2){
# SCVMM
((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/confirmation.aspx?id=34803").links | ? href -match "rar$|exe$|docx$|bin$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest}
# SCOM
((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/confirmation.aspx?id=34780").links | ? href -match "rar$|exe$|docx$|bin$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest}
# SCORCH
((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/confirmation.aspx?id=34778").links | ? href -match "rar$|exe$|docx$|bin$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest}
# SCAC
((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/confirmation.aspx?id=39369").links | ? href -match "rar$|exe$|docx$|bin$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest}
# SCDPM
((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/confirmation.aspx?id=34779").links | ? href -match "rar$|exe$|docx$|bin$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest}
# SCCM
((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/confirmation.aspx?id=39368").links | ? href -match "rar$|exe$|docx$|bin$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest}
# SCSM
((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/confirmation.aspx?id=34777").links | ? href -match "rar$|exe$|docx$|bin$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest}
# SCSM DW
((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/confirmation.aspx?id=39367").links | ? href -match "rar$|exe$|docx$|bin$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest}
}else{
[int]$Sum = ($SizeOfSCR2 - $SpaceRemaining)/1GB
Write-Host "Free up at least $Sum GB and try again!"
}

Start downloading and explore while your vacation rains away (actually the first day it rains here for some weeks)!