
The cloning template essentially serves as a database backup, encompassing the schema and data of the clone while excluding its configuration details, such as the options chosen during provisioning. It's important to note that restoring a backup from a more recent SAP HANA version into an older version is not supported and results in an error.
Cloning templates are stored in a template container within HANA Data Lake Files, specifically in the Files service of the data lake. To create a cloning template, and to create an instance based on a template, your subaccount must therefore have a data lake Files service; note, however, only data lake Files is required — without the additional option of the data lake relational engine.
Note :
Read more on the Blog by Jason Hinsperger
Download OpenSSL
HANA Data Lake Files oversees user security and access by utilizing certificates; thus, it is necessary to generate signed certificates for configuring user access. In the absence of access to a signing authority, you have the option to establish a Certificate Authority (CA) and generate a signed client certificate. Subsequently, you can update the HDL Files configuration following the outlined procedure.
openssl genrsa -out ca.key 2048
openssl req -x509 -new -key ca.key -days 200 -out ca.crt
openssl req -new -nodes -newkey rsa:2048 -out client.csr -keyout client.key
openssl x509 -days 100 -req -in client.csr -CA ca.crt -CAkey ca.key -out client.crt
Note: Make sure the fields are not all exactly the same between the CA and client certs, otherwise it is assumed to be a self-signed cert and the cert validation below will fail.
openssl verify -CAfile ca.crt client.crt
You will need the above generated certificates and keys to configure the HANA Data Lake files.
Go to SAP HANA Cloud Central and choose "Manage Configuration" for the HDL instance.
Click on "Data Lake Files"
Click on "Add" under Trusts configuration and hit on "Upload" file button and browse to the location where your ca. crt is located and upload that file and click on apply. The alias can be anything, but the certificate should be exactly what is in the generated ca.crt.
Click on "Add" under Authorizations and select the roles as "Admin" or "User" and then click on "Generate pattern" from the output of the following command. (exclude the "subject=" prefix)
openssl x509 -in client.crt -nameopt RFC2253 -subject -noout
Alternatively, you can use the "Generate Pattern" option and similarly upload the client. crt file after clicking on the "Upload" file option. It will automatically generate a pattern like above.
Click on "Review and Save".
Click "Save Changes" on the modal to confirm changes.
In this step we will verify the configurations that was done in the previous steps by running the below command. The < Instance ID> and < REST API Endpoint > can be copied by clicking on the ellipses in SAP HANA Cloud Central.
< PATH> is the path to the corresponding certificate. The following command lists out files in the root folder of the HDL files instance. Thus if the instance has no files, the command will not return anything.
hdlfscli -cert <PATH>\client.crt -key <PATH>\client.key -cacert <PATH>\ca.crt -k -s https://<REST API Endpoint> -filecontainer <Instance ID> ls
Read more on HDLFSCLI
Now that we have all the necessary configurations done, we can go ahead and start with creating a cloning template.
On the All Instances page, select the SAP HANA database instance that you want to clone. Click D (More) Create Template to Clone Instance. This menu option is only visible for instances which do have the additional option of the data lake Relational Engine.
In the Create Template to Clone Instance wizard, choose a name for the template.
Note: Record the name of your template for later use when cloning an instance based on this template.
Enter the string for HDLFS REST Endpoint to be used for Template Storage. The content is validated — it is not necessary to add the hdlfs:// protocol. Upload the client key, client certificate, and CA certificate required to access the data lake Files instance where the template will be stored.
Create an encryption password for the template and click Create Template.
Go to SAP HANA Cloud Central. All Instances > Create Instance.
Choose (Cloned) SAP HANA Cloud, SAP HANA Database.
In the next step, add all the necessary details such as the instance name & description. Set the password for DBADMIN
Proceed through the provisioning wizard until you reach step 6: Cloning template.
Enter the name of the template that you created in the previous step and paste the REST API endpoint. Add the client key, client certificate, CA certificate and encryption password that was entered during creation of the template.
Click on "Review and Create".
You have created a cloning template that is stored in the specified data lake Files instance in your subaccount and have cloned an SAP HANA database instance using that template.
To create HDI service in the newly created HANA Cloud Instance, you can execute the below Cloud foundry command to create the hana service in the CF CLI, where <database_id> is optional if the space consists of only one database.
cf create-service hana <schema|hdi-shared> <service_name> -c "{\"from_instance\": \"<source_service_guid>\", \"database_id\" : \"target_database_id\"}"
As part of a disaster-recovery operation, an existing HDI container can be specified as the deployment target when creating a new service instance. To reuse an existing HDI container, it is necessary to specify that the target HDI container already exists when you create the service instance that applications will then bind to and use for deployment.
cf create-service hana hdi-shared <Service Name> -c '{"reuse_hdi_container": "true", "schema": "<HDI container name>"}'
SAP HELP LINK ( Coming soon )
Please share your valuable feedback 🙂
Helpful Links :
Clone an SAP HANA Database Instance - SAP Help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
22 | |
17 | |
11 | |
9 | |
8 | |
7 | |
7 | |
7 | |
6 |