Azure / azure-linux-extensions

Linux Virtual Machine Extensions for Azure
Apache License 2.0
301 stars 251 forks source link

Azure VM Backup pre_post igored on Ubtuntu 22.04 LTS #1912

Closed tomabg closed 3 months ago

tomabg commented 3 months ago

we setup pre_post like described here: https://learn.microsoft.com/de-de/azure/backup/backup-azure-linux-app-consistent

but it seems ignored during backup

# cat /etc/azure/VMSnapshotScriptPluginConfig.json
{
    "pluginName" : "ScriptRunner",
    "preScriptLocation" : "/root/consisten-azure-vm-backup/stop-icinga_services.sh",
    "postScriptLocation" : "/root/consisten-azure-vm-backup/start-icinga_services.sh",
    "preScriptParams" : ["", ""],
    "postScriptParams" : ["", ""],
    "preScriptNoOfRetries" : 0,
    "postScriptNoOfRetries" : 0,
    "timeoutInSeconds" : 30,
    "continueBackupOnFailure" : true,
    "fsFreezeEnabled" : true
}
#

Maybe the problem is:

2024-04-12 07:35:57.051626 [Microsoft.Azure.RecoveryServices.VMSnapshotLinux-1.0]taskId: dc9c0031-be21-467b-b68e-34608bbf07b0
2024-04-12 07:35:57.052564 [Microsoft.Azure.RecoveryServices.VMSnapshotLinux-1.0]Sleeping for milliseconds: 2545
2024-04-12 07:35:59.600637 [Microsoft.Azure.RecoveryServices.VMSnapshotLinux-1.0]Enable,success,4,Transitioning state in extension,False
2024-04-12 07:35:59.601361 [Microsoft.Azure.RecoveryServices.VMSnapshotLinux-1.0]Failed to retrieve the distinfo with error: module 'platform' has no attribute 'dist', stack trace: Traceback (most recent call last):
  File "/var/lib/waagent/Microsoft.Azure.RecoveryServices.VMSnapshotLinux-1.0.9217.0/main/Utils/HandlerUtil.py", line 569, in get_dist_info
    distinfo = platform.dist()
AttributeError: module 'platform' has no attribute 'dist'

platform.dist() was removed in phyton 3.7 see https://docs.python.org/3.5/library/platform.html#platform.dist

see also similar issue: https://github.com/psychopy/psychopy/issues/2733

current versions:

# waagent --version
/usr/sbin/waagent:27: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
  import imp
WALinuxAgent-2.2.46 running on ubuntu 22.04
Python: 3.10.12
Goal state agent: 2.10.0.8
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy
#

It seems no APP consistent backup currently possible with the provided agent Features. Also we cannot use database consistent backup because Application crashes when DB is set to read only.

For me a non consistent Backup is useless.

tomabg commented 3 months ago

problem seems one cannot use both workload.conf and VMSnapshotScriptPluginConfig.json after rename workload.conf pre_post is working:-(