Modifying an RDS Custom for SQL Server Single-AZ deployment to a Multi-AZ deployment
You can modify an existing RDS Custom for SQL Server DB instance from a Single-AZ deployment to a Multi-AZ deployment. When you modify the DB instance,Amazon RDS performs several actions:
-
Takes a snapshot of the primary DB instance.
-
Creates new volumes for the standby replica from the snapshot. These volumes initialize in the background, and maximum volume performance is achieved after the data is fully initialized.
-
Turns on synchronous block-level replication between the primary and secondary DB instances.
Important
We recommend that you avoid modifying your RDS Custom for SQL Server DB instance from a Single-AZ to a Multi-AZ deployment on a production DB instance during periods of peak activity.
AWS uses a snapshot to create the standby instance to avoid downtime when you convert from Single-AZ to Multi-AZ, but performance might be impacted during and after converting to Multi-AZ. This impact can be significant for workloads that are sensitive to write latency. While this capability allows large volumes to quickly be restored from snapshots, it can cause increase in the latency of I/O operations because of the synchronous replication. This latency can impact your database performance.
Topics
Configuring prerequisites to modify a Single-AZ to a Multi-AZ deployment using CloudFormation
To use a Multi-AZ deployment, you must ensure you've applied the latest CloudFormation template with prerequisites, or manually configure the latest prerequisites. If you've already applied the latest CloudFormation prerequisite template, you can skip these steps.
To configure the RDS Custom for SQL Server Multi-AZ deployment prerequisites using CloudFormation
-
Open the CloudFormation console at https://console.aws.amazon.com/cloudformation
. -
To start the Create Stack wizard, select the existing stack you used to create a Single-AZ deployment and choose Update.
The Update stack page appears.
-
For Prerequisite - Prepare template, choose Replace current template.
-
For Specify template, do the following:
Download the latest AWS CloudFormation template file. Open the context (right-click) menu for the link custom-sqlserver-onboard.zip and choose Save Link As.
-
Save and extract the
custom-sqlserver-onboard.json
file to your computer. -
For Template source, choose Upload a template file.
-
For Choose file, navigate to and then choose
custom-sqlserver-onboard.json
.
-
Choose Next.
The Specify stack details page appears.
-
To keep the default options, choose Next.
The Advanced Options page appears.
-
To keep the default options, choose Next.
-
To keep the default options, choose Next.
-
On the Review Changes page, do the following:
-
For Capabilities, select the I acknowledge that AWS CloudFormation might create IAM resources with custom names check box.
-
Choose Submit.
-
-
Verify the update is successful. The status of a successful operation shows
UPDATE_COMPLETE
.
If the update fails, any new configuration specified in the update process
will be rolled back. The existing resource will still be usable. For example, if you
add network ACL rules numbered 18 and 19, but there were existing rules with same
numbers, the update would return the following error: Resource handler
returned message: "The network acl entry identified by 18 already exists.
In this scenario you can modify the existing ACL rules to use a number lower than
18, then retry the update.
Configuring prerequisites to modify a Single-AZ to a Multi-AZ deployment manually
Important
To simplify setup, we recommend that you use the latest AWS CloudFormation template file provided in the network setup instructions. For more information, see Configuring prerequisites to modify a Single-AZ to a Multi-AZ deployment using CloudFormation.
If you choose to configure the prerequisites manually, perform the following tasks.
-
Open the Amazon VPC console at https://console.aws.amazon.com/vpc/
. -
Choose Endpoint. The Create Endpoint page appears.
-
For Service Category, choose AWS services.
-
In Services, search for
SQS
-
In VPC, choose the VPC where your RDS Custom for SQL Server DB instance is deployed.
-
In Subnets, choose the subnets where your RDS Custom for SQL Server DB instance is deployed.
-
In Security Groups, choose the
-vpc-endpoint-sg
group. -
For Policy, choose Custom
-
In your custom policy, replace the
AWS partition
,Region
,accountId
,andIAM-Instance-role
with your own values.{ "Version": "2012-10-17", "Statement": [ { "Condition": { "StringLike": { "aws:ResourceTag/AWSRDSCustom": "custom-sqlserver" } }, "Action": [ "SQS:SendMessage", "SQS:ReceiveMessage", "SQS:DeleteMessage", "SQS:GetQueueUrl" ], "Resource": "arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:do-not-delete-rds-custom-*", "Effect": "Allow", "Principal": { "AWS": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/{IAM-Instance-role}" } } ] }
-
Update the Instance profile with permission to access Amazon SQS. Replace the
AWS partition
,Region
, andaccountId
with your own values.{ "Sid": "SendMessageToSQSQueue", "Effect": "Allow", "Action": [ "SQS:SendMessage", "SQS:ReceiveMessage", "SQS:DeleteMessage", "SQS:GetQueueUrl" ], "Resource": [ { "Fn::Sub": "arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:do-not-delete-rds-custom-*" } ], "Condition": { "StringLike": { "aws:ResourceTag/AWSRDSCustom": "custom-sqlserver" } } } >
-
Update the Amazon RDS security group inbound and outbound rules to allow port 1120.
In Security Groups, choose the
-rds-custom-instance-sg
group.For Inbound Rules, create a Custom TCP rule to allow port
1120
from the source-rds-custom-instance-sg
group.For Outbound Rules, create a Custom TCP rule to allow port
1120
to the destination-rds-custom-instance-sg
group.
-
Add a rule in your private network Access Control List (ACL) that allows TCP ports
0-65535
for the source subnet of the DB instance.Note
When creating an Inbound Rule and Outbound Rule, take note of the highest existing Rule number. The new rules you create must have a Rule number lower than 100 and not match any existing Rule number.
In Network ACLs, choose the
-private-network-acl
group.For Inbound Rules, create an All TCP rule to allow TCP ports
0-65535
with a source fromprivatesubnet1
andprivatesubnet2
.For Outbound Rules, create an All TCP rule to allow TCP ports
0-65535
to destinationprivatesubnet1
andprivatesubnet2
.
Modify using the RDS console, AWS CLI, or RDS API.
After you've completed the prerequisites, you can modify an RDS Custom for SQL Server DB instance from a Single-AZ to Multi-AZ deployment using the RDS console, AWS CLI, or RDS API.
To modify an existing RDS Custom for SQL Server Single-AZ to Multi-AZ deployment
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/
. -
In the Amazon RDS console, choose Databases.
The Databases pane appears.
-
Choose the RDS Custom for SQL Server DB instance that you want to modify.
-
For Actions, choose Convert to Multi-AZ deployment.
-
On the Confirmation page, choose Apply immediately to apply the changes immediately. Choosing this option doesn't cause downtime, but there is a possible performance impact. Alternatively, you can choose to apply the update during the next maintenance window. For more information, see Using the schedule modifications setting.
-
On the Confirmation page, choose Convert to Multi-AZ.
To convert to a Multi-AZ DB instance deployment by using the AWS CLI, call the modify-db-instance
command and set the --multi-az
option. Specify the DB instance identifier and the values for other options that you
want to modify. For information about each option, see Settings for DB instances.
Example
The following code modifies mycustomdbinstance
by including the --multi-az
option. The changes are applied during the next maintenance window
by using --no-apply-immediately
. Use --apply-immediately
to apply the changes immediately. For more information, see
Using the schedule modifications
setting.
For Linux, macOS, or Unix:
aws rds modify-db-instance \ --db-instance-identifier
mycustomdbinstance
\ --multi-az \--no-apply-immediately
For Windows:
aws rds modify-db-instance ^ --db-instance-identifier
mycustomdbinstance
^ --multi-az \ ^--no-apply-immediately
To convert to a Multi-AZ DB instance deployment with the RDS API,
call the ModifyDBInstance operation
and set the MultiAZ
parameter to true.