Wednesday, November 13, 2013

How to build a System Center Virtual Machine Manager 2012 R2 lab - part 4

In the previous post you saw how to setup your Active Directory Forest. Now you'll see how to deploy two Hyper-V hosts in that security context.



Set-up a new virtual machine using the Hyper-V 2012 R2 iso image: en_microsoft_hyper-v_server_2012_r2_x64_dvd_2708236.iso
When asked for the guest operating system choose Microsoft Windows / Hyper-V (unsupported). The fact that even VMWare Workstation 10 (which has just been released) says 'unsupported' means that our lab should work but VMWare does not endorse any responsibility for failure. Who cares, since we are just beta-testing this for the moment.

In VMWare Workstation 10, when configuring a virtual machine, you have the choice between four mode for running guest code:
  • Automatic: Workstation chooses the execution mode based on the guest operating system and the host CPU. 
  • Binary translation: Workstation uses a mix of directly executing guest code and binary translation to run the guest operating system. Guest memory mapping is performed by using shadow page tables. 
  • Intel VT-x or AMD-V: Workstation uses hardware extensions to run and isolate guest code. Guest memory mapping is performed by using shadow page tables. 
  • Intel VT-x/EPT or AMD-V/RVI: Workstation uses hardware extensions to run and isolate guest code. Guest memory mapping is performed by using hardware paging.
Choose Intel VT. Obviously this is not a supported configuration and probably not the ideal way to test out Hyper-V, but, as I said, who cares, we are here only to learn and test.
The virtual machine boots on the installation of Hyper-V and once you have chosen your regional options just use ALT+I to start the installation. This process will be quite quick. I am still impressed by the effort Microsoft has done to improve the ease of installation, which, just a few years back (I am talking about Windows 2003) was still long and asked for too much interaction. Also Microsoft has removed all that dull advertising about built-in functionality that nobody read:

What you will notice at this time is that the installation interface does not ask for a licence. That’s because Microsoft has put in place a very aggressive strategy to demote VMWare from their position of leader of the virtualization market. Microsoft propose a totally free of charge hypervisor and you’ll pay just the licences for your guest virtual machines (which probably you already have). Moving from VMWare ESXi to Microsoft Hyper-V represents today a wise economical move. Regarding this I deeply suggest that your read the last article published on Technet by Andrew Fryer (@deepfat) explaining this point inside-out: http://blogs.technet.com/b/uktechnet/archive/2013/10/24/is-it-time-to-upgrade-your-hypervisor.aspx

Another thing you will notice is that the installation process does not ask wheter you want to setup your system with a GUI or in Core mode. That’s because Server Core is the only possible option for an hypervisor in order to minimize the overhead.
Once the installation has completed, choose your local administrator password and log in. The usual boring sconfig blue window will appear. Interestingly enough, the number of options has changed compared to what we had in a standard full blown Windows 2012 R2 installation: the option ‘Windows Activation’ is missing since unneeded, as we have just discussed. So choose option 14 and then launch Windows Powershell.

Install the VMWare Tools:

Then, after the system has rebooted, proceed with a configuration of the network interface. For sake of simplicity you should have just one network interface at the moment on this virtual machine. Pay attention to the use of the cmdlet Set-DnsClientServerAddress, which is used to specify the IP address of the DNS server. If you omit this, your VM won’t be able to find the Domain name LAB2013 when joining it.
Get-NetAdapter -Name Ethernet0 | % {
  $_ | Set-NetIPInterface -Dhcp Disabled
  $_ | New-NetIPAddress -IPAddress 192.168.134.20 -PrefixLength 24 -DefaultGateway 192.168.134.2
  $_ | Set-DnsClientServerAddress -ServerAddresses 192.168.134.10
  }

IPAddress         : 192.168.134.20
InterfaceIndex    : 13
InterfaceAlias    : Ethernet0
AddressFamily     : IPv4
Type              : Unicast
PrefixLength      : 24
PrefixOrigin      : Manual
SuffixOrigin      : Manual
AddressState      : Tentative
ValidLifetime     : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource      : False
PolicyStore       : ActiveStore

IPAddress         : 192.168.134.20
InterfaceIndex    : 13
InterfaceAlias    : Ethernet0
AddressFamily     : IPv4
Type              : Unicast
PrefixLength      : 24
PrefixOrigin      : Manual
SuffixOrigin      : Manual
AddressState      : Invalid
ValidLifetime     : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource      : False
PolicyStore       : PersistentStore
The next thing to do is to rename this virtual machine to a meaningful name (LAB2013HV01 for this first Hyper-V machine):
Rename-Computer –NewName LAB2013HV01 –Restart
The server will restart. A quick check with Get-WMIObject will return the new name:
Get-WmiObject -Class win32_computersystem
Domain              : WORKGROUP
Manufacturer        : VMware, Inc.
Model               : VMware Virtual Platform
Name                : LAB2013HV01
PrimaryOwnerName    : Windows User
TotalPhysicalMemory : 1073201152
Now use the two commands we saw in the previous post to disable the firewall and enable remote desktop connections on a Windows 2012 R2 server:
netsh advfirewall set allprofiles state off
and
cscript C:\Windows\System32\Scregedit.wsf /ar 0
The next action is to join the domain LAB2013.local:
Add-computer –DomainName LAB2013.local –Restart
The system should ask you for your very secure credentials, join the domain and restart afterward.


It’s worth of note that during shutdown the following message text appears:

This message is specific to the Hyper-V core iso you used.
Since you will be using a Windows 2012 R2 server as back-end storage, configured as ISCSI Target Server, you have to launch the ISCSI initiator service. This can be done in Powershell:
Start-Service MSiSCSI
WARNING: Waiting for service 'Microsoft iSCSI Initiator Service (MSiSCSI)' to start...
Set-Service MSiSCSI -StartupType Automatic
Now you can get the iSCSI Qualified Name (iQN) of the initiator by running iscsicli.exe:
iscsicli.exe
Microsoft iSCSI Initiator Version 6.3 Build 9600
[iqn.1991-05.com.microsoft:lab2013hv01.lab2013.local] Enter command or ^C to exit
Take note the IQN (Microsoft IQNs use the iqn.1991-05.com.microsoft prefix: this corresponds to the date the domain Microsoft.com was first registered, if you did not knew).
A quick final check:
Get-WindowsFeature | ? installed

Display Name                                            Name
------------                                            ----
[X] File and Storage Services                           FileAndStorage-Services
    [X] Storage Services                                Storage-Services
[X] Hyper-V                                             Hyper-V
[X] .NET Framework 4.5 Features                         NET-Framework-45-Fea...
    [X] .NET Framework 4.5                              NET-Framework-45-Core
    [X] WCF Services                                    NET-WCF-Services45
        [X] TCP Port Sharing                            NET-WCF-TCP-PortShar...
[X] SMB 1.0/CIFS File Sharing Support                   FS-SMB1
[X] Windows PowerShell                                  PowerShellRoot
    [X] Windows PowerShell 4.0                          PowerShell
[X] WoW64 Support                                       WoW64-Support
Now your first Hyper-V server is ready. Repeat all the steps for a second Hyper-V (which you will name LAB2013HV02) in order to have the minimum number of servers to build a basic cluster. Here’s a quick memento of the cmdlets you should use to configure the second server:
Get-NetAdapter -Name Ethernet0 | % {
$_ | Set-NetIPInterface -Dhcp Disabled
$_ | New-NetIPAddress -IPAddress 192.168.134.21 -PrefixLength 24 -DefaultGateway 192.168.134.2
$_ | Set-DnsClientServerAddress -ServerAddresses 192.168.134.10
}
Rename-Computer –NewName LAB2013HV02 –Restart
netsh advfirewall set allprofiles state off
cscript C:\Windows\System32\Scregedit.wsf /ar 0
Add-computer –DomainName LAB2013.local –Restart
Start-Service MSiSCSI
Set-Service MSiSCSI -StartupType Automatic
iscsicli
Note the IQN. Once you have done all that, a second Hyper-V will be ready and it's time to configure the ISCSI Target Server. Stay tuned.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...