Skip to content

Commit 0fe0b03

Browse files
author
AbhishekMallick-MS
committed
Freshness - Lunix VM app consistent backup
1 parent dad720d commit 0fe0b03

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

articles/backup/backup-azure-linux-app-consistent.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
---
2-
title: Application-consistent backups of Linux VMs
2+
title: Application-consistent backups of Linux VMs using Azure Backup
33
description: Create application-consistent backups of your Linux virtual machines to Azure. This article explains configuring the script framework to back up Azure-deployed Linux VMs. This article also includes troubleshooting information.
4-
ms.topic: conceptual
5-
ms.custom: linux-related-content
6-
ms.date: 01/12/2018
4+
ms.service: backup
5+
ms.topic: how-to
6+
ms.custom: linux-related-content, engagement-fy24
7+
ms.date: 04/23/2024
78
author: AbhishekMallick-MS
89
ms.author: v-abhmallick
910
---
1011

11-
# Application-consistent backup of Azure Linux VMs
12+
# Application-consistent backup of Azure Linux VMs using Azure Backup
1213

13-
When taking backup snapshots of your VMs, application consistency means your applications start when the VMs boot after being restored. As you can imagine, application consistency is extremely important. To ensure your Linux VMs are application consistent, you can use the Linux pre-script and post-script framework to take application-consistent backups. The pre-script and post-script framework supports Azure Resource Manager-deployed Linux virtual machines. Scripts for application consistency don't support Service Manager-deployed virtual machines or Windows virtual machines.
14+
This article describes how to create application-consistent backups of your Linux Virtual Machines to Azure by using Azure Backup. In this article, you'll configure the script framework to back up Azure-deployed Linux VMs. This article also provides the troubleshooting information.
15+
16+
When you take backup snapshots of VMs, application consistency means your applications start when the VMs boot after being restored. As you can imagine, application consistency is extremely important. To ensure your Linux VMs are application consistent, you can use the Linux prescript and post-script framework to take application-consistent backups. The prescript and post-script framework supports Azure Resource Manager-deployed Linux virtual machines. Scripts for application consistency don't support Service Manager-deployed virtual machines or Windows virtual machines.
1417

1518
## How the framework works
1619

17-
The framework provides an option to run custom pre-scripts and post-scripts while you're taking VM snapshots. Pre-scripts run just before you take the VM snapshot, and post-scripts run immediately after you take the VM snapshot. Pre-scripts and post-scripts provide the flexibility to control your application and environment, while you're taking VM snapshots.
20+
The framework provides an option to run custom prescripts and post-scripts while you're taking VM snapshots. Prescripts run just before you take the VM snapshot, and post-scripts run immediately after you take the VM snapshot. Prescripts and post-scripts provide the flexibility to control your application and environment, while you're taking VM snapshots.
21+
22+
Prescripts invoke native application APIs, which quiesce the IOs, and flush in-memory content to the disk. These actions ensure the snapshot is application consistent. Post-scripts use native application APIs to thaw the IOs, which enable the application to resume normal operations after the VM snapshot.
1823

19-
Pre-scripts invoke native application APIs, which quiesce the IOs, and flush in-memory content to the disk. These actions ensure the snapshot is application consistent. Post-scripts use native application APIs to thaw the IOs, which enable the application to resume normal operations after the VM snapshot.
24+
## Configure prescript and post-script for Azure Linux VM
2025

21-
## Steps to configure pre-script and post-script
26+
To configure Prescript and post-script, follow these steps:
2227

2328
1. Sign in as the root user to the Linux VM that you want to back up.
2429

2530
2. From [GitHub](https://github.com/MicrosoftAzureBackup/VMSnapshotPluginConfig), download **VMSnapshotScriptPluginConfig.json** and copy it to the **/etc/azure** folder for all VMs you want to back up. If the **/etc/azure** folder doesn't exist, create it.
2631

27-
3. Copy the pre-script and post-script for your application on all VMs you plan to back up. You can copy the scripts to any location on the VM. Be sure to update the full path of the script files in the **VMSnapshotScriptPluginConfig.json** file.
32+
3. Copy the prescript and post-script for your application on all VMs you plan to back up. You can copy the scripts to any location on the VM. Be sure to update the full path of the script files in the **VMSnapshotScriptPluginConfig.json** file.
2833

2934
4. Ensure the following permissions for these files:
3035

@@ -42,21 +47,21 @@ Pre-scripts invoke native application APIs, which quiesce the IOs, and flush in-
4247
5. Configure **VMSnapshotScriptPluginConfig.json** as described here:
4348
- **pluginName**: Leave this field as is, or your scripts might not work as expected.
4449

45-
- **preScriptLocation**: Provide the full path of the pre-script on the VM that's going to be backed up.
50+
- **preScriptLocation**: Provide the full path of the prescript on the VM that's going to be backed up.
4651

4752
- **postScriptLocation**: Provide the full path of the post-script on the VM that's going to be backed up.
4853

49-
- **preScriptParams**: Provide the optional parameters that need to be passed to the pre-script. All parameters should be in quotes. If you use multiple parameters, separate the parameters with a comma.
54+
- **preScriptParams**: Provide the optional parameters that need to be passed to the prescript. All parameters should be in quotes. If you use multiple parameters, separate the parameters with a comma.
5055

5156
- **postScriptParams**: Provide the optional parameters that need to be passed to the post-script. All parameters should be in quotes. If you use multiple parameters, separate the parameters with a comma.
5257

53-
- **preScriptNoOfRetries**: Set the number of times the pre-script should be retried if there's any error before terminating. Zero means only one try and no retry if there's a failure.
58+
- **preScriptNoOfRetries**: Set the number of times the prescript should be retried if there's any error before terminating. Zero means only one try and no retry if there's a failure.
5459

5560
- **postScriptNoOfRetries**: Set the number of times the post-script should be retried if there's any error before terminating. Zero means only one try and no retry if there's a failure.
5661

57-
- **timeoutInSeconds**: Specify individual timeouts for the pre-script and the post-script (maximum value can be 1800).
62+
- **timeoutInSeconds**: Specify individual timeouts for the prescript and the post-script (maximum value can be 1800).
5863

59-
- **continueBackupOnFailure**: Set this value to **true** if you want Azure Backup to fall back to a file system consistent/crash consistent backup if pre-script or post-script fails. Setting this to **false** fails the backup if there's a script failure (except when you have a single-disk VM that falls back to crash-consistent backup regardless of this setting). When the **continueBackupOnFailure** value is set to false, if the backup fails the backup operation will be attempted again based on a retry logic in service (for the stipulated number of attempts).
64+
- **continueBackupOnFailure**: Set this value to **true** if you want Azure Backup to fall back to a file system consistent/crash consistent backup if prescript or post-script fails. Setting this to **false** fails the backup if there's a script failure (except when you have a single-disk VM that falls back to crash-consistent backup regardless of this setting). When the **continueBackupOnFailure** value is set to false, if the backup fails the backup operation will be attempted again based on a retry logic in service (for the stipulated number of attempts).
6065

6166
- **fsFreezeEnabled**: Specify whether Linux fsfreeze should be called while you're taking the VM snapshot to ensure file system consistency. We recommend keeping this setting set to **true** unless your application has a dependency on disabling fsfreeze.
6267

@@ -66,20 +71,20 @@ Pre-scripts invoke native application APIs, which quiesce the IOs, and flush in-
6671

6772
## Troubleshooting
6873

69-
Make sure you add appropriate logging while writing your pre-script and post-script, and review your script logs to fix any script issues. If you still have problems running scripts, refer to the following table for more information.
74+
Make sure you add appropriate logging while writing your prescript and post-script, and review your script logs to fix any script issues. If you still have problems running scripts, refer to the following table for more information.
7075

7176
| Error | Error message | Recommended action |
7277
| ------------------------ | -------------- | ------------------ |
73-
| Pre-ScriptExecutionFailed |The pre-script returned an error, so backup might not be application-consistent.| Look at the failure logs for your script to fix the issue.|
78+
| Pre-ScriptExecutionFailed |The prescript returned an error, so backup might not be application-consistent.| Look at the failure logs for your script to fix the issue.|
7479
|Post-ScriptExecutionFailed |The post-script returned an error that might impact application state. |Look at the failure logs for your script to fix the issue and check the application state. |
75-
| Pre-ScriptNotFound |The pre-script was not found at the location that's specified in the **VMSnapshotScriptPluginConfig.json** config file. |Make sure that pre-script is present at the path that's specified in the config file to ensure application-consistent backup.|
80+
| Pre-ScriptNotFound |The prescript wasn't found at the location that's specified in the **VMSnapshotScriptPluginConfig.json** config file. |Make sure that prescript is present at the path that's specified in the config file to ensure application-consistent backup.|
7681
| Post-ScriptNotFound |The post-script wasn't found at the location that's specified in the **VMSnapshotScriptPluginConfig.json** config file. |Make sure that post-script is present at the path that's specified in the config file to ensure application-consistent backup.|
77-
| IncorrectPluginhostFile |The **Pluginhost** file, which comes with the VmSnapshotLinux extension, is corrupted, so pre-script and post-script cannot run and the backup won't be application-consistent.| Uninstall the **VmSnapshotLinux** extension, and it will automatically be reinstalled with the next backup to fix the problem. |
78-
| IncorrectJSONConfigFile | The **VMSnapshotScriptPluginConfig.json** file is incorrect, so pre-script and post-script cannot run and the backup won't be application-consistent. | Download the copy from [GitHub](https://github.com/MicrosoftAzureBackup/VMSnapshotPluginConfig) and configure it again. |
82+
| IncorrectPluginhostFile |The **Pluginhost** file, which comes with the VmSnapshotLinux extension, is corrupted, so prescript and post-script can't run and the backup won't be application-consistent.| Uninstall the **VmSnapshotLinux** extension, and it will automatically be reinstalled with the next backup to fix the problem. |
83+
| IncorrectJSONConfigFile | The **VMSnapshotScriptPluginConfig.json** file is incorrect, so prescript and post-script can't run and the backup won't be application-consistent. | Download the copy from [GitHub](https://github.com/MicrosoftAzureBackup/VMSnapshotPluginConfig) and configure it again. |
7984
| InsufficientPermissionforPre-Script | For running scripts, "root" user should be the owner of the file and the file should have “700” permissions (that is, only "owner" should have “read”, “write”, and “execute” permissions). | Make sure “root” user is the “owner” of the script file and that only "owner" has “read”, “write” and “execute” permissions. |
8085
| InsufficientPermissionforPost-Script | For running scripts, root user should be the owner of the file and the file should have “700” permissions (that is, only "owner" should have “read”, “write”, and “execute” permissions). | Make sure “root” user is the “owner” of the script file and that only "owner" has “read”, “write” and “execute” permissions. |
8186
| Pre-ScriptTimeout | The execution of the application-consistent backup pre-script timed-out. | Check the script and increase the timeout in the **VMSnapshotScriptPluginConfig.json** file that's located at **/etc/azure**. |
82-
| Post-ScriptTimeout | The execution of the application-consistent backup post-script timed out. | Check the script and increase the timeout in the **VMSnapshotScriptPluginConfig.json** file that's located at **/etc/azure**. |
87+
| Post-ScriptTimeout | The execution of the application-consistent backup post-scripts timed out. | Check the script and increase the timeout in the **VMSnapshotScriptPluginConfig.json** file that's located at **/etc/azure**. |
8388

8489
## Next steps
8590

0 commit comments

Comments
 (0)