CloudFormation takes 8 hours to complete


I used CloudFormation to restore a RDS snapshot to a new instance, and it took 8 hours to complete!!

Screen Shot 2016-11-21 at 11.36.58 AM.png

The original instance (where the snapshot was taken) disk size is 45G, and the new instance is 50G which I specified in the CloudFormation template. According to AWS, that is the reason why it took so long to complete. So the best practice is not to resize the DB size when restoring the snapshot. Re-run the restoration without resize the disk took only 20 minutes to finish.

If time is an issue, then creating a new empty DB instance, then use mysqldump should be a better option. Also I have submitted a feature request to make EBS resizable like how we used to increase virtual disk.

Quote from AWS support:

"When a DB instance is created from a snapshot, the initial db instance that is created has the same storage size/type as the snapshot. This process is fairly quick, but once the instance is stabilized, the storage is scaled out to your desired size, which takes some time to copy all of your data to another set of disks. After the scaling is complete, the database is configured as multi-az, which will launch another instance and go through the same steps to scale out the storage again."
        "Engine": "mysql",
        "EngineVersion": "5.6.21",
        "DBInstanceClass": "db.m1.medium",
        "DBSnapshotIdentifier": "arn:aws:rds:ap-southeast-2:1234567890:snapshot:rds:mydb01-2016-11-17-14-04",
        "MultiAZ": "true",
        "AllocatedStorage": "50",
        "DBInstanceIdentifier": "mydb02",
        "Port": "3306",
        "MasterUsername": "root",
        "MasterUserPassword": "**********",
        "VPCSecurityGroups": [{"Fn::ImportValue": "RDSProdId"}],
        "DBSubnetGroupName": {"Ref": "DBSubnetGroup"},
        "PubliclyAccessible": "false",
        "BackupRetentionPeriod": "3",
        "AutoMinorVersionUpgrade": "false",
        "StorageType": "gp2",
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

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 )

Connecting to %s