Presentation is loading. Please wait.

Presentation is loading. Please wait.

Automating SQL Buildouts With Hyper-V and SQL Server 2008 R2 Robert L Davis, Sr. DBA, Microsoft Corp.

Similar presentations


Presentation on theme: "Automating SQL Buildouts With Hyper-V and SQL Server 2008 R2 Robert L Davis, Sr. DBA, Microsoft Corp."— Presentation transcript:

1 Automating SQL Buildouts With Hyper-V and SQL Server 2008 R2 Robert L Davis, Sr. DBA, Microsoft Corp.

2 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Agenda

3 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Introduction: Who am I?

4 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 SysPrep for SQL Server 2008 R2  Now supported in R2  Two step process  Prepare image  Complete image  Prepare image once  Save as a VHD  Complete image as often as you like  Complete walkthrough online on my blog: http://www.sqlsoldier.com/wp/sqlserver/walkthroughforsysprepinsqlserver2008r2

5 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Hyper-V on Windows Server 2008 R2  Free with Windows Server 2008+  Free as a stand-alone Microsoft Hyper-V Server  Lots of tools for easy management  Maximum support for SQL Server virtualization  Supported by SQL Server for guest host clustering

6 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 SysPrepping SQL Server on Hyper-V 1 Create base VM 23

7 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 SysPrepping SQL Server on Hyper-V 1 Create base VM 2 Prepare image 3

8 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 SysPrepping SQL Server on Hyper-V 1 Create base VM 2 Prepare image 3 Complete image

9 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 1 Create base VM 23 SysPrepping SQL Server on Hyper-V 1.Copy the VHD to the new path for the VM 2.Open Hyper-V Virtual Machine Manager 3.Create a new Virtual Machine 4.Skip the first page of the dialog 5.Specify a name for the VM and the location from step 1 6.Assign memory for the VM 7.Configure Networking 8.Connect Virtual Hard Disk 9.Check the Summary to make sure everything looks okay 10.Click on Finish 11.Start the VM and connect to it 12.Rename the instance to the desired name and reboot

10 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 2 Prepare image 23 SysPrepping SQL Server on Hyper-V 1.Connect to the VM 2.Copy the SQL Server 2008 R2 installation files to the VM 1.Or make the file accessible over the network 3.Start the installation 4.Install any pre-requisites if prompted 5.When Installation Center starts, select the Advanced tab 6.Click on “Image preparation of a stand-alone instance of SQL Server” 7.Install the Setup Support Files and click Next 8.Agree to licensing statement and click Next 9.Select the features you want included in this image and click Next 1.This list is a very short list (continued)

11 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 2 Prepare image 23 SysPrepping SQL Server on Hyper-V 10.Enter an Instance ID and click Next 1.Not the Instance name that will be used in the final install 2.Identifies the prepared image in case you have multiple 11.Confirm disk space requirements and click Next 12.Check Image Rules and click Next 13.Confirm image configuration and click Prepare 14.When image preparation completes, click Next 15.Click Close 16.Log off of the VM 17.Using Hyper-V Manager, shut the VM down 18.Copy the VHD for the prepared VM image to your VM image store

12 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 3 Complete image 23 SysPrepping SQL Server on Hyper-V 1.Copy the VHD you created to the location of the new VM 2.Create a new VM the same way you did in part 1 using the new VHD 3.Start and connect to the new VM 4.Rename the VM to the desired final name and reboot 5.Connect to the VM 6.Navigate to and click on “Complete SQL Server 2008 R2 Installation” 1.Microsoft SQL Server 2008 R2 -> Configuration Tools 2.Or start Installation Center and looking under the Advanced tab 7.Install the Setup Support Files 8.Enter the Product Key or select a free edition 9.Agree to the licensing terms (continued)

13 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 3 Complete image 23 SysPrepping SQL Server on Hyper-V 10.Select the Instance ID of the prepared image you want to complete and click Next 1.The same Instance ID you entered in Part 2 11.Verify the features you are installing and click Next 1.The features selected in Part 2 are displayed 2.Cannot change the features 12.Configure the instance to install as and click Next 1.Default instance or a named instance 13.Verify the image rules and click Next 14.Verify the summary information and click Complete 15.When the image progress completes, click Next (continued)

14 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 3 Complete image 23 SysPrepping SQL Server on Hyper-V 16.Click Close 17.Check the program files and see your installation 1.Feature set is limited with no SSMS, client connectivity, Books Online, etc. 18.Run Installation Center again and install the missing features that you want 19.Connect to your completed instance

15 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 SysPrepping SQL Server on Hyper-V Demo Environment:  Windows Server 2008 R2 Datacenter Edition  Hyper-V  Hyper-V Virtual Machine Manager  SQL Server 2008 R2 Datacenter Edition  PowerShell 2.0

16 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 SysPrepping SQL Server on Hyper-V

17 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 How do you automate it? Elfin magic? Complex machine? Complex system of tubes & monkeys? PowerShell?

18 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Automating with PowerShell PowerShell 2.0  PowerShell Management Library for Hyper-V  http://pshyperv.codeplex.com/ http://pshyperv.codeplex.com/  Interfaces with WMI  Created by James O’Neill (MSFT UK)  TechNet Wiki Hyper-V Portal: Scripts  http://social.technet.microsoft.com/wiki/contents/articles /hyper-v-scripts.aspx http://social.technet.microsoft.com/wiki/contents/articles /hyper-v-scripts.aspx

19 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Automating with PowerShell 1 Deploy base VHD 2 Create and configure VM 3 Complete SQL SysPrep 4 Add additional features

20 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Automating with PowerShell 1 Deploy base VHD 2 Create and configure VM 3 Complete SQL SysPrep 4 Add additional features

21 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Automating with PowerShell 1 Deploy base VHD 2 Create and configure VM 3 Complete SQL SysPrep 4 Add additional features

22 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Automating with PowerShell 1 Deploy base VHD 2 Create and configure VM 3 Complete SQL SysPrep 4 Add additional features

23 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Automating with PowerShell 1 Deploy base VHD 2 Create and configure VM 3 Complete SQL SysPrep 4 Add additional features 1.Copy the VHD to the new path for the VM 1.PowerShell Command: Copy-Item 2.Rename during copy 3.Example: Copy-Item –LiteralPath “D:\VHDs\My.vhd” –Destination “D:\HyperV”

24 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Automating with PowerShell 2 Create and configure VM 2 3 Complete SQL SysPrep 4 Add additional features 1.Script existing VM as model for new VM 1.PowerShell command: Get-VMBuildScript 2.Create PowerShell script from output 3.Example: Get-VMBuildScript “SQLPASSVM” 2.Modify script 1.Add double-quotes around key values 2.Add parameter for VM Name 1.String 2.Mandatory 3.Add copy command 1.Use VM Name parameter for new VHD file name

25 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Automating with PowerShell 3 Complete SQL SysPrep 2 Create and configure VM 3 Complete SQL SysPrep 4 Add additional features 1.Follow Steps to complete image as noted previously

26 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Automating with PowerShell 4 Add additional features 2 Create and configure VM 3 Complete SQL SysPrep 4 Add additional features 1.Log in to VM 2.Add any additional features you want

27 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Automating with PowerShell

28 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Resources  Walkthrough for SysPrep in SQL Server 2008 R2  http://www.sqlsoldier.com/wp/sqlserver/walkthroughfors ysprepinsqlserver2008r2 http://www.sqlsoldier.com/wp/sqlserver/walkthroughfors ysprepinsqlserver2008r2  PowerShell Management Library for Hyper-V  http://pshyperv.codeplex.com/ http://pshyperv.codeplex.com/  Created by James O’Neill (MSFT UK)  TechNet Wiki Hyper-V Portal: Scripts  http://social.technet.microsoft.com/wiki/contents/articles /hyper-v-scripts.aspx http://social.technet.microsoft.com/wiki/contents/articles /hyper-v-scripts.aspx  VHDs for Windows – Test Drive Program  Free evaluation edition VHD’s for download  http://technet.microsoft.com/en-us/bb738372.aspx http://technet.microsoft.com/en-us/bb738372.aspx

29 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Resources  Microsoft SQL Server 2008 Administration with Windows PowerShell  http://www.amazon.com/Microsoft-Administration-Windows- PowerShell-Programmer/dp/0470477288/ref=sr_1_1 http://www.amazon.com/Microsoft-Administration-Windows- PowerShell-Programmer/dp/0470477288/ref=sr_1_1  By Ananthakumar Muthusamy (MAK) and Yan Pan  James O’Neill’s blog  http://blogs.technet.com/b/jamesone http://blogs.technet.com/b/jamesone  Tony Soper’s blog  http://blogs.technet.com/b/tonyso/ http://blogs.technet.com/b/tonyso/  Hash tags for quick help on Twitter  #sqlhelp  #poshhelp

30 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 My Resources  Blog: http://www.sqlsoldier.comhttp://www.sqlsoldier.com  Twitter: http://twitter.com/SQLSoldierhttp://twitter.com/SQLSoldier  Movember: http://us.movember.com/mospace/618068/ http://us.movember.com/mospace/618068/  All files from this presentation can be downloaded from: http://www.sqlsoldier.com/PASS2010http://www.sqlsoldier.com/PASS2010

31 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Questions & Answers

32 Automating SQL Buildouts with Hyper-V and SQL Server 2008 R2 DBA249 Complete the Evaluation Form to Win! Win a Dell Mini Netbook – every day – just for handing in your completed form. Each session evaluation form represents a chance to win. Pick up your evaluation form: In each presentation room At the PASS Booth near registration Drop off your completed form: Near the exit of each presentation room At the PASS Booth near registration Sponsored by Dell

33 Thank you for attending this session and the 2010 PASS Summit in Seattle


Download ppt "Automating SQL Buildouts With Hyper-V and SQL Server 2008 R2 Robert L Davis, Sr. DBA, Microsoft Corp."

Similar presentations


Ads by Google