Tuesday, December 31, 2013

My review on IT facts of 2013

It's December 31st, 2013. It's been a good year for innovation on all fronts with a lot of interesting products, services and releases of my favorite applications, so I want to write a post to talk about the IT things that have attracted my attention during these last 12 months.

First of all I am positively impressed by the release of the last Nokia Tablet, the Lumia 2520, as well as by the release of the Microsoft Surface 2. Both these tablets have been well-engineered and nicely built. The Nokia Lumia 2520, featuring a Qualcomm SnapDragon 800 CPU, 2GB of RAM and a 10.1" display, impresses me for its refreshing design and its cool colors. On the other side, the Microsoft Surface 2, featuring a quad-core ARM Cortex-A15, 2GB of RAM and a 10.6" display, despite its industrial design, inspires me more thanks to its USB 3.0 port, to its kickstand (especially useful when watching movies), for its crisp text during web browsing, and, from a general point of view, for its versatility.

Speaking of these two tablets, I must say that I am really in love with the last Microsoft operating system, Windows 8.1, and its ARM-oriented version, Windows RT 8.1, that you will find on those two tablets. This OS is really powerful, modern, colorful and, despite all you might have heard, much better than good old Windows 7.

I have been using Windows 8.1 for a few months now and I really can't live without the Metro interface and its smart search engine which looks for file and/or applications on your local hard-drive, in your Skydrive folder and on the web (via Bing, naturally) at the same time.

Windows 8.1 omnisearch
My piece of advice here: forget the Start button and move to the Metro interface as fast as you can. Windows 8 (and 8.1) are more than just a new way of thinking about the desktop interface for Microsoft; it is a major bet that touch is the future of computing and you better get accustomed to the change. Don't worry about the Windows App Store, because it will for sure grow up in size to match those by Google and Apple, and all major Apps are already there: TripAdvisor, Facebook, NetFlix, Twitter, Skype, Shazam, Tunein Radio, or the brilliant new Microsoft RDP (kudos for this from every Windows IT guy out there).

For the moment the only negative point I have found in Windows 8.1 is that background apps temporarily stops until they are brought back to foreground. The technical cause for this? Windows 8 and Windows 8.1 have been built to be efficient and perform well. One of the ways this is accomplished is by suspending any application that's not currently on the show. When you replace an app on the screen, that app is maintained in RAM but it is no longer processed. This allows the user to maintain a large number of apps without degrading performance or reducing the oh-so-important battery life. The downside to this life-cycle is that when your app isn't on the screen, it's no longer running. I find this particularly disturbing when listening to YouTube videos that suddenly stop when I move them to the background. The only workaround I have found for the moment, is to open Internet Explorer 11 in Desktop Mode (Windows Key + R, and type iexplore). This actually works, but feel free to suggest in the comments any other workaround that worked for you.

At the end of 2013 it looks like everyone is moving to the Cloud. Me too. I have explored many ways to storing my data into a Cloud solutions and have been deceived most of the times for now. I started testing the solution of a rapidly growing German start-up, named Owncloud, and have been deceived by the number of bugs which make this application unsafe for storing data.

OwnCloud user interface
The idea behind Owncloud is pretty cool: to give users the possibility to have (and therefore own and manage) their on-premise Cloud server. Unfortunately the community behind Owncloud is quite small, and most of the expert users are oriented toward installing the engine on Linux and can't help newcomers to install it in a Windows environment. Also, each update is risky and if you have large amounts of data stored in the database, the performance decreases. Last not so good point, there is an app for Android smartphones, but it does an average job of sync with files, and does not sync the calendar at all, which is one of the basic features I would expect from their solution. Anyhow Owncloud 6 has just been released and I hope that the Owncloud founder Frank Karlitschek (@fkarlitschek) will broaden the support for Owncloud on Windows platforms.

I have of course also tested free apps, like Dropbox or Skydrive. Both are brilliant but, apart from the well-known privacy problems everybody is aware of, I find the amount of free allowed storage really small in our technology era where data get deduplicated on hosting servers (7GB for Skydrive is way too limited and not everyone is willing to buy a Windows Phone for getting 20GB more).

Concerning Skydrive, I have been tempted by the nice interface of this Public Cloud solution and decided to give a try to the Pro version. I set up a full grown SharePoint 2013 environment sitting on the new Windows 2012 R2 operating system, and activated the Skydrive Pro replica between my folders and this on-premise cloud. Everything worked well, much better than with Owncloud anyway, but I felt let down when I discovered that:
- the picture library does not sync
- you can sync up to a maximum of 20k items in your personal SkyDrive Pro document library
- you can't sync more than 5k items in other SharePoint libraries

So, even if this idea of storing files in the Cloud looks good, I will wait for a friendly, generous (in terms of gigabytes and services) and solid solution, be it on-premise or off-premise, before I change the way I store my data. I will let the big competitors in this field (read Microsoft, Amazon, Google and a few others) fight for the win and eventually choose the most valid Cloud Storage solution.

And if I am not yet completely ready for the Cloud, I am years away from having my washing machine or my fridge connected to the Internet of Things, nor I can imagine my neighbor debugging IPV6 addressing problems on his dishwasher. So, despite what has been said, there are other buzzwords in my head for the moment and Internet of Things is not on my list at the end of 2013, even do I must say I have been fairly impressed by the Italian Arduino micro-controller that allows you to create objects that can really interact with their environment through different triggers and signals. It looks like Arduino (which was invented in 2005) is rapidly becoming the building block at the heart of the Internet of Things, as its low-power processor is easy to program while its range of controller pins makes it easy to connect to the outside world. I deeply suggest you follow Massimo Banzi (@mbanzi) and David Cuartielles (@dcuartielles), co-founders of this platform for the next step in this field.

I want now to go back for a moment to Windows 8.1, and to the new Microsoft policy for upgrades: it has changed since Microsoft has moved from a three-year upgrade cycle to a yearly one, and this is bringing very fast improved releases of my favorite administration language: Windows Powershell. I don't want to rewrite a history of Powershell (I already did this), but just mention that this language is quickly becoming the de-jure standard for Windows system administration and the de-facto standard for third-party application management (VMWare, NetAPP, HP, just to mention a few).

With Powershell (like with VB before), there is in the community the annual habit of organizing some sort of Scripting Games to determine who's the best scripter around. Starting January 2014, the Winter Scripting Games will be a team event and for sure this will add to the fun of the competition. I heatedly suggest everybody reading this post to quickly join a team and find teammates to learn this wonderful language and compare with other Windows admins from all around the world. It could be also the occasion for Linux/Unix administrators to take part in the game and discover the power of this new object-oriented administration language and see how it compares with other standards such as Bash, Python or Perl. I will come back on the Games in a future post, but if you are eager to know more, follow these smart people on Twitter: Don Jones (@concentrateddon), Mike F Robbins (@mikefrobbins) and Richard Siddaway (@RSiddaway).

I previously mentioned the fight for emerging as the biggest Cloud provider out there. Well, there are many other interesting fights on the way, which is important to be aware of and that will determine the future of IT. A few examples? 
  • Skydrive, forget that name: Microsoft has lost the right to use this name since Sky users couldn't tell the difference. Which name Microsoft will adopt next?
  • Powershell, a name that Logitech has picked without realizing that Microsoft had grasped it before for its administration language. Will we see them in Court? 
  • YouTube: Microsoft wants a YouTube app on its phones, but Google (which, according to Amazon, is having a solid success with its new Chromebooks) is doing everything it can to block it. It looks like Windows Phone is starting to scare Android.
I don't even want to mention the battle between CPU manufacturers, like Intel or AMD. 2014 will be a year of tremendous change for both, since the market dynamics are shifting and new markets have started to grow at high speed. Intel has started backing Bay Trail and Haswell-based systems across multiple OS and at price points that compete against ARM-powered Android tablets. And next year Intel will push this strategy further, offering multiple Broadwell families, and in particular the Broadwell-Y, which should compete with chips from ARM both on performance and on TDP. A post-PC era has started, and I am curious to see how historical CPU manufacturers will cope with the technology challenge set up by Qualcomm, ARM (today ARM chips power Apple's iPhones, and iPads, as well as a huge number of Android phones)Samsung and Apple, even if this last one, after years or leadership with the iPhone, is actually running out of tricks to impress me. The battle will be fierce.

Broadwell-Y is coming
I said before that Microsoft is delivering new Windows upgrades at an unrivaled frequency. This is also true for most of its products (it must be the Indian summer of Microsoft CEO Steve Ballmer (@steveballmer), who, being Microsoft employed #30, was there since the beginning). And this high frequency is also true for its hypervisor: Microsoft Hyper-V Server 2012 R2 has in the end attained parity with VMWare in hypervisor functionality and is today ahead in Cloud offerings. Check expert VMWare VCDX Andrea Mauro (@Andrea_Mauro) blog for an in-deep comparison of technical specs between Microsoft Hyper-V and VMWare vSphere. Personally, I am a VMWare VCP and I have been a great fan of VMWare for many years. Today, while VMWare continues to dominate the market, I start to feel like I want to move more and more to the Microsoft solution, because it is cheaper, at least for the Full edition, and this is the one that I need, and because Microsoft offers the possibility to Hyper-V users to run their VM in the Windows Azure Cloud, extending the Private Cloud concept to make it Hybrid (and interesting I daresay). In addition Microsoft has understood that most people are well used to working with VMWare ESX and is giving away free Hyper-V and System Center training in order to change the market dynamics. At the same time Microsoft is providing the opportunity for a free Virtualization Certification when you request a free voucher for exam 74-409. Well played.

On the other side of the river there is VMWare. I am happy to see that they have released vSphere 5.5, but, let me say, the upgrade from vSphere 5.0 to 5.1 was a nightmare for most of us mainly due to the issues brought by the introduction of that piece of software that is Single Sign-On (SSO). According to VMWare, SSO is the first step toward true unification of VMware's various software components, but the truth is that they bought so many third-party applications that were difficult to integrate and needed some sort of mechanism to keep them all bound together. The result was poor.

In 2014 I will keep an eye on the evolution of server virtualization market since it is one of the most interesting from my point of view. I won't make any prediction since I am not an analyst, but one thing is sure: Microsoft and VMWare will continue their battle and IT pros will benefit from the competition.

In this post I want also to suggest a buzzword to follow next year: DevOps. You don't know what DevOps mean?  Well, a DevOps is not a person, nor a tool. It's a new way of thinking (and improving) the interactions (in terms of workflow and feedback from early stage to Prod) between software developers on one side and the operation on the other side. If you feel you want to know more about this concept, follow on Twitter the person who invented the word, Patrick Debois (@patrickdebois), and read this explanation by Simon Maple (@sjmaple) on TheServerSide.com.

I want to end this post suggesting all of my readers to start 2014 with the buy (if they haven't yet) of a Solid State Drive (SSD), since there is no better time of the year to treat yourself to a new bit of kit that will speed up your configuration. They are still expensive, but the technology behind is improving fast (Samsung has been able to produce a 1TB SSD, the Samsung 840 EVO, using an astonishing 19nm process) and sooner or later prices will drop.
1TB Samsung 840EVO SSD
Let me know if you agree with all the things I have written and feel free to suggest the things that made your 2013 and the things that you expect from 2014. For those living in France, see me at the Microsoft Techdays in Paris, where, as a Powershell MVP (which I became thanks to Martine Thiphaine @mthiphaine), I will be a speaker together with Fabien Dibot (@fdibot) on Powershell Remoting and on Powershell Tips and Tricks.

Wishing all of my readers all the best for 2014, I leave you with two jokes that made me smile:

thedailydose.com
cloudtweaks.com

Tuesday, December 17, 2013

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

In this post we will install the actual System Center Virtual Machine Manager 2012 R2 application. In the previous post you set up a new virtual machine named LAB2013VMM01 for hosting this application. Here you have to mount the SCVMM iso image and run setup.exe:


Click on install. By default none of the options are selected. However you can’t install the management server without installing the console, so when you check the first box, the second one will come along.


Enter your registration key:


Accepts the licence agreement:


Choose whether you want to take part in the CEIP (I suggest so, since this give important information to Microsoft aimed at improving the software):


Set Microsoft Update On (... or Off, if you are in a lab like me, since it’s no use):


Choose the folder where you want to install SCVMM into:


Now the install checks that all the prerequisites are met. If you get an alert telling you to you need at least 4GB of RAM, just modify the VM settings to conform, and VMWare Workstation will do that for you instantly, since it supports hot-add of memory. Hardcore.
Time to configure the connection to the MSSLQ DB:


Now configure SCVMM to use the service account (SCVMMsvc) you setup using Powershell in the previous post and enter the DN of the container for the keys: CN=SCVMMDKM,CN=System,DC=lab2013,DC=local


Review the port configuration (the note of the ports, you could need this if your network is internally firewalled):


Review the library configuration:


Save the installation summary to a text file for future reference:

Features selected to be added
 - VMM management server
 - VMM console
Installation Location
 - C:\Program Files\Microsoft System Center 2012 R2\Virtual Machine Manager\
Database Information
 - VirtualManagerDB database will be created on LAB2013SQL01
Service Account
 - LAB2013\SCVMMsvc
Communication Ports
 - 8100 - Communication with the VMM console
 - 5985 - Communication to agents on hosts and library servers
 - 443 - File transfers to agents on hosts and library servers
 - 8102 - Communication with Windows Deployment Services
 - 8101 - Communication with Windows Preinstallation Environment (Windows PE) agents
 - 8103 - Communication with Windows PE agent for time synchronization
Library Share Name and Location
 - MSSCVMMLibrary
 - C:\ProgramData\Virtual Machine Manager Library Files
Using Microsoft Update
 - No

Wait for the installation to complete:



It was long but there you are with a full grown SCVMM lab! Just connect to it and get accustomed to the interface:



In a future post I will explain how to configure networking on these Hyper-V servers (we will setup additional NICs for Management traffic), how to integrate them into SCVMM, how to setup a Cluster and how to setup your first VM, so stay tuned!

Friday, December 13, 2013

How to suspend and resume VMWare Workstation VMs using PowerShell

If you have ever made a lab in your home environment, you have probably used VMWare Workstation as preferred choice for running your virtual machines. However, in such a small all-in-a-host configuration, you could face the need to shutdown and restart your main computer (i.e. if you have just added some patches or some heavyweight applications), and this could be very unpractical if you have say 5 or 6 VMs (or more!) running on top of it.

What you would like is to have the ability to suspend the state of these VMs so you can pick up where you left off after rebooting your host. And since we are in modern times, what you would like also is the ability to perform this operation with a Powershell script.

Unfortunately there is no API for Powershell in VMWare Workstation, but this program comes with another command which your Powershell script could be based on: vmrun.exe.

This utility can be used to control virtual machines and allows the following operations: start (power on), stop (power off), reset (reboot), suspend (but allow local work to resume), pause (without interrupting), and unpause (continue).

I had the idea to write two scripts. The first one is good for suspending VMs and should be using prior to rebooting your host (right click, open with Windows Powershell ISE):
cd "C:\Program Files (x86)\VMware\VMware Workstation"

$RunningVMs = .\vmrun list | select-object -skip 1
 
Foreach ($RunningVM in $RunningVMs)
{
    "Suspending $RunningVM..."
    .\vmrun suspend "$RunningVM"
}
The second one is good for resuming your VMs to the exact state they were before the host rebooted:
cd "C:\Program Files (x86)\VMware\VMware Workstation"

$SuspendedVMs = gci -Include *.vmx -Recurse -Path C:\VMs
 
Foreach ($SuspendedVM in $SuspendedVMs)
{
.\vmrun start "$SuspendedVM"
}
As you can understand the state of a VM is kept persistent across reboot since it's dumped to a .vmss file (whose name will look like this: vm001-82cc0131.vmss) and the RAM content is dumped to a .vmem file (such as vm001-82cc0131.vmem).

I hope this helps with your labs, and if you have the occasion, check out the new Hyper-V 2012 R2 role as a good alternative to VMWare Workstation.

Monday, December 9, 2013

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

In the previous post you saw how to configure SQL Server for your virtual infrastructure. In this post you will setup a sixth virtual machine named LAB2013VMM01 that will host your actual System Center Virtual Machine Manager 2012 R2 installation. You will also go through all the prerequisites for SCVMM to work.



Under VMWare Workstation configure a new virtual machine and install Windows 2012 R2 with a GUI (even though it looks like you have the option to install SCVMM in Core mode starting from version 2012). Once the installation has ended, and you have deployed the VMWare tools, connect as a Domain Admin and use once again the basic configuration cmdlets:
Get-NetAdapter -Name Ethernet0 | % {
  $_ | Set-NetIPInterface -Dhcp Disabled
  $_ | New-NetIPAddress -IPAddress 192.168.134.17 -PrefixLength 24 -DefaultGateway 192.168.134.2
  $_ | Set-DnsClientServerAddress -ServerAddresses 192.168.134.10
}
Rename-Computer –NewName LAB2013VMM01 –Restart
netsh advfirewall set allprofiles state off
cscript C:\Windows\System32\Scregedit.wsf /ar 0
Add-computer –DomainName LAB2013.local –Restart
Time to review the four main prerequisites for SCVMM:
  • During the installation of a VMM management server, on the Configure service account and distributed key management page, you will need to configure the System Center Virtual Machine Manager service to use either the Local System account or a Domain account. You can change this later on, of course. If you choose to use a Domain account make it belong to the Local Administrators Group. In any case there are many reasons to choose to run SCVMM with a Domain account, though I am not going to detail this here.
  • During the installation of a VMM management server, you will need to configure Distributed Key Management. On the 'Configure service account and distributed key management' page of Setup, you can select to use Distributed Key Management to store encryption keys in Active Directory Domain Services (AD DS) instead of storing the encryption keys on the computer on which the VMM management server is installed. The advantage of storing your keys in AD DS is that if you need to move your VMM installation to another computer, all your data are retained. Cool, uh? Also storing keys in AD DS is the only possible way if clustering your VMM. You must create a Container (i.e. SCVMMDKM) in AD DS before installing VMM. The domain account your created in the first step must have full rights on this Container.
  • The third prerequisite is to install Windows Assessment and Deployment Kit (Windows ADK) for Windows 8.1.
  • The fourth is to install SQL Server 2012 Command Line Utilities.
Remember that using a Domain Account and storing the encryption keys are two of the pillars of a Highly Available VMM Management Server, which is out of scope for my lab for now. Maybe I’ll come back on this topic in a future post.

The first two prerequisites are easily accomplished with Powershell:
On the Domain Cotroller (LAB2013AD01 in my case) type the following command to create a new account for SCVMM:
New-ADUser -Name "SCVMM Account" –SamAccountName SCVMMsvc -Description "SCVMM 2012 R2 Server Service Account" -Enabled $true -AccountPassword (Read-Host -AsSecureString "SCVMM Service Account Password")
Note the password you used! Now retrieve the SID of this new user account:
[System.Security.Principal.IdentityReference]$UserSid = (Get-ADUser scvmmsvc).SID
Create a variable containing the DN of your domain:
$ADRoot = (Get-ADDomain).DistinguishedName
Create the Active Directory Container:
New-ADObject -Name "SCVMMDKM" -Type Container –path “CN=System,$ADRoot” –passthru

DistinguishedName   Name                ObjectClass         ObjectGUID
-----------------   ----                -----------         ----------
cn=SCVMMDKM,CN=S... SCVMMDKM            container           59722f15-51af-4c...
Now retrieve the existing ACL of the Container (note the use of the AD: PSDrive):
$Acl = Get-Acl "AD:CN=SCVMMDKM,CN=System,$ADRoot"
Now the tricky part: you have to create the ActiveDirectoryAccessRule that goes into the AddAccessRule method. This object has six different constructors and each can be used for a different use case. Luckily we can check the syntax on MSDN or execute the following command:
[System.DirectoryServices.ActiveDirectoryAccessRule].GetConstructor
OverloadDefinitions ------------------- System.Reflection.ConstructorInfo GetConstructor(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, type[] types, System.Reflection.ParameterModifier[] modifiers) System.Reflection.ConstructorInfo GetConstructor(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, type[] types, System.Reflection.ParameterModifier[] modifiers) System.Reflection.ConstructorInfo GetConstructor(type[] types) System.Reflection.ConstructorInfo _Type.GetConstructor(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, type[] types, System.Reflection.ParameterModifier[] modifiers) System.Reflection.ConstructorInfo _Type.GetConstructor(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, type[] types, System.Reflection.ParameterModifier[] modifiers) System.Reflection.ConstructorInfo _Type.GetConstructor(type[] types)
To give the SCVMMsvc user account full rights on the SCVMMDKM Container you need to choose a constructor that accepts:
  • An IdentityReference object that identifies the trustee of the access rule. It is the SID of the user account SCVMMsvc.
  • The access rights that are assigned to an Active Directory Domain Services object. You will use GenericAll because it gives the right to create or delete children, delete a subtree, read and write properties, examine children and the object itself, add and remove the object from the directory, and read or write with an extended right.
  • An AccessControlType: Allow or Deny
$Ace = New-Object System.DirectoryServices.ActiveDirectoryAccessRule $UserSid, "GenericAll", "Allow"
$Acl.AddAccessRule($Ace)
Set the Acl:
Set-Acl -aclobject $Acl "AD:CN=SCVMMDKM,CN=System,$ADRoot"
The last step you have to perform to met the first two prerequisite is to add the new SCVMMsvc account to to local administrator group on your SCVMM server LAB2013VMM01:
([ADSI]"WinNT://LAB2013VMM01/Administrators,group").psbase.Invoke("Add",([ADSI]"WinNT://LAB2013.local/SCVMMsvc").path)
Easy, right?
Now, for Windows ADK, you can find it here: http://www.microsoft.com/en-eg/download/details.aspx?id=39982 It’s a small file (1.4MB) named adksetup.exe.

The two features that you need for SCVMM are Deployment Tools and Windows PE:

The installer will download these features (that’s why it is so important to have proper internet connection and a valid DNS forwarding in your LAB). This can take a significant amount of time depending on download speed.

You can take a walk here since this step is pretty long download. When you come back the Windows ADK will be finished and you will see the following window:

Now install the SQL Server 2012 Command Line Utilities from the Microsoft SQL Server 2012 Feature Pack. You can download them from http://www.microsoft.com/en-us/download/details.aspx?id=29065

The installation ends quickly since there are no prerequisites to meet under Windows 2012 R2:

Restart this virtual machine since you made a lot of modifications (this step is not required but I suggest you to do so):
Now you have all the SCVMM prerequisites met. Time to install System Center, which I will explain in the next post!

Thursday, December 5, 2013

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

In the last post I showed you how to connect the ISCSI initiators to the ISCSI targets. The next step of your System Center Virtual Machine Manager 2012 R2 lab is to setup a database server running Microsoft SQL Server.


There is something important to tell here since I have already been asked about it: SCVMM 2012 R2 doesn’t ship with an embedded SQL database, so you have to setup a separate SQL Server machine to host this functionality. The following list shows the SQL Server editions that are compatible with this version of VMM:
  • SQL Server 2008 R2 Standard and Datacenter (64-bit) with Service Pack 2 or greater
  • SQL Server 2012 Enterprise and Standard (64-bit) with or without Service Pack 1
Also, when installing SQL you must configure a case-insensitive instance and the following features must be installed:
  • Database Engine Services
  • Management Tools
Let’s see this in detail. You will proceed to the installation of a virtual machine named LAB2013SQL01 running Windows 2012 R2 configured with a GUI.
During the setup of the virtual machine under VMWare workstation, you better had a 100GB (or less if you don't have that space free)  secondary disk to host the database:


The installation proceeds as usual:


Same as for the other virtual machines, define a password for the local administrator, install the VMWare tools, restart. Once restarted; here are the precious commands to run in order:
Get-NetAdapter -Name Ethernet0 | % {
  $_ | Set-NetIPInterface -Dhcp Disabled
  $_ | New-NetIPAddress -IPAddress 192.168.134.16 -PrefixLength 24 -DefaultGateway 192.168.134.2
  £_ | Set-DnsClientServerAddress -ServerAddresses 192.168.134.10
}
Rename-Computer –NewName LAB2013SQL01 –Restart
netsh advfirewall set allprofiles state off
cscript C:\Windows\System32\Scregedit.wsf /ar 0
Add-computer –DomainName LAB2013.local –Restart
Get-Disk –number 1 | % {
  $_ | Set-disk  –isreadonly 0
  $_ | Set-disk –isoffline 0
  $_ | initialize-disk –partitionstyle GPT
  $_ | new-partition –driveletter “G” –usemaximumsize
  Initialize-volume –driveletter “G” –filesystem NTFS –confirm:$false
}
   Disk Number: 1

PartitionNumber  DriveLetter Offset                                        Size Type
---------------  ----------- ------                                        ---- ----
2                G           135266304                                 99.87 GB Basic

DriveLetter     : G
DriveType       : Fixed
FileSystem      : NTFS
FileSystemLabel :
HealthStatus    : Healthy
ObjectId        : \\?\Volume{29917e16-05b7-46f9-ba33-96eba86201d0}\
Path            : \\?\Volume{29917e16-05b7-46f9-ba33-96eba86201d0}\
Size            : 107237863424
SizeRemaining   : 107121639424
PSComputerName  :
Now mount the SQL Server iso file (mine is named en_sql_server_2012_enterprise_edition_with_sp1_x64_dvd_1227976.iso). Before starting the actual installation, run SQL System Configuration Checker to be sure that everything is ok with your VM:


Once the Configuration Checker has finished, start the installation for real:


When asked for, choose the features we mentioned before:


Modify the instance root directory to reflect the partition you set up (should be G:\):


Review the disk space requirements for SQL Server 2012:


Configure the services accounts (feel free to create specific account in the Active Directory for your SQL installation):


Specify the authentication mode to Windows Authentication Mode and specify the name of the SQL administrator:


Check that the data directories are properly set:


Wait for the installation to finish and you’re done with the SQL Server VM!


Fine, we are starting to see the light at the end of the tunnel: in the next post you will go through the prerequisites for the actual System Center Virtual Machine Manager 2012 R2 server installation. Stay tuned!

Tuesday, November 26, 2013

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

Welcome again to this series of posts on configuring a Microsoft System Center Virtual Machine Manager 2012 R2 lab. In the previous post you configured an ISCSI Target Server on the virtual machine named LAB2013ISCSI01. The next step is to configure the ISCSI initiators (which are your two Hyper-V servers).

Open a remote desktop connection to  the first Hyper-V server (LAB2013HV01) and use Powershell to connect to the ISCSI Target Server (whose IP is 192.168.134.15):
New-IscsiTargetPortal -TargetPortalAddress 192.168.134.15
InitiatorInstanceName  :
InitiatorPortalAddress :
IsDataDigest           : False
IsHeaderDigest         : False
TargetPortalAddress    : 192.168.134.15
TargetPortalPortNumber : 3260
PSComputerName         :
In my case when I ran Connect-ISCSITarget it returned an error:
Connect-ISCSITarget -NodeAddress "iqn.1991-05.com.microsoft:lab2013hv01.lab2013.local"
connect-ISCSITarget : The target name is not found or is marked as hidden from login.
At line:1 char:1
That’s because I had made a typo entering the IP address of the Target server. To solve this I removed the wrong entry with:
Get-IscsiTargetPortal | ? targetportaladdress -like "192.168.1.15” | Remove-IscsiTargetPortal
and after re-adding it I was able to succesfully connect, as you can see here:
Get-iSCSITarget | Connect-iSCSITarget

AuthenticationType      : NONE
InitiatorInstanceName   : ROOT\ISCSIPRT\0000_0
InitiatorNodeAddress    : iqn.1991-05.com.microsoft:lab2013hv01.lab2013.local
InitiatorPortalAddress  : 0.0.0.0
InitiatorSideIdentifier : 400001370000
IsConnected             : True
IsDataDigest            : False
IsDiscovered            : True
IsHeaderDigest          : False
IsPersistent            : False
NumberOfConnections     : 1
SessionIdentifier       : ffffe00002584430-400001370000000b
TargetNodeAddress       : iqn.1991-05.com.microsoft:lab2013iscsi01-target01-tar
                          get
TargetSideIdentifier    : 0200
PSComputerName          :

AuthenticationType      : NONE
InitiatorInstanceName   : ROOT\ISCSIPRT\0000_0
InitiatorNodeAddress    : iqn.1991-05.com.microsoft:lab2013hv01.lab2013.local
InitiatorPortalAddress  : 0.0.0.0
InitiatorSideIdentifier : 400001370000
IsConnected             : True
IsDataDigest            : False
IsDiscovered            : True
IsHeaderDigest          : False
IsPersistent            : False
NumberOfConnections     : 1
SessionIdentifier       : ffffe00002584430-400001370000000a
TargetNodeAddress       : iqn.1991-05.com.microsoft:lab2013iscsi01-target03-tar
                          get
TargetSideIdentifier    : 0100
PSComputerName          :

AuthenticationType      : NONE
InitiatorInstanceName   : ROOT\ISCSIPRT\0000_0
InitiatorNodeAddress    : iqn.1991-05.com.microsoft:lab2013hv01.lab2013.local
InitiatorPortalAddress  : 0.0.0.0
InitiatorSideIdentifier : 400001370000
IsConnected             : True
IsDataDigest            : False
IsDiscovered            : True
IsHeaderDigest          : False
IsPersistent            : False
NumberOfConnections     : 1
SessionIdentifier       : ffffe00002584430-4000013700000009
TargetNodeAddress       : iqn.1991-05.com.microsoft:lab2013iscsi01-target02-tar
                          get
TargetSideIdentifier    : 0300
PSComputerName          :
Then you have to make these session persistent across reboots:
Get-iSCSISession | Register-iSCSISession
Repeat the same steps on the other Hyper-V host.
A check with Get-Disk should show you the newly mounted RAW partitions:
Get-Disk

Number Friendly Name                            Operationa Total Size Partition
                                                lStatus                Style
------ -------------                            ---------- ---------- ---------
0      VMware, VMware Virtual S SCSI Disk De... Online          60 GB MBR
1      MSFT Virtual HD SCSI Disk Device         Offline        120 GB RAW
2      MSFT Virtual HD SCSI Disk Device         Offline         10 GB RAW
3      MSFT Virtual HD SCSI Disk Device         Offline        120 GB RAW
At this point these disks must be brought online, initialized and partitioned but only on the first Hyper-V server (LAB2013HV01):
Get-disk –number 1 | % {
  $_ | Set-disk  –isreadonly 0
  $_ | Set-disk –isoffline 0
  $_ | initialize-disk –partitionstyle GPT
  $_ | new-partition –driveletter “F” –usemaximumsize
  Initialize-volume –driveletter “F” –filesystem NTFS –confirm:$false
}
Get-disk –number 2 | % {
  $_ | Set-disk  –isreadonly 0
  $_ | Set-disk –isoffline 0
  $_ | initialize-disk –partitionstyle GPT
  $_ | new-partition –driveletter “G” –usemaximumsize
  Initialize-volume –driveletter “G” –filesystem NTFS –confirm:$false
}
Get-disk –number 3 | % {
  $_ | Set-disk  –isreadonly 0
  $_ | Set-disk –isoffline 0
  $_ | initialize-disk –partitionstyle GPT
  $_ | new-partition –driveletter “H” –usemaximumsize
  Initialize-volume –driveletter “H” –filesystem NTFS –confirm:$false
}
Now your partitions should be ready:
Get-Disk

Number Friendly Name                            Operationa Total Size Partition
                                                lStatus                Style
------ -------------                            ---------- ---------- ---------
0      VMware, VMware Virtual S SCSI Disk De... Online          60 GB MBR
1      MSFT Virtual HD SCSI Disk Device         Online         120 GB GPT
2      MSFT Virtual HD SCSI Disk Device         Online          10 GB GPT
3      MSFT Virtual HD SCSI Disk Device         Online         120 GB GPT
On the other Hyper-V host run Update-Disk to make it aware of the existence of these new partitions. These three new iSCSI volume on LAB2013HV01 and LAB2013HV02 will behave just like directly-attached disk even though they are actually located elsewhere on the network. So, from the perspective of Hyper-V, the volume F:, G: and H: are just local volumes.
That's all for the moment concerning the configuration of the ISCSI back-end storage. Stay tuned for the next post on configuring a SCVMM lab!

Thursday, November 21, 2013

Powershell one-liner to check log files

Today I want to show you how Powershell can be used to search log files for specific strings of text and wait for updates (similarly to tail -f in the old unix world). Before the arrival of Powershell this was a pretty tedious activity involving lot of log file opening and closing. With the arrival of Powershell this task has become both easier and quicker than ever.

Let's suppose (this was my case today) that you have just joined a computer to a WSUS server and that you have some issue downloading the required patches. What you would do is to look for the Windows Update log file inside your Windows folder on your client computer.

In Powershell that's accomplished in a basic one-liner:
Get-ChildItem -Path C:\Windows *update*.log -Recurse | Get-Content -Wait | Select-String 'warning'
As you can see, I don't even know the exact name of the log file, nor the subfolder it resides in, but, with a little guessing, I can tell Powershell to look inside any subdirectory of c:\Windows for any log file contaning the word 'update' in its name, then pipe the result to Get-Content, which keeps the stream open and passes any update to the Select-String cmdlets. Select-string retrieves any line containing the 'warning' word and output it to the screen.

The result is stunning:
2013-11-20    16:01:10:783     832    160    AU      # WARNING: Failed to find updates with error code 800B0001
2013-11-20    16:01:12:346     832    8b4    Misc    WARNING: Digital Signatures on file C:\Windows\SoftwareDistribution\SelfUpdate\wuident.cab are not trusted: Error 0x800b0001
2013-11-20    16:01:12:346     832    8b4    Setup    WARNING: SelfUpdate check failed to download package information, error = 0x800B0001
2013-11-20    16:01:12:346     832    8b4    Agent      * WARNING: Skipping scan, self-update check returned 0x800B0001
2013-11-20    16:01:12:346     832    8b4    Agent      * WARNING: Exit code = 0x800B0001
There I have my error! Of course, if you're less lucky, you may need to try with different log file names, or with different words in the content, but the fact is that it's anyway easier than ever before.

Note that you can replace 'warning' with a regular expression if you want to do complicated inclusion or exclusion of log messages.

For instance, to search for the keyword 'error' or 'warning' use the following regex:
Get-ChildItem -Path C:\Windows *update*.log -Recurse | Get-Content -Wait | Select-String "warning|error"
On Powershell 2.0 (which is the Powershell version of the computer I had a problem with) this can be shortened to:
gci C:\Windows *update*.log -rec | gc -Wai | Select-String "warning|error"
Not bad, isn't it? Stay tuned for more fun with Powershell.

Wednesday, November 20, 2013

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

In the previous post we setup two Hyper-V servers. Time has come to setup the storage back-end for your System Center Virtual Machine Manager 2012 R2 lab. No need for an alternative solution like FreeNas or OpenFiler because nowadays Windows Server 2012 R2 and Hyper-V Server 2012 R2 have some really cost-effective new storage options, such as Storage Spaces and Hyper-V over SMB 3.0. And of course you definitively want to take advantage of these features for your lab, so, “Winology”, here we come! Before you get started on this I suggest that you take a deep look at this Microsoft document that explains what’s new in the ISCSI Target Server in this last release: http://blogs.technet.com/b/filecab/archive/2013/07/31/iscsi-target-server-in-windows-server-2012-r2.aspx


Very well. Create a fourth virtual machine named LAB2013ISCSI01. This virtual machine will be installed as Server Core, and you will give it 192.168.134.15 as IP address. The steps to perform are the same you did for the three other VMs (the DC and the two Hyper-V servers), so start configuring networking:
Get-NetAdapter -Name Ethernet0 | % {
 $_ | Set-NetIPInterface -Dhcp Disabled
 $_ | New-NetIPAddress -IPAddress 192.168.134.15 -PrefixLength 24 -DefaultGateway 192.168.134.2
 $_ | Set-DnsClientServerAddress -ServerAddresses 192.168.134.10
}
then proceed to configure Remote Desktop and Windows Firewall. Concerning Windows Firewall, I invite you to use a function I wrote a few months back to disable it (you can check it out at http://www.happysysadm.com/2013/03/disabling-windows-firewall-in-powershell.html). This will be a good learning experience for any Powershell novice:


You have now to create the ISCSI targets. Let’s see which one of the available roles can help you:
Get-WindowsFeature | ? name -like *iscsi*

Display Name                                            Name
------------                                            ----
        [ ] iSCSI Target Server                         FS-iSCSITarget-Server
        [ ] iSCSI Target Storage Provider (VDS and V... iSCSITarget-VSS-VDS
Cool there you have it! A small tip: you don’t need the second listed role because providers are for remote Target management only, so you have to add the first role. Open Powershell, and run the following cmdlet:
Add-WindowsFeature FS-iSCSITarget-Server

Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {File and iSCSI Services, File Server,...
WARNING: Windows automatic updating is not enabled. To ensure that your newly-installed role or feature is automatically updated, turn on Windows Update.
To put in place the back-end storage, you will take advantage of the feature of Windows 2012 named Storage Spaces. Start to add three disks to the LAB2013ISCSI01 virtual machine:


Use Get-PhysicalDisk to check that these three physical disks are seen from Windows (this should happen straight away):
Get-PhysicalDisk

FriendlyName  CanPool       OperationalS HealthStatus Usage                Size
                            tatus
------------  -------       ------------ ------------ -----                ----
PhysicalDisk0 False         OK           Healthy      Auto-Select         60 GB
PhysicalDisk1 True          OK           Healthy      Auto-Select        100 GB
PhysicalDisk2 True          OK           Healthy      Auto-Select        100 GB
PhysicalDisk3 True          OK           Healthy      Auto-Select        100 GB
That’s very good. Now filter down only the disks that are available to be added to a Storage Pool:
Get-PhysicalDisk -CanPool $true

FriendlyName  CanPool       OperationalS HealthStatus Usage                Size
                            tatus
------------  -------       ------------ ------------ -----                ----
PhysicalDisk1 True          OK           Healthy      Auto-Select        100 GB
PhysicalDisk2 True          OK           Healthy      Auto-Select        100 GB
PhysicalDisk3 True          OK           Healthy      Auto-Select        100 GB
Notice that the switch that you find in many online documents –ispooled is wrong. This parameter do not exist. "Get-PhysicalDisk -CanPool $True" must be used instead.
Then we have to create the Storage Pool:
New-StoragePool -FriendlyName "LAB2013SPOOL01" -PhysicalDisks (Get-PhysicalDisk –CanPool $True) -StorageSubSystemFriendlyName ((Get-StorageSubSystem).Friendlyname)
FriendlyName    OperationalStat HealthStatus    IsPrimordial    IsReadOnly
                us
------------    --------------- ------------    ------------    ----------
LAB2013SPOOL01  OK              Healthy         False           False
Once the pool is ready, you have to set up a new virtual hard-disk on it. That’s done with the New-VirtualDisk cmdlet. This cmdlet has three possible storage layout:
  • simple (similar to RAID0, insecure but fast) 
  • mirror (similar to RAID1, increased reliability but reduced capacity) 
  • parity (similar to RAID5, protect against single disk failure)
Parity is the best possible layout in this scenario so go for it:
New-VirtualDisk -StoragePoolFriendlyName "LAB2013SPOOL01" -FriendlyName
LibraryDisk -ResiliencySettingName Parity -Size 250GB -ProvisioningType Thin
FriendlyName  ResiliencySet OperationalS HealthStatus IsManualAtta         Size
              tingName      tatus                     ch
------------  ------------- ------------ ------------ ------------         ----
LibraryDisk   Parity        OK           Healthy      False              250 GB
Proceed to the initialization of this disk and assign all the space to a X: partition with the help of the -UseMamimumSize switch:
Get-VirtualDisk -FriendlyName "LibraryDisk" | % {
 $_ | get-disk | Initialize-Disk -PartitionStyle "GPT"
 $_ | get-disk | New-Partition -DriveLetter X -UseMaximumSize
}
PartitionNumber  DriveLetter Offset                    Size Type
---------------  ----------- ------                    ---- ----
2                X           135266304            249.87 GB Basic
Format-Volume -DriveLetter X -FileSystem NTFS -NewFileSystemLabel "LibraryPartition”
DriveLetter FileSystemL FileSystem  DriveType  HealthStat SizeRemain       Size
            abel                               us                ing
----------- ----------- ----------  ---------  ---------- ----------       ----
X           LibraryP... NTFS        Fixed      Healthy     249.75 GB  249.87 GB
Now, since you are in a lab and you want to test as many cmdlets as possible, why not to enable the Deduplication mechanism we have already explored in past posts:
Add-WindowsFeature FS-Data-Deduplication
Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {Data Deduplication}
WARNING: Windows automatic updating is not enabled. To ensure that your newly-installed role or feature is automatically updated, turn on Windows
Update.
Import-Module Deduplication
Enable-DedupVolume -Volume X:

Enabled            UsageType          SavedSpace           SavingsRate
-------            ---------          ----------           -----------
True               Default            0 B                  0 %
It’s time now to create a Logical Unit (LU) in the form of a VHDX file on that partition.

Note how the extension has changed from VHD under Windows 2012 to VHDX under Windows 2012 R2. The main difference is that a VHD can be as large as 2TB where VHDX can go up to 64TB. Also VHDX are more resilient to VM hard shutdown.

The next cmdlet to use is New-IscsiVirtualDisk: what it actually does is to create a new iSCSI Virtual Hard Disk (VHDX) object with the specified file path and size. After the iSCSI VHDX object has been created, the virtual disk will be assigned to an iSCSI target. Then, once any allowed initiator connects to that target, it will have access to the virtual disk.
New-IscsiVirtualDisk -Path x:\LUN01.vhdx -size 10GB

ClusterGroupName   :
ComputerName       : LAB2013ISCSI01.lab2013.local
Description        :
DiskType           : Dynamic
HostVolumeId       : {C79A68FA-24D7-455A-907A-59E33B9DFA76}
LocalMountDeviceId :
OriginalPath       :
ParentPath         :
Path               : x:\LUN01.vhdx
SerialNumber       : FED7206D-8E1B-46B5-A495-9FB6B59CFE26
Size               : 10737418240
SnapshotIds        :
Status             : NotConnected
VirtualDiskIndex   : 286335802
New-IscsiVirtualDisk -Path x:\LUN02.vhdx -size 120GB

ClusterGroupName   :
ComputerName       : LAB2013ISCSI01.lab2013.local
Description        :
DiskType           : Dynamic
HostVolumeId       : {C79A68FA-24D7-455A-907A-59E33B9DFA76}
LocalMountDeviceId :
OriginalPath       :
ParentPath         :
Path               : x:\LUN02.vhdx
SerialNumber       : A369C59D-EAFE-462A-8645-5B8A33BA2A69
Size               : 128849018880
SnapshotIds        :
Status             : NotConnected
VirtualDiskIndex   : 232699603
New-IscsiVirtualDisk -Path x:\LUN03.vhdx -size 120GB

ClusterGroupName   :
ComputerName       : LAB2013ISCSI01.lab2013.local
Description        :
DiskType           : Dynamic
HostVolumeId       : {C79A68FA-24D7-455A-907A-59E33B9DFA76}
LocalMountDeviceId :
OriginalPath       :
ParentPath         :
Path               : x:\LUN03.vhdx
SerialNumber       : 25AA6011-239E-468D-9DB4-DD53EE7ED5B6
Size               : 128849018880
SnapshotIds        :
Status             : NotConnected
VirtualDiskIndex   : 673788947
You have just created three virtual disks (two bigger and one smaller, you'll see later why). Create now a new ISCSI target (pay attention to the type definition prefix IQN before the actual iqn and to the use of the array syntax @() to pass more than one IQN at the time):
New-IscsiServerTarget -TargetName Target01 -InitiatorIds @("IQN: iqn.1991-05.com.microsoft:lab2013hv01.lab2013.local","IQN: iqn.1991-05.com.microsoft:lab2013hv02.lab2013.local")
ChapUserName                :
ClusterGroupName            :
ComputerName                : LAB2013ISCSI01.lab2013.local
Description                 :
EnableChap                  : False
EnableReverseChap           : False
EnforceIdleTimeoutDetection : True
FirstBurstLength            : 65536
IdleDuration                : 00:00:00
InitiatorIds                : {Iqn:-iqn.1991-05.com.microsoft:lab2013hv01.lab2013.local,
                              Iqn:-iqn.1991-05.com.microsoft:lab2013hv02.lab2013.local}
LastLogin                   :
LunMappings                 : {}
MaxBurstLength              : 262144
MaxReceiveDataSegmentLength : 65536
ReceiveBufferCount          : 10
ReverseChapUserName         :
Sessions                    : {}
Status                      : NotConnected
TargetIqn                   : iqn.1991-05.com.microsoft:lab2013iscsi01-target01-target
TargetName                  : Target01
Repeat that step twice for the other VHDX:
New-IscsiServerTarget -TargetName Target02 -InitiatorIds @("IQN: iqn.1991-05.com.microsoft:lab2013hv01.lab2013.local","IQN: iqn.1991-05.com.microsoft:lab2013hv02.lab2013.local")
New-IscsiServerTarget -TargetName Target03 -InitiatorIds @("IQN: iqn.1991-05.com.microsoft:lab2013hv01.lab2013.local","IQN: iqn.1991-05.com.microsoft:lab2013hv02.lab2013.local")
Or (if you prefer to use the IP address, which I must admit it’s simpler):
New-IscsiServerTarget -TargetName Target01 -InitiatorIds ipaddress:192.168.134.20,ipaddress:192.168.134.21
New-IscsiServerTarget -TargetName Target02 -InitiatorIds ipaddress:192.168.134.20,ipaddress:192.168.134.21
New-IscsiServerTarget -TargetName Target03 -InitiatorIds ipaddress:192.168.134.20,ipaddress:192.168.134.21
Then assign each target to a specific VHDX:
Add-IscsiVirtualDiskTargetMapping Target01 X:\LUN01.vhdx
Add-IscsiVirtualDiskTargetMapping Target02 X:\LUN02.vhdx
Add-IscsiVirtualDiskTargetMapping Target03 X:\LUN03.vhdx
Ok, that’s all for the ISCSI Target Server configuration. Just note the Target IQN for reference:
Get-IscsiServerTarget | select targetIqn

TargetIqn
---------
iqn.1991-05.com.microsoft:lab2013iscsi01-target03-target
iqn.1991-05.com.microsoft:lab2013iscsi01-target02-target
iqn.1991-05.com.microsoft:lab2013iscsi01-target01-target
Time to configure the ISCSI initiators on the Hyper-V servers, which I will explain in the next post!

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.
Related Posts Plugin for WordPress, Blogger...