Tip:
Highlight text to annotate it
X
Creating an Amazon Machine Image of a customized database server is the next step in
deploying a SharePoint web site in the Amazon Web Services cloud.
You should already have launched the network and Active Directory stack for SharePoint
as demonstrated in the previous video in this series.
This video shows you how to create a customized AMI of a SQL Server 2008 R2 database server,
starting from a standard AMI of Microsoft SQL Server Standard 2008 R2 on Windows Server 2008 R2, to enable it for CloudFormation.
Creating the database server AMI is the first stage of launching the database stack for a SharePoint farm on AWS.
The details of all these procedures and the relevant links are spelled out in the companion document.
The AMI you begin with will be a standalone instance outside of the VPC, and you’ll need to access it using Remote Desktop Connection.
So before you begin creating the AMI, create a rule in the default security group that allows inbound Remote Desktop Protocol on port 3389.
In the EC2 console in the left pane, click Security Groups.
Check the default group and in the pane that opens below, click the Inbound tab.
If there’s not already a rule in the right section under TCP Port that says 3389 (RDP),
click the Create a new rule dropdown list and select RDP from the list.
Click the Add Rule button, then click the Apply Rule Changes button.
This opens port 3389 for inbound RDP traffic, which will enable you to log onto the instance and perform the necessary operations on it.
Now we’re ready to create the custom SQL Server AMI.
Start with the most recent AMI of Amazon EBS-Backed Windows Server 2008 R2 English 64-bit
with SQL Server Standard 2008 R2 in the AMI catalog.
Launch this AMI of SQL Server on Windows Server as a standalone EC2 instance
outside of the Virtual Private Cloud infrastructure you’ve created so far, but in the same region – we’re using US East (Northern Virginia).
On the Choose an AMI page, accept the defaults.
On the Instance Details page, select m1.small as the instance type and accept the defaults for the rest of the choices.
For Advanced Instance Options, Storage Device Configuration and tags, accept the defaults.
On the Create Key Pair page, choose the key pair you created previously.
For Configure Firewall, accept the defaults.
On the Review page, check to make sure the information is correct and then click the Launch button.
When the instance has launched, it is displayed in the EC2 Instances console.
In the Name column, enter “SQL-standalone”.
Expand the bottom pane to view all the instance’s parameters under the Description tab.
Next use Remote Desktop Connection to connect to this instance.
To do this, right click the instance in the EC2 Instances console and click Connect.
Click the Retrieve Password link, choose the private key file you previously created, and click Decrypt Password.
Copy and save the Public DNS, Username and decrypted password.
Click “Download shortcut file”.
Click the downloaded shortcut file to open a Remote Desktop Connection to the SQL-standalone instance.
On the instance, you have to make some configuration changes.
Start by downloading and installing the IronPythonized CloudFormation tools, using the link in the companion document.
Before doing this, you have to change the default settings in Windows Server to allow Internet Explorer to download the tools.
In Control Panel, click Programs and Features, then Turn Windows features on or off.
In Server Manager under Security Information, click Configure IE ESC.
Under Administrators, click the Off button to turn off Enhanced Security Configuration and allow downloads.
Now download and install the CFN tools.
In the browser, open the URL from the companion document and run the installer.
In the aws-cfn-bootstrap setup wizard, install the tools.
Next, change a setting for the configuration service for Elastic Compute Cloud.
Open the Config.xml file for Ec2ConfigService in a text editor, and manually reset the Ec2HandleUserData flag to Enabled.
Finally, add the path to the tools to the system environment variables.
In Windows Explorer, right-click Computer and click Properties.
Click Advanced System Settings and then Environment Variables.
Under System Variables - NOT User Variables – select the Path environment variable and click Edit.
Add the full path to the tools folder to the end of the string of the Path environment variable.
To package these configuration changes, run the EC2ConfigService Settings application from the Start menu.
When EC2ConfigService Settings opens, click the Image tab and then click the “Shutdown with Sysprep” button to package the changes.
When Sysprep is finished and the instance has shut down, create a new Amazon Machine Image from it.
In the EC2 management console, right-click the instance and click “Create Image (EBS AMI)”.
Name the new AMI “SQL” and click the Yes Create button.
Record the ID of this new AMI displayed in the EC2 management console to use in the following steps.
You have now created a custom SQL Server AMI that can be used to launch a database server stack with CloudFormation.
The next step in deploying a SharePoint web site in the Amazon Web Services cloud is the second stage of step 2,
using the SQL Server AMI to launch the database stack.