amazon-web-servicesamazon-ec2amazon-rds

RDS instance start: which subnet/AZ is selected?


Let's say I have an RDS instance (single AZ, not Aurora) in the stopped state. The RDS subnet group of my instance has 3 different subnets (one in each AZ).

If I start the RDS instance:

Regarding instance capacity:


Solution

  • Here are the responses for your queries about RDS instance subnet selection and capacity management:

    1. Subnet Selection When Starting:

      • When you start a stopped RDS instance, AWS RDS will attempt to start the instance in the same subnet where it was previously running
      • This behavior is by design to maintain consistency in networking configuration
    2. Specifying a Subnet:

      • For single-AZ RDS instances, you cannot explicitly specify which subnet to use when starting the instance
      • The subnet selection is managed by AWS RDS service
      • If you need to run your RDS instance in a specific AZ/subnet, you would need to create a new instance with that specific configuration
    3. Instance Capacity Issues:

      • If there's insufficient capacity in the subnet/AZ where RDS tries to start the instance, you'll receive an "InsufficientDBInstanceCapacity" error
      • RDS does not automatically retry in other AZs
      • The operation will simply fail with an error message
    4. Best Practices for Handling Capacity Issues (If you encounter capacity issues, you can try these approaches):

      • Manually stop and start the instance again (it might work if capacity becomes available)
      • Create a new RDS instance in a different AZ where capacity is available
      • Consider using a different instance type that might have better availability
      • If this is a recurring issue, consider using Reserved Instances to ensure capacity
      • For critical workloads, consider using Multi-AZ deployment which provides better availability guarantees

    Remember that using Multi-AZ deployment, while more expensive, provides better reliability and availability, including automatic failover to other AZs in case of capacity issues or other problems.