You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-netapp-files/azacsnap-tips.md
+37-31Lines changed: 37 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: azure-netapp-files
5
5
author: Phil-Jensen
6
6
ms.service: azure-netapp-files
7
7
ms.topic: how-to
8
-
ms.date: 04/17/2024
8
+
ms.date: 08/04/2025
9
9
ms.author: phjensen
10
10
# Customer intent: As a DevOps engineer managing database backups, I want to configure and monitor the Azure Application Consistent Snapshot tool for Azure NetApp Files, so that I can automate and ensure the reliability of regular snapshot backups for my SAP HANA databases.
11
11
---
@@ -16,21 +16,27 @@ This article provides tips and tricks that might be helpful when you use AzAcSna
16
16
17
17
## Global override settings to control azacsnap behavior
18
18
19
-
AzAcSnap 8 introduced a new global settings file (`.azacsnaprc`) which must be located in the same (current working) directory as azacsnap is executed in. The filename is `.azacsnaprc` and by using the dot '.' character as the start of the filename makes it hidden to standard directory listings. The file allows global settings controlling the behavior of AzAcSnap to be set. The format is one entry per line with a supported customizing variable and a new overriding value.
19
+
AzAcSnap 8 introduced a new global settings file (`.azacsnaprc`) which must be located in the same (current working) directory as azacsnap is executed in. The filename is `.azacsnaprc` and by using the dot '.' character as the start of the filename makes it hidden to standard directory listings. The file allows global settings controlling the behavior of AzAcSnap to be set. The format is one entry per line with a supported customizing variable and a new overriding value.
20
20
21
21
Settings, which can be controlled by adding/editing the global override settings file or by setting them as environment variables are:
22
22
23
-
-**MAINLOG_LOCATION** which customizes the location of the "main-log" output file, which is called `azacsnap.log` and was introduced in AzAcSnap 8. Values should be absolute paths and the default value = '.' (which is the current working directory). For example, to ensure the "main-log" output file goes to the `/home/azacsnap/bin/logs` add the following to the `.azacsnaprc` file:
24
-
-`MAINLOG_LOCATION=/home/azacsnap/bin/logs`
25
-
-**AZURE_MANAGEMENT_ENDPOINT** to customize the location of the Azure Management Endpoint which AzAcSnap will make Azure REST API calls to was introduced in AzAcSnap 9a. Values should be URL paths and the default value = 'https://management.azure.com'. For example, to configure AzAcSnap to ensure all management calls go to the Azure Management Endpoint for US Govt Cloud (ref: [Azure Government Guidance for developers](/azure/azure-government/compare-azure-government-global-azure#guidance-for-developers)) add the following to the `.azacsnaprc` file:
23
+
-**AZURE_MANAGEMENT_ENDPOINT** to customize the location of the Azure Management Endpoint which AzAcSnap make Azure REST API calls to was introduced in AzAcSnap 9a. Values should be URL paths and the default value = 'https://management.azure.com'. For example, to configure AzAcSnap to ensure all management calls go to the Azure Management Endpoint for US Government Cloud (ref: [Azure Government Guidance for developers](/azure/azure-government/compare-azure-government-global-azure#guidance-for-developers)) add the following to the `.azacsnaprc` file:
-**EXTERNAL_CMD_TIMEOUT_SECS** customizes the timeout for external shell commands. Values should be integers and the default value = 300. For example, to set the external command timeout to 10 minutes (600 seconds) add the following to the `.azacsnaprc` file:
26
+
-`EXTERNAL_CMD_TIMEOUT_SECS=600`
27
+
28
+
> [!NOTE]
29
+
> As of AzAcSnap 11, the `EXTERNAL_CMD_TIMEOUT_SECS` only applies to Db2 database commands.
30
+
31
+
-**MAINLOG_LOCATION** which customizes the location of the "main-log" output file, which is called `azacsnap.log` and was introduced in AzAcSnap 8. Values should be absolute paths and the default value = '.' (which is the current working directory). For example, to ensure the "main-log" output file goes to the `/home/azacsnap/bin/logs` add the following to the `.azacsnaprc` file:
32
+
-`MAINLOG_LOCATION=/home/azacsnap/bin/logs`
27
33
28
34
> [!NOTE]
29
-
> As of AzAcSnap 9a all these values can be set as command-line environment variables as well, or instead of, the `.azacsnaprc` file. For example, on Linux the `AZURE_MANAGEMENT_ENDPOINT` can be set with `export AZURE_MANAGEMENT_ENDPOINT=https://management.usgovcloudapi.net` before running AzAcSnap.
35
+
> As of AzAcSnap 9a all these values can be set as command-line environment variables as well, or instead of, the `.azacsnaprc` file. For example, on Linux the `AZURE_MANAGEMENT_ENDPOINT` can be set with `export AZURE_MANAGEMENT_ENDPOINT=https://management.usgovcloudapi.net` before running AzAcSnap.
30
36
31
37
## Main-log parsing
32
38
33
-
AzAcSnap 8 introduced a new "main-log" to provide simpler parsing of runs of AzAcSnap. The inspiration for this file is the SAP HANA backup catalog, which shows when AzAcSnap was started, how long it took, and what the snapshot name is. With AzAcSnap, this idea has been taken further to include information for each of the AzAcSnap commands, specifically the `-c` options, and the file has the following headers:
39
+
AzAcSnap 8 introduced a new "main-log" to provide simpler parsing of runs of AzAcSnap. The inspiration for this file is the SAP HANA backup catalog, which shows when AzAcSnap was started, how long it took, and what the snapshot name is. With AzAcSnap, this idea is taken further to include information for each of the AzAcSnap commands, specifically the `-c` options, and the file has the following headers:
This format makes the file parse-able with the Linux commands `watch`, `grep`, `head`, `tail`, and `column` to get continuous updates of AzAcSnap backups. An example combination of these commands in single shell script to monitor AzAcSnap is as follows:
56
+
This format makes the file parse-able with the Linux commands `watch`, `grep`, `head`, `tail`, and `column` to get continuous updates of AzAcSnap backups. An example combination of these commands in single shell script to monitor AzAcSnap is as follows:
51
57
52
58
```bash
53
59
#!/bin/bash
@@ -132,9 +138,9 @@ DATE_TIME OPERATION_NAME STATUS DATABASE_TYPE SID DUR
132
138
133
139
## Limit service principal permissions
134
140
135
-
It may be necessary to limit the scope of the AzAcSnap service principal. Review the [Azure RBAC documentation](../role-based-access-control/index.yml) for more details on fine-grained access management of Azure resources.
141
+
It may be necessary to limit the scope of the AzAcSnap service principal. Review the [Azure Role Based Access Control documentation](../role-based-access-control/index.yml) for more details on fine-grained access management of Azure resources.
136
142
137
-
The following is an example role definition with the minimum required actions needed for AzAcSnap to function.
143
+
The following Azure CLI example provides a role definition with the minimum required actions needed for AzAcSnap to function.
138
144
139
145
```azurecli
140
146
az role definition create --role-definition '{ \
@@ -153,7 +159,7 @@ az role definition create --role-definition '{ \
153
159
}'
154
160
```
155
161
156
-
For restore options to work successfully, the AzAcSnap service principal also needs to be able to create volumes. In this case, the role definition needs an extra "Actions" clause added, therefore the complete service principal should look like the following example.
162
+
For restore options to work successfully, the AzAcSnap service principal also needs to be able to create volumes. In this case, the role definition needs an extra "Actions" clause added, therefore the complete service principal should look like the following example.
157
163
158
164
```azurecli
159
165
az role definition create --role-definition '{ \
@@ -176,7 +182,7 @@ az role definition create --role-definition '{ \
176
182
177
183
## Take snapshots manually
178
184
179
-
Before executing any backup commands (`azacsnap -c backup`), check the configuration by running the test commands and verify they get executed successfully. Correct execution of these tests proved `azacsnap` can communicate with the installed SAP HANA database and the underlying storage system of the SAP HANA on **Azure Large Instance** or **Azure NetApp Files** system.
185
+
Before executing any backup commands (`azacsnap -c backup`), check the configuration by running the test commands and verify they get executed successfully. Correct execution of these tests proved `azacsnap` can communicate with the installed SAP HANA database and the underlying storage system of the SAP HANA on **Azure Large Instance** or **Azure NetApp Files** system.
180
186
181
187
-`azacsnap -c test --test hana`
182
188
-`azacsnap -c test --test storage`
@@ -205,15 +211,15 @@ MAILTO=""
205
211
@daily (. /home/azacsnap/.profile ; cd /home/azacsnap/bin ; azacsnap -c backup --volume other --prefix DailyBootVol --retention=7 --configfile boot-vol.json)
206
212
```
207
213
208
-
Explanation of the above crontab.
214
+
Explanation of the example crontab output.
209
215
210
-
-`MAILTO=""`: by having an empty value this prevents cron from automatically trying to email the local Linux user when executing the crontab entry.
216
+
-`MAILTO=""`: by having an empty value for MAILTO cron will not try to email the local Linux user when executing the crontab entry.
211
217
- Shorthand versions of timing for crontab entries are self-explanatory:
212
218
-`@monthly` = Run once a month, that is, "0 0 1 * *".
213
219
-`@weekly` = Run once a week, that is, "0 0 * * 0".
214
220
-`@daily` = Run once a day, that is, "0 0 * * *".
215
221
-`@hourly` = Run once an hour, that is, "0 * * * *".
216
-
- The first five columns are used to designate times, refer to the following column examples:
222
+
- The first five columns are used to designate times. Refer to the following column examples:
217
223
-`0,15,30,45`: Every 15 minutes
218
224
-`0-23`: Every hour
219
225
-`*` : Every day
@@ -236,7 +242,7 @@ generated successfully.
236
242
237
243
AzAcSnap writes output of its operation to log files to assist with debugging and to validate correct operation. These log files continue to grow unless actively managed. Fortunately UNIX based systems have a tool to manage and archive log files called logrotate.
238
244
239
-
The following output provides an example configuration for logrotate. This configuration keeps a maximum of 31 logs (approximately one month), and when the log files are larger than 10k it rotates them by renaming with a number added to the filename and compresses them.
245
+
The following output provides an example configuration for logrotate. This configuration keeps a maximum of 31 logs, approximately one month. When the log files are larger than 10k it rotates them by renaming with a number added to the filename and compresses them.
240
246
241
247
```output
242
248
# azacsnap logrotate configuration file
@@ -248,7 +254,7 @@ compress
248
254
}
249
255
```
250
256
251
-
After the `logrotate.conf` file has been created, the `logrotate` command should be run regularly to archive AzAcSnap log files accordingly. Automating the `logrotate` command can be done using cron. The following output is one line of the azacsnap user's crontab, this example runs logrotate daily using the configuration file `~/logrotate.conf`.
257
+
After the `logrotate.conf` file is created, the `logrotate` command should be run regularly to archive AzAcSnap log files accordingly. Automating the `logrotate` command can be done using cron. The following output is one line of the azacsnap user's crontab, this example runs logrotate daily using the configuration file `~/logrotate.conf`.
@@ -286,7 +292,7 @@ The following conditions should be monitored to ensure a healthy system:
286
292
1. Consistency of the snapshots by restoring them to another system periodically.
287
293
288
294
> [!NOTE]
289
-
> To list snapshot details, execute the command `azacsnap -c details`.
295
+
> To list snapshot details, execute the command `azacsnap -c details`.
290
296
291
297
## Delete a snapshot
292
298
@@ -297,7 +303,7 @@ To delete a snapshot, use the command `azacsnap -c delete`. It's not possible to
297
303
298
304
## Restore a snapshot
299
305
300
-
A storage volume snapshot can be restored to a new volume (`-c restore --restore snaptovol`). For Azure Large Instance, the volume can be reverted to a snapshot (`-c restore --restore revertvolume`).
306
+
A storage volume snapshot can be restored to a new volume (`-c restore --restore snaptovol`). For Azure Large Instance, the volume can be reverted to a snapshot (`-c restore --restore revertvolume`).
301
307
302
308
> [!NOTE]
303
309
> There is **NO** database recovery command provided.
@@ -307,16 +313,16 @@ copy is made (`cp /hana/data/H80/mnt00001/.snapshot/hana_hourly.2020-06-17T11304
307
313
308
314
For Azure Large Instance, you could contact the Microsoft operations team by opening a service request to restore a desired snapshot from the existing available snapshots. You can open a service request via the [Azure portal](https://portal.azure.com).
309
315
310
-
If you decide to perform the disaster recovery failover, the `azacsnap -c restore --restore revertvolume` command at the DR site automatically makes available the most recent (`/hana/data` and `/hana/logbackups`) volume snapshots to allow for an SAP HANA recovery. Use this command with caution as it breaks replication between production and DR sites.
316
+
If you decide to perform the disaster recovery failover, the `azacsnap -c restore --restore revertvolume` command at the Disaster Recovery (DR) site automatically makes available the most recent (`/hana/data` and `/hana/logbackups`) volume snapshots to allow for an SAP HANA recovery. Use this command with caution as it breaks replication between production and DR sites.
311
317
312
318
## Set up snapshots for 'boot' volumes only
313
319
314
320
> [!IMPORTANT]
315
321
> This operation applies only to Azure Large Instance.
316
322
317
-
In some cases, customers already have tools to protect SAP HANA and only want to configure 'boot' volume snapshots. In this case, only the following steps need to be completed.
323
+
In some cases, customers already have tools to protect SAP HANA and only want to configure 'boot' volume snapshots. In this case, only the following steps need to be completed.
318
324
319
-
1. Complete steps 1-4 of the pre-requisites for installation.
325
+
1. Complete steps 1-4 of the prerequisites for installation.
320
326
1. Enable communication with storage.
321
327
1. Download and run the installer to install the snapshot tools.
322
328
1. Complete setup of snapshot tools.
@@ -334,7 +340,7 @@ In some cases, customers already have tools to protect SAP HANA and only want to
334
340
3 entries were displayed.
335
341
```
336
342
> [!NOTE]
337
-
> In this example, this host is part of a 3 node Scale-Out system and all 3 boot volumes can be seen from this host. This means all 3 boot volumes can be snapshot from this host, and all 3 should be added to the configuration file in the next step.
343
+
> In this example, this host is part of a three node Scale-Out system and all 3 boot volumes can be seen from this host. This setup means all three boot volumes can be snapshot from this host, and all three should be added to the configuration file in the next step.
338
344
339
345
1. Create a new configuration file as follows. The boot volume details must be in the OtherVolume stanza:
340
346
```bash
@@ -370,7 +376,7 @@ In some cases, customers already have tools to protect SAP HANA and only want to
370
376
371
377
Editing configuration complete, writing output to 'BootVolume.json'.
372
378
```
373
-
1. Check the config file, refer to the following example:
379
+
1. Check the config file. Refer to the following example:
374
380
375
381
Use `cat` command to display the contents of the configuration file:
376
382
@@ -429,7 +435,7 @@ In some cases, customers already have tools to protect SAP HANA and only want to
1. Check it's listed, note the addition of the `--snapshotfilter` option to limit the snapshot list returned.
438
+
1. Check the snapshot has been created by listing the snapshots using the `-c details` option. Note the addition of the `--snapshotfilter` option to limit the snapshot list returned.
0 commit comments