Azure / azure-linux-extensions

Linux Virtual Machine Extensions for Azure
Apache License 2.0
304 stars 252 forks source link

Adding new error code FailedSafeFreezeBinaryNotFound #1851

Closed arisettisanjana closed 9 months ago

arisettisanjana commented 9 months ago

Requirement: Currently, in the VM Snapshot Linux extension, its run can fail with generic fsfreezefailedtimeout error code in cases when the requisite fsfreeze binary file is not present in the bin/ folder. This scenario can occur when the target file has been manually deleted or deleted by an AntiVirus program that does not recognize the file. We require a different error code to distinguish such failures to enable better debugging when file is missing. Introducing FailedSafeFreezeBinaryNotFound error code to cover for such scenarios.

Changes made in: fsfreeze.py - before IO freeze is performed added a check whether the binary exists and then proceed accordingly. handle.py - checks the flag and exits if file is missing added error code in common.py, ExtensionErrorCodeHelper.py