One of the most common questions that comes up is "How many IP addresses do I need to set aside for the Autonomous Recovery Service" or "How big does the CIDR block need to be for my Recovery Service subnet"?
In this blog post, I will explain how IPs are used by the service, but how many IP address you will need is hard to put an exact number on.
First below is a diagram showing how this works.
Recovery Service Subnet(s)
The first piece to understand is how the Autonomous Recovery Service uses the Subnet(s) that are registered.
First you might be wondering why I have the "(s)" on the end. When you register a recovery service subnet there are two levels.
You register a name for "Recovery Service Subnet" and this is actually a group of subnets. You can register multiple subnets as eligible to be used for a "Recovery Service Subnets".
The screenshot above is what you will see in OCI.
When you register a Recovery Service subnet,
- You give it a name for the "Recovery Service subnet group"
- You identify the VCN that this subnet is registered for. Each VCN will have it's own registered subnet group.
- You add one or more subnet within that VCN that can be used for endpoint IP address.
Any of these registered subnets can be used for Autonomous Recovery Service IP addresses.
Also subnets can be added, and removed within the group.
How many IP addresses for a Database backup?
I am going to start with a single database before I explain what happens when you have multiple databases using the service. In order to support Oracle Database backups, the Autonomous Recovery Service uses endpoint IP addresses that map to a pair of ZDLRAs that store the backups as a service. The pair of ZDLRAs provide an always available service.
For a single database below is what you would see for the endpoints that get created. In my example, you can see that there are 3 IP address per RA in the "Recovery Service Group".
Above, this shows the 6 private endpoint IP addresses that are created for the database backups being sent to two ZDLRAs (RA-018 and RA-020). There are also FQDN names that are created for each each of the endpoints and you can see that the names map to the specific ZDLRAs that are storing the backups
NOTE: There are are also some 4 node ZDLRAs in some regions. In that case there will be 4 endpoint IP address for each ZDLRA in the pair, and a total of 8 IP addresses will be utilized.
How many IP addresses do I need for multiple databases?
This is where the answer is "It depends". The simple example above shows you what happens for a single database. When you add another database it might not end up on the same "Recovery Service group". It is possible the new database backups could end up on another "Recovery Service group" needing additional IP addresses.
There are number of factors that affect how many "Recovery Service groups" are used when backing up multiple databases.
- Number of databases - If you have a large number of databases, this increases the chances that more backup locations will be used to spread out the backups across multiple groups.
- Size of the Database backups - if your backups are very large, the Recovery Service tries to balance larger database backups across more groups.
- Number of groups in the region - Some regions contain more "recovery Service groups" than other regions. If you are backing up in a larger region there is a higher chance that more groups will be utilized to support many databases.
The diagram I started with below shows you what happens with 3 databases that are storing their backups across two different Recovery Service groups.
The first database is sending it's backup to a Recovery Service Group containing two X 2 DB node ZDLRAs and it is utilizing 6 IP addresses.
The second and third databases are using the same Recovery Recovery Group which consists of Two X 3 DB node ZDLRAs and they are using the same 8 IP addresses.
How to interpret this?
The recommendation for Recovery Service Subnets is to create a separate subnet that is a /24 CIDR block which will provide the ability to have 254 private endpoint IP addresses. This will allow for at least 31 different Recovery Service groups.
If you only have a few databases, then this may be too big for what you need, and you may be able to have a smaller CIDR block, or have multiple subnets with smaller CIDR blocks.
The recommendation of /24 CIDR blocks ensures you will not have any issues with enough IP address.
As you decrease the number of available IP addresses you increase the chances that you will not enough IP address to add another database to be backed up to the Autonomous Recovery Service.
What happens if I don't register enough free IPs?
Once a database is added is configured for backups, it will not affect the need for additional free IP addresses. The only time you will have an issue with free IP addresses for the recovery service is when you add a new database to be backed up. If the onboarded process decides that the backups need to reside a new Recovery Service Group of ZDLRAs, and there are not enough free IP address you will receive an error when configuring backups. At that point you can add more subnets to the Recovery Service subnet group registered with the VCN.
Do I have to worry about space since databases are assigned to Recovery Service groups?
No. The recovery service will automatically manage the underlying storage for the database backups and move backups from one group to another group if needed in order ensure there is enough space for backups. Because of this, you may find that the names of the ZDLRAs where the backups reside could change over time. This is one of the reasons why the service dynamically creates the TNSNAMES entry as needed. The FQDN used for backups of a database will change if the database is moved because of space constraints.
Summary
There is no set number of number of IP addresses that need to be registered with the recovery service and freely available to be assigned for backups. It is dependent on the size of your environment, and number of IP addresses utilized could grow as your environment adds more databases to be backed up.
If you have a start with a smaller number of IP addresses, keep an eye on the number of available IP address in subnets registered with the recovery service to ensure you have room to grow.