Performing Backups & Restores (part 1 of 3)

 



To read part 2 please click here
To read part 3 please click here



Backup & Restore of Azure VMs

If you want to backup Azure VM, then Azure Backup can easily install an extension on the VM agent running on the machine. To install the VM agent manually, you have to use the following OS-specific instructions:
  • Windowshttps://docs.microsoft.com/azure/virtual-machines/extensions/agent-windows
  • Linuxhttps://docs.microsoft.com/azure/virtual-machines/extensions/agent-linux
After the installation of the agent, Azure Backup will install the backup extension while enabling the backup which can also update and patch the extension without any user intervention. Azure VMs can be backed up with the help of following methods:
  • Single Azure VM- directly from the VM settings in the Azure portal.
  • Multiple Azure VMs- You can setup a Recovery Services Vault and configure backup for multiple Azure VMs. 

Application-consistent backup of Azure Linux VMs

Application consistency refers to the successful starting up of your applications when the VMs boot after being restored while performing the backup snapshots of your VMs. You can also use the Linux pre-script and post-script framework to perform application-consistent backups.

Pre-scripts can invoke native application APIs, which can quiesce the IOs, and flush-in memory contents to the disk ensuring the consistent snapshot application; whi;e post-scripts uses native applications APIs to thaw the IOs enabling the application to resume normal operations after the VM snapshot. 

Steps to configure pre-script & post-script

  • First of all, sign in as the root user to the Linux VM that you want to backup.

  • Now download VMSnapshotScriptPluginConfig.json from the GitHub at https://github.com/MicrosoftAzureBackup/VMSnapshotPluginConfig, and copy it to the /etc/azure directory of all VMs you want to backup and if the directory doesn't exist, then you have to create it.

  • Ensure the following permissions of these files- 

  1. VMSnapshotScriptPluginConfig.json: Permission "600"
  2. Pre-script file: Permission "700"
  3. Post-script Permission "700"

  • Now configure VMSnapshotScriptPluginConfig.json as follows: 

  1. pluginName- Leave this entry as it is, or your script might not work as expected.
  2. preScriptLocation- Provide the full path of pre-script on the VM that's going to be backed up.
  3. postScriptLocation- Provide the full path of the post-script on the VM that's going to be backed up.
  4. preScriptParams- Provide the optional parameters that needed to be passed to the pre-script.
  5. postScriptParams- Provide the optional parameters that needed top be passed to the post-script.
  6. preScriptNoOfRetries- Set the number of times the pre-script should be retried if there is any error before terminating where zero means only one and no retry if there is any failure.
  7. postScriptNoOfRetries- Set the number of tries the post-scripts should be retried if there is any error before terminating where zero means only one try and no retry if there is any failure.
  8. timeoutInSeconds- Specify individual timeouts for the pre-script and the post-script (maximum value can be 1800).
  9. continueBackupOnFailure- Set thei 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. However, if you set it to the false, it fails the backup during script failure.
  10. fsFreezeEnabled- Specify whether Linux fsfreeze should be called while you are taking the VM snapshot to ensure file system consistency. It is recommended to set this setting to true unless your application have a dependency on disabling fsfreeze.

  • Now the script framework as well as the VM backup is already configured, the next backup can invoke the scripts and trigger application-consistent backup.




To read part 2 please click here
To read part 3 please click here




Comments

Popular posts from this blog

Deployment (Part 3)

Deployment (Part 1)

Project Resourcing (Part 2)