Monday, 29 July 2013

SPF Part 3 - Installing Virtual Machine Manager 2012 R2


Continuing the adventure of trying to get the Virtual Machine Cloud working with the Azure Pack, we need to install Virtual Machine Manager for System Center 2012 R2. This post will lead us through the process of installing the prereequisites and then Virtual Machine Manager itself.

Other posts in the series are:


Service Center 2012 R2 is currently available as a free 180 day trial from the TechNet Evaluation Center. Once you've registered and downloaded the payload you'll have a set of *.exe files which unpack individual parts of Service Center 2012 R2. Run "SC2012_R2_PREVIEW_SCVMM.exe" and specify a folder to unpack to.


Configure SQL Server Instance

For the sake of seeing what databases get created where, we're going to run each separate component of the environment in a separate database instance on our SQL Server. The first thing we'll do to is create a new database instance for Virtual Machine Manager.

To do this, get a remote desktop session to the SQL Server ( in this case) and run the SQL Server 2012 setup program again. At the SQL Server Installation Center dialog, click "Installation" and then "New SQL Server stand-alone installation or add featires to an existing installation". Step through the wizard as per normal, selecting the following options on the appropriate dialogs:

  • Installation Type - select "Perform a new installation of SQL Server 2012"
  • Feature Selection - check "Database Engine Services"
  • Instance Configuration - specify the named instance as "VAVMMDB"
  • Database Engine ConfigurationI - select "Mixed Mode" authentication, specify an sa password, and add Domain Admins to the SQL Server administrator list.
Finally, we'll bind the new instance to a static port and open that port in the Windows Firewall to allow incoming connections.

    $key = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.VAVMMDB\MSSQLServer\SuperSocketNetLib\Tcp\IPAll"
    Set-ItemProperty -Path $key -Name "TcpDynamicPorts" -Value ""
    Set-ItemProperty -Path $key -Name "TcpPort" -Value "1435"

    New-NetFirewallRule -DisplayName "VASQL01\VAVMMDB Database Engine" -Direction Inbound -Protocol TCP -LocalPort 1435 -Action Allow

    Restart-Service "MSSQL`$VAVMMDB"

Virtual Machine Configuration

Virtual Machine Manager requires at least 4000Mb of RAM allocated to the host machine in order to install, and the installer will refuse to install if you have below this threshold, so make sure your VM has at least that much RAM before you start.

Windows Server 2012 R2

Service Center 2012 R2 requires Windows Server 2012 R2, which you can find instructions for in a previous post - Installing Windows Server 2012 R2. Once we've got the base virtual machine installed, run the following scripts to rename the computer and join to the domain:

    Rename-Computer "VASCM01"
    New-NetIPAddress -IPAddress -InterfaceAlias "Ethernet" -DefaultGateway -AddressFamily IPv4 -PrefixLength 24
    Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses @("", "")

    $username = "VA\Administrator"
    $password = "myPassword"
    $passwordSecure = ConvertTo-SecureString $password -AsPlainText -Force
    $credential = new-object System.Management.Automation.PSCredential($username, $passwordSecure)

    Add-Computer -DomainName "va.local" -Credential $credential

Windows Assessment and Deployment Toolkit

See the Installing Windows Assessment and Deployment Toolkit 8.1 Preview post for details of how to download and install the ADK.

SQL Server Utilities

To install the SQL Server Command Line Utilities for SQL Server 2008 R2 or SQL Server 2012. This is part of the SQL Server 2012 Feature Pack and can be downloaded from

To find the links, expand the "Install Instructions" section of the page and scroll down to the "Microsoft SQL Server 2012 Command Line Utilities" link. Note: You'll also need to download and install the "Microsoft SQL Server 2012 Native Client" as a prerequisite to the command line utilities. To install them, use the following commands:
      md c:\logs
      set msiexec=%SystemRoot%\System32\msiexec.exe
      set downloads=\\nas1\downloads\Microsoft\Server Software\SQL Server 2012 Feature Pack\x64

      "%msiexec%" /i "%downloads%\sqlncli.msi" /norestart /passive /l*v "c:\logs\sqlncli.log" IACCEPTSQLNCLILICENSETERMS=YES
      "%msiexec%" /i "%downloads%\SqlCmdLnUtils.msi" /norestart /passive /l*v "c:\logs\SqlCmdLnUtils.log"

      shutdown /r /t0

Domain Objects

Finally, we'll also need to run a couple of scripts to create a domain account for the Virtual Machine Manager service and an Active Directory container to store encryption keys:
      Import-Module ServerManager
      Add-WindowsFeature -Name "RSAT-AD-PowerShell"

      New-ADUser -Name "VMM Service" -SamAccountName "VMMService" -DisplayName "VMM Service Account" -Enabled $true -ChangePasswordAtLogon $false -AccountPassword (ConvertTo-SecureString "mypassword" -AsPlainText -force) -PasswordNeverExpires $true

      $admins = [ADSI]"WinNT://./Administrators,group"

      New-ADOrganizationalUnit -Name "Encryption Keys"

Virtual Machine Manager

The full warning on the final wizard page reads as follows:

The Service Principal Name (SPN) could not be registered in Active Directory Domain Services (AD DS) for the VMM management server.

1) Use setspn.exe to create SPN for vmmserver using following command "C:\Windows\system32\setspn.exe -S SCVMM/ va\VMMService".

2) Add SPN values to following registry key "Software\Microsoft\Microsoft System Center Virtual Machine Manager Server\Setup\VmmServicePrincipalNames".

3) Run "C:\Program Files\Microsoft System Center 2012 R2\Virtual Machine Manager\setup\ConfigureSCPTool.exe -install" to configure SCP.

If SPN and SCP are not registered, VMM consoles on other computers will not be able to connect to this VMM management server and deploying a Hyper-V host to a bare-metal computer will not work.

Running Virtual Machine Manager

To start Virtual Machine Manager, click the Start button (which is back in Windows Server 2012 R2), click the white "down arrow", and then click "Virtual Machine Manager Console" under the "Microsoft System Center 2012 R2" section.

To make it quicker to launch in future, you can also right-click Virtual Machine Manager Console and click the "Pin to Start" icon or "Pin to taskbar" icon.

We still don't have any resources to add to Virtual Machine Manager - that's coming a bit later. The next step will be to install Service Center 2012 R2 Service Provider Foundation, which we'll do in th enext post.

No comments:

Post a Comment