PowerShell Deployment Toolkit – Deploying an Operations Manager 2012 R2 Lab

So a few months ago I was at the Arizona System Center User Group (AZSMUG) and our guest speaker did a demo on the PowerShell Deployment Toolkit PDT).  During a few of my longer flights and boring days (very few of these) between clients I have started to mess around with deploying a few different lab environments.

Through some ups and downs I have been able to successfully deploy a System Center 2012 R2 Configuration Manager (SCCM) lab, both with creating my VM Guest on Hyper-V running on Windows 8.1 and also deploying to pre-existing VM guest on VMware Workstation 10.  It is a long story why I had to use VMware Workstation but we all have those flaws. :)

Since I have a System Center 2012 R2 Operations Manager project coming up shortly I have decided to write my next blog on how I have been successful at deploying a working SCOM 2012 R2 lab using PDT.

I will be using the latest version of the PowerShell Deployment Toolkit as of this blog PDT 2.64.2611.  I also will be using the newest PDT GUI, PDTGUI version 1.1.  In my experience, I don’t always truly rely on the GUI, I have ran into some issues of my own and still had to manually edit a few of the XML files.


My Lab Environment

My lab for this demo is pretty simple.  Since I have to travel for work and may be without internet for periods of time I have gotten use to using my work supplied laptop for these test labs I deploy using the PDT.

I will be using a Dell Latitude E6530 with 16GB installed memory, an Intel Core i7 CPU, and with 500GB hard drive running Windows 8.1.  All my PDT files are located on an external 1 TB Toshiba USB hard drive.

image


Preparing for PowerShell Deployment Toolkit

Installing and Configuring the Hyper-V Role

I have installed the Hyper-V role on my Windows 8.1 laptop.  I also have configured the Hyper-V role to place the VHD’s on a location on my local drive.

  1. Install the Hyper-V Role on Windows 8.1 open a PowerShell window in Administrator mode:

    Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online -All -NoRestart

  2. Configure the location of the VHD and Virtual Hard Disk.  Our VHDx will be located C:\Hyper-V\
  3. Create our Virtual Switch Manager

    I created 2 Virtual Switches for this lab. The virtual switch that I will use for all VM’s is CorpNet01. CorpNet01 is an Internal only network.  I have also created WAN that I will later assign to my Management Server for internet access.

    image

Configuring PDT Folder Structure

I have created my location where I will store the PDT files and various downloads.

  1. Configure the location for the PowerShell Deployment ToolkitI use my external USB hard drive which is currently my D drive.  I have created a directory called PDT located on D:\.
  2. I then have created the following directories within the PDT directory.

    D:\PDT\VHD
    D:\PDT\Installer
    D:\PDT\Installer\OperationsManager.en
    D:\PDT\Installer\WindowsServer2012
    D:\PDT\Installer\WindowsServer2012R2
    D:\ISO

Downloading PDT Software
  1. Download PDTGUI_v1.1_ALL.zip  (D:\Downloads)
  2. Download Convert-WindowsImage (D:\PDT\)
  3. Download Windows Server 2012  (D:\ISO)
  4. Download Windows Server 2012 R2 (D:\ISO)
  5. Download System Center 2012 R2 Operations Manager (D:\ISO|
Extract Downloaded Software
  1. Extract the Windows Server 2012 ISO to  D:\PDT\Installer\WindowsServer2012
  2. Extract the Windows Server 2012 R2 ISO to D:\PDT\Installer\WindowsServer2012R2
  3. Extract System Center 2012 R2 Operations Manager to D:\PDT\Installer\OperationsManager.en
  4. Extract PDTGUI_v1.1_All.zip to D:\PDT
Create our reference Windows Server 2012 R2 VHD File
  1. Open PowerShell in Administrator mode
  2. Change Directory to D:\PDT where I had previously downloaded Convert-WindowsImage.ps1 script.
  3. Run .\Convert-WindowsImage

.\Convert-WindowsImage.ps1 -SourcePath D:\ISO\SW_DVD5_Windows_Svr_Std_and_DataCtr_2012_R2_64Bit_English_Core_MLF_X19-05182.ISO -VHDPath D:\PDT\VHD\WS12R2DG2.vhdx -SizeBytes 40GB -VHDFormat vhdx -VHDType Dynamic -VHDPartitionStyle GPT -Edition ServerDataCenter –EnableRemoteDesktop

image

image


Getting Started

Configuring PDT GUI
  1. Open a PowerShell window in Administrator mode.
  2. Run D:\PDT\PDT-GUI.Export.ps1
  3. Click OK to download PDT now.Since this is the first time we have run pdt-gui.export.ps1 for this location we will get a prompt No workflow.xml.image
  4. Click I agree on the EULA.
  5. Downloads the needed files for PDT
  6. PDT GUI will open
  7. Close the PDT GUI Window
Editing the Workflow.xml

Since this version of PDT has been released Microsoft has released updated software versions for the ConfigMgr.Manifest.cab and Report Viewer 2012 installation file.  We will need to edit the file size for the Report Viewer 2012 located in the Workflow.xml.  Since we are deploying Operations Manager, we won’t touch the ConfigMgr.Manifest.cab file.  Just wanted to make note of it for any future ConfigMgr Lab deployments.

  1. Edit workflow.xml located in D:\PDT
    I use Notepad ++ to edit my XML files. Any XML editor will work.
  2. Search for Report Viewer 2012
  3. Locate <FileSize>  </FileSize>
  4. Change to 7622656 (File size currently at time blog was posted)
  5. Added the new Product Code: {C58378BC-0B7B-474E-855C-9D02E5E75D71} to the <Value> </Value> located under
  6. <Type>ProductCode</Type>

    image

  7. Save the file.

Deploying Operations Manager using PDT

Now we are ready to edit our variable.xml file.  This can be done using an XML editor or by using the PDT GUI.  For this lab I will use the GUI to show how to edit the variable.xml.

PDT Files Explanation

I will be the first to admit.  I am no PDT expert.  It has taken me many trial and errors to get to the point where I can deploy a ConfigMgr or OpsMgr lab using PDT.  So I will take some time to explain what I did to deploy these labs successfully.

There are 4 PowerShell scripts and 2 XML files that make up the PowerShell Deployment Toolkit.

  • Downloader.ps1
  • Installer.ps1
  • VMCreator.ps1
  • PDT-GUI.Export.ps1
  • Variable.xml
  • Workflow.xml

If we are running these scripts manually outside of the PDT-GUI.Export.ps1 then we would use Downloader.ps1 to download the needed requirements.   Now, if you are having PDT create your VM’s then we would run VMCreator.ps1.  If you already have your VM’s or physical boxes in place, then you would then run installer.ps1.  Now, I may be incorrect but this is what I have figured out through out playing with PDT.  Now, you will need to make sure you have your Variable.xml file configured correctly before running those scripts.  The workflow.xml file is something that isn’t edited except for those special occasions when a file size changes or product id changes like with the Report Server 2012.

Configuring the Deployment (Variable.xml)

We will create our own customized Variable.xml file using the GUI.

1.  Open PowerShell in Administrator mode.
2.  Run D:\PDT\PDT-GUI.Export.ps1
3.    The first screen in the PDT GUI is the About screen.  Click Next to continue. GUI_01_About
4.  This is where we will create our customized variable.xml.

5. Click the bullet next to Create a new deployment scenario.

6.  Enter Operations Manager 2012 R2 for both Name and Description.

7.  Click Open.  This will take you to the General tab.

To reopen the file, keep the Select existing file in PDT GUI directory selected, then select your Scenario and click Open.

GUI_02_Select File
8.  Here we will enter some basic information like the installation account and password, the location the downloaded files will be placed when we run the Downloader.ps1, and basic Registration and Product ID Key information.

9.  From my experiences, the SourcePath is where the Installer.ps1 and/or the VMCreator.ps1 will look for the source files during the role installation and any dependent software.  I have chosen to use $SystemDrive\Temp so when the installation begins, it will look for all it’s files in C:\Temp\

10.  Download field is where the Downloader.ps1 script will download all the files needed to deploy Operations Manager.

Click Next to move on to the VMs Tab.

GUI_03_General
11.  The VM tab is split into 3 sections.  Domain, Default VM Settings, and VMs. For my labs, I will select Create a new Active-Directory-Forest under the Domain tab.  If you are deploying to a preexisting lab or production environment that already has a domain you can leave that box unchecked.

12.  I will create AD forest and domain called lab.local and will have the service accounts to the Services OU and groups into the Groups OU.

GUI_04_VM_Domain
NOTE:  In order for the PDT to create Generation 2 VM’s you will need to edit the newly created Variable.xml.  Close the PDT GUI at this time. Right click on the newly created Variable.xml file located at D:\PDT\Operations Manager 2012 R2\ directory and select Edit.

Scroll down to the <VMs> section.  You will need to add the following line just under <Default>

<VMGeneration>2</VMGeneration>

Save your file.  Open PDT GUI and select the Operations Manager 2012 R2 file and continue on.

image
13.  On the Default VM Settings tab you will enter in the needed information for each VM that the VMCreator.ps1 script will create.

14.  If you select Default on the left window, all the value settings for the entire section will be available on the right.

15.  The following settings I have changed or added in order to make my deployment successful.

image
VMGeneration:
Host:
2
LocalHost
NetworkAdapter
VirtualSwitch:
Prefix:
Sequence:
Mask:
Gateway:
DNS:
CorpNet01
192.168.1.
4
24
192.168.1.1
192.168.1.4
Note:  The first machine created will be your domain controller if you have selected to create an Active Directory Forest.  If you keep the default Sequence as 4, your domain controller will be x.x.x.4.
OSDisk
Parent:
D:\PDT\VHD\WS12R2DG2.vhdx
Note: The Parent value will give the path to the newly created VHDx that we created earlier using the Custom-WindowsImage.ps1.
Type: Copy
Note:  Type can be Copy, Fixed, or Differencing. Copy takes longer but you don’t have to worry about a link between the parent and the newly created disk.
DataDisks
Count:
Size:
0
0
Note:  Under the VM’s tab we can add our data disk to specific servers like our database server.  Not every server we are deploying needs a datadisk.  This is to save room on my laptop’s hard drive.
JoinDomain
Domain:
lab.local
Credentials
Domain:
Password:
Username:
lab.local
P@ssw0rd1234
svc.installer
OrganizationUnit Servers
AdministratorsPassword: P@ssw0rd1234
On the VM’s tab we will now customize our VM’s that will be used for this deployment. Even if you are not planning on using VMCreator.ps1 and already have your physical or VM guest deployed, you will still need to add your VM names here for Role installations.
16. The Domain Controller needs to be the first one listed here if you are deploying new VM’s.  For my lab I have not added any other customizations to the DC like I have for my DB and OM VM guest. image
17.  My DB, I have added customized settings for Memory and for Datadisk.  For my datadisk I have added 6 new disk, in the VHDx format, and 20 GB in size. image
18.  For my Operations Manager VM I have added a customer setting for a single datadisk that I will then have the role installed to later in the GUI. image
19.  The next tab will allow us to customize our SQL installation, the accounts used, and the locations of the data and log files.  You can get creative and have PDT create a clustered instance of SQL as well.

In this lab we will be using SQL Server 2012

I have split out the logs and data files across 5 of those 6 new data drives we configured above.  SQL itself will be installed on the the other remaining data drive.

GUI_07_SQL
20.  Here is where we will add our roles and designate what servers those roles will be installed on.

At the bottom of the windows under Component, look for System Center 2012 R2 Operations Manager, click on it. Under the roles window to the right select the role you want to install and the server in the drop down menu, click Add Selected Role.

For this lab we will install the Database Server, the Data warehouse Server, the Reporting Server on our DB Server.  We will  then install the remaining roles to our OM server.

Remember, this is a lab not a production environment so getting away with this works fine.  :)

21.  On the Components and roles to be installed sections we can configure each role starting with Operations Manager itself.

I have chosen to install the Management server on my D:\ drive.  We will create our Management Group Name and designate our Operations Manager Admins Group here as well as all our service accounts for our Action Account, DAS account, Data reader and Writer Accounts and so on.

GUI_08_Roles

image

image

image

22.  The last tab is Finish Tab.  Here we will start the actual download of all the components and prerequisites that we need for our Operations Manager deployment. GUI_09_Finish

At this point we are ready to run the Downloader.ps1 script either from a PowerShell command or from the PDT GUI itself.

Downloading Requirements (Downloader.ps1)

The Downloader is pretty simple script.  From the GUI, under the Finish tab you have a Start downloader button.  Since we are only deploying one component of System Center and don’t need every prerequisite from every product we will need to make sure that the box next to DeployimentOnly is checked.  If you are running this from the PowerShell command the line would look something like this:

.\Downloader.ps1 -DeploymentOnly

However, we are running this from the GUI, so just click Start Downloader. GUI_09_Finish
It will then download our needed files, except for the Windows Server OS’s and our System Center bits.  All these files will have been downloaded to D:\PDT\Installer Downloader_01
Once complete we are ready to move on to the VMCreator.ps1 script or from within the GUI the Run VMCreator button. image
Creating our VM’s (VMCreator.ps1)

At this stage we are ready to kick off our VMCreator.ps1 script.  If you have already prepared your servers and will not have the PDT create them for you, you can skip this section and move on down to Installing to Existing servers (Installer.ps1) section below.

If you are planning on running the script from the PowerShell command all you need to do is to run the command:

.\VMCreator.ps1

1.  From the PDT GUI we will click the Finish Tab and click Run VMCreator. GUI_09_Finish
2.  Here the VMCreator.ps1 script creates the three VM’s we will use.  It configures the network settings.  It will also copy everything from the D:\PDT\Installer folder to the C:\Temp folder on the first server, in our case it is out DC. VMcreate_01
3. Toward the end of the first part of this script before our Installer.ps1 script takes over.  It will wait until Active Directory is fully configured on DC, then end the task and pass off the rest of the deployment to the script running on DC. 07
4.  We now move over to the newly created DC VM.  We will see a script running.  AD is being installed and configured. 11
5.  The service accounts, groups, etc are created. 12
6.  After AD is configured the DC is rebooted and then our two other servers are started (DB and OM). 15
7.  The VMCreator.ps1 script is now complete and can be closed.  At this point the Installer.ps1 script will continue to run on the DC. 14
8.  You can monitor the deployment by connecting to your DC. VMcreate_11
9.  More validations VMcreate_05
10.  More validations VMcreate_06
11.  Initializing… VMcreate_07
12.  It is now starting the deployment.   Copying the source files from C:\Temp on DC to the two others servers. VMcreate_12
13.  Here we see that it is installing Operations Manager on our om.lab.local server.  While our Database server is holding in yellow for the task to complete on OM. VMcreate_13
14.  We now see that Operations Manager has been installed and that the Reporting Server is being installed on our DB and that the Web Console is being installed on our OM server. VMcreate_14
15.  Here we are still waiting for the Reporting Server to be installed on our DB server.  However, we are finished with our OM server and it is cleaning up temp files. VMcreate_15
16.  The green shows the task that are finished successfully.  We have our management server installed, the consoles installed and still waiting for the reporting server to install. VMcreate_16
17.  All is done and the DB is being cleaned up for completion. VMcreate_17
18.  Everything is green and we are done. VMcreate_18

At this point we should now have a working Operations Manager 2012 R2 environment.  You can now log on to the Operations Manager box and continue configuring OpsMgr from a freshly installed environment.

Installing To Existing Servers (Installer.ps1)

You may have an environment were you want to deploy a lab or production environment on existing equipment or VM’s.  You may not have Hyper-V and only have VMware Workstation installed on your laptop/lab environment.

If this is the case you will skip the VMCreator.ps1 script.  You are also done with the PDT GUI at this time as well.  Now, there may be another way to do this but this is the way I have deployed a working ConfigMgr lab to an environment running on VMware Workstation.

  1. Make sure all groups and service accounts are configured in active directory.
  2. Make sure all the OpsMgr service accounts are properly configured on the correct servers.
  3. Verify all the drives have been added and match our variable.xml we created earlier.
  4. Overall, make sure the environment is ready for deployment.
  5. Copy the contents of the D:\PDT\Installer folder to the C:\Temp\ directory on a domain controller in the lab environment you are going to be deploying to.  You can choose another server if you need, just make sure it is on the domain and has access to the servers we are configuring, the OM and the DB.
  6. Copy workflow.xml and installer.ps1 from D:\PDT to the C:\Temp folder as well.
  7. Now copy the variable.xml file from the Operations Manager 2012 R2 folder in D:\PDT\ to the C:\Temp folder.
  8. Logon to the server  that the files had been copied.
  9. Open a PowerShell window in Administrator mode.
  10. Run the command from the C:\Temp directory:     .\installer.ps1
  11. The installer will walk through the validation like the VMCreator script and then start deploying Operations Manager.

Thoughts and Resources

Now, how I have used the PowerShell Deployment Toolkit and how it should be used might be two different things.  The way I have been able to do it works for me.  This is not meant to be a “Best Practice” guide on PDT.  I just wanted to share how I did it and hopefully it will help guide some people the right direction.  There isn’t very much documentation right now on this product outside the small group that has created the tool.  If you find a better way to do what I have done, contact me.  I am always up to learn other ways.

Below are some other blog sites that have helped me get to where I am now with deploying System Center products using PDT.  You will see everyone has their own way at this time.

Advertisements
Tagged with: , ,
Posted in Operations Manager 2012 R2, PowerShell Deployment Toolkit, System Center 2012 R2

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow Kristopher Jon Turner on WordPress.com
Archives
%d bloggers like this: