Technology Blog Posts by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
SilviaPedroso
Product and Topic Expert
Product and Topic Expert
580

Redis on SAP BTP instances can be shared between different environments and different accounts to enable reuse of instances. This feature provides the functionality of sharing a service instance between different sub-accounts.

Please consider:

  • You can only share service instances of the service plan ’standard’ or ’premium’. The sharing functionality only works between sub-accounts inside the same BTP region, the sharing works also between different global accounts, but the sub-accounts need to be in same region (e.g. EU10).
  • A reference service instance can be used like any "standard", "premium” instance, to be able to create it you need to use ‘reference’ service plan as entitlements.
  • You can bind or unbind it, create service keys etc., however, to modify database settings or configurations, you still need to use the source instance.

In order to create a Redis instance using a BTP Cockpit or CF CLI commands access the SAP Help Portal service documentation.

Update an active instance as ‘shareable’ using BTP Cockpit

A Redis instance can be shared between different accounts on the same landscape. As a  first step to use shared instances you need to setup the source instance with the list of sub-accounts that you allow to share the instances. Thus, you need to have at least one target sub-account available to add to the instance shares list.

Configure your instance as ‘shareable’

Pre-requisites:

  • To be able to share an instance you need to add the list of sub-accounts who want to consume it.
  • An instance can only be shared via an update process and not during the creation.

Go to the source sub-account where you have the instance and update the parameter "instance_shares" with the list of sub-accounts where you want to create the new instances using reference service plan.

{
    "instance_shares":{
    "op": "add",
    "values": [<”suba-account1”>]
    }
    }

The list of subaccounts is additive, so you do not need to always provide the complete list of subaccounts here. You can use the operations “op”:

  • “add”add sub-account
  • “deletedelete sub-account

In the update command parameters, you need to provide the list of subs-accounts, see below our JSON example:

{
    "instance_shares":{
    "op": "add",
    "values": [”1b73a8a4-357b-xxxx-8a37-1c245b83c443"]
    }
    }

In the source sub-account, go to your instance and select "update" option:

SilviaPedroso_0-1726655491905.png

Add the JSON to parameters sections and select "update instance"Note: the update operation can only include this parameter.

Create a new ‘virtual’ instance referencing a source instance using BTP Cockpit.

To be able to create an instance using a shared reference instance, you need to have the proper entitlements in your target sub-account. 

1 - Confirm your entitlements (‘reference’ service plan) > When creating the new instance, you need to select the reference service plan thus ensure you have added this as an entitlement. 

SilviaPedroso_2-1726657330569.png

2 - Create a new instance using ‘reference’ service plan > After selecting the “reference” service plan, you need to fill the rest of the inputs as you would with a normal instance creation.

SilviaPedroso_3-1726657360389.png

3 - Add your source instance in the parameters > Select “next” as you will need to add the source instance id.

4 - Check the source instance id that you want to use as reference in the source sub-account.SilviaPedroso_0-1726654533118.png

5 - Add the instance id to the parameter “source_instance_id”SilviaPedroso_1-1726654640349.png

6After adding the "source_instance_id", you can select "create". Once created, you can check the new instance details and you will be able to see that was created using the "reference" service plan.SilviaPedroso_2-1726654704695.png

Optionally you may use the "Labels" feature to add some information for your future reference.

The 'source_instance_id’ parameter is visible in the instance parameters via BTP Cockpit or you can retrieve it via be below Cloud Foundry command line (CLI):

cf service <instance name> --params

 

Use Cloud Foundry CLI commands to create ‘virtual’ instances using a“shared” instance as a reference.

1 - Share a service instance

To share a service instance to a subaccount you can share the source instance using the below CF CLI command:

cf update-service ${source-instance-name} -c '{"instance_shares":{"op": "add", "values": ["<subaccount1>"]}}' 

If the reference service instance has been deleted, you can also unshare the previously shared instance from the subaccount:

cf update-service ${source-instance-name} -c '{"instance_shares":{"op": "delete", "values": ["<subaccount2>"]}}'


2
- Create a new ‘virtual’ service instance

To create a reference instance for the Redis instance with the instance ID <source-instance-id>, please leverage the following CF CLI command:

cf create-service redis-cache reference reference-example -c '{"source_instance_id": "<source-instance-id>"}'

'reference’ is the service plan | ‘reference-example’ is the name of the new virtual instance to be created.

If you want to learn more about the service check also:

For more information on the Redis service please access the official Redis Help Portal service documentation

Thank you for reading!

SAP BTP Backing Services – Product Management