Created attachment 1883770 [details] engine logs Description of problem: I'm testing the new hybrid backup in the ovirt 4.5 There is one vm which is powered on 1. User starts full backup 2022-05-20 15:06:27,793Z Running command: HybridBackupCommand 2022-05-20 15:06:30,086Z Running command: CreateLiveSnapshotForVmCommand 2. At the same time user power offs the vm 2022-05-20 15:07:02,639Z Running command: ShutdownVmCommand 3.The backup is failed 2022-05-20 15:07:05,274Z Command CreateLiveSnapshotForVm id: '44e0fba3-9a27-456b-86c6-a5ca24d944eb': execution was completed, the command status is 'FAILED' 4. then Validation of action 'RemoveSnapshot' failed for user admin@internal-authz. Reasons: VAR__TYPE__SNAPSHOT,VAR__ACTION__REMOVE,ACTION_TYPE_FAILED_VM_SNAPSHOT_TYPE_NOT_REGULAR and 2022-05-20 15:07:09,525Z ERROR EVENT_ID: VM_BACKUP_FAILED(10,792) 5.If user trys to start next backup it will be failed 2022-05-20 15:10:18,709Z ERROR [org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommand] (default task-24) [4fde0c6e-ae21-4fbb-b379-792b98f354b7] Command 'org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommand' failed: CallableStatementCallback; SQL [{call updatesnapshotid(?, ?)}]; ERROR: update or delete on table "snapshots" violates foreign key constraint "fk_backups_snapshots" on table "vm_backups" Detail: Key (snapshot_id)=(c466b4d3-1d9c-41c4-977b-6360e46192a0) is still referenced from table "vm_backups". Where: SQL statement "UPDATE snapshots SET snapshot_id = v_new_snapshot_id WHERE snapshot_id = v_snapshot_id" Version-Release number of selected component (if applicable): ovirt 4.5.0.8 Actual results: Backup is failed Expected results: Backup mustn't react to changes in the vm power state The ovirt db mustn't have SQL errors
(In reply to Yury.Panchenko from comment #0) > I'm testing the new hybrid backup in the ovirt 4.5 > There is one vm which is powered on > 1. User starts full backup > 2022-05-20 15:06:27,793Z Running command: HybridBackupCommand > 2022-05-20 15:06:30,086Z Running command: CreateLiveSnapshotForVmCommand > 2. At the same time user power offs the vm > 2022-05-20 15:07:02,639Z Running command: ShutdownVmCommand > 3.The backup is failed > 2022-05-20 15:07:05,274Z Command CreateLiveSnapshotForVm id: > '44e0fba3-9a27-456b-86c6-a5ca24d944eb': execution was completed, the command > status is 'FAILED' > 4. then > Validation of action 'RemoveSnapshot' failed for user admin@internal-authz. > Reasons: > VAR__TYPE__SNAPSHOT,VAR__ACTION__REMOVE, > ACTION_TYPE_FAILED_VM_SNAPSHOT_TYPE_NOT_REGULAR > > and > 2022-05-20 15:07:09,525Z ERROR EVENT_ID: VM_BACKUP_FAILED(10,792) This sounds like bz 2080766 - the fix is being tested as part of 4.5.1 > 5.If user trys to start next backup it will be failed > 2022-05-20 15:10:18,709Z ERROR > [org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommand] (default > task-24) [4fde0c6e-ae21-4fbb-b379-792b98f354b7] Command > 'org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommand' failed: > CallableStatementCallback; SQL [{call updatesnapshotid(?, ?)}]; ERROR: > update or delete on table "snapshots" violates foreign key constraint > "fk_backups_snapshots" on table "vm_backups" > Detail: Key (snapshot_id)=(c466b4d3-1d9c-41c4-977b-6360e46192a0) is still > referenced from table "vm_backups". > Where: SQL statement "UPDATE snapshots > SET snapshot_id = v_new_snapshot_id > WHERE snapshot_id = v_snapshot_id" Benny, can you please take a look at this part? maybe we should also detach the snapshot from the backup in this case?
(In reply to Arik from comment #1) > (In reply to Yury.Panchenko from comment #0) > > I'm testing the new hybrid backup in the ovirt 4.5 > > There is one vm which is powered on > > 1. User starts full backup > > 2022-05-20 15:06:27,793Z Running command: HybridBackupCommand > > 2022-05-20 15:06:30,086Z Running command: CreateLiveSnapshotForVmCommand > > 2. At the same time user power offs the vm > > 2022-05-20 15:07:02,639Z Running command: ShutdownVmCommand > > 3.The backup is failed > > 2022-05-20 15:07:05,274Z Command CreateLiveSnapshotForVm id: > > '44e0fba3-9a27-456b-86c6-a5ca24d944eb': execution was completed, the command > > status is 'FAILED' > > 4. then > > Validation of action 'RemoveSnapshot' failed for user admin@internal-authz. > > Reasons: > > VAR__TYPE__SNAPSHOT,VAR__ACTION__REMOVE, > > ACTION_TYPE_FAILED_VM_SNAPSHOT_TYPE_NOT_REGULAR > > > > and > > 2022-05-20 15:07:09,525Z ERROR EVENT_ID: VM_BACKUP_FAILED(10,792) > > This sounds like bz 2080766 - the fix is being tested as part of 4.5.1 > > > 5.If user trys to start next backup it will be failed > > 2022-05-20 15:10:18,709Z ERROR > > [org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommand] (default > > task-24) [4fde0c6e-ae21-4fbb-b379-792b98f354b7] Command > > 'org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommand' failed: > > CallableStatementCallback; SQL [{call updatesnapshotid(?, ?)}]; ERROR: > > update or delete on table "snapshots" violates foreign key constraint > > "fk_backups_snapshots" on table "vm_backups" > > Detail: Key (snapshot_id)=(c466b4d3-1d9c-41c4-977b-6360e46192a0) is still > > referenced from table "vm_backups". > > Where: SQL statement "UPDATE snapshots > > SET snapshot_id = v_new_snapshot_id > > WHERE snapshot_id = v_snapshot_id" > > Benny, can you please take a look at this part? maybe we should also detach > the snapshot from the backup in this case? yes, it looks like the reference prevented the creation
I'm not able to reproduce this on engine-4.5.0.7-0.9.el8ev, can you pls add a more detailed reproduction flow? The flow I tested: 1. Have a running VM 2. Start a full backup 3. When the auto-generated snapshot is being created -> power off the VM. --> VM was powered off successfully and backup succeeded.
(In reply to Evelina Shames from comment #3) > I'm not able to reproduce this on engine-4.5.0.7-0.9.el8ev, can you pls add > a more detailed reproduction flow? > > The flow I tested: > 1. Have a running VM > 2. Start a full backup > 3. When the auto-generated snapshot is being created -> power off the VM. > > --> VM was powered off successfully and backup succeeded. I managed to reproduce this with shutdown VM (instead of power-off VM). Same flow was tested also on ovirt-engine-4.5.1-0.62.el8ev.noarch and passed successfully. Moving to 'Verified'.
This bugzilla is included in oVirt 4.5.1 release, published on June 22nd 2022. Since the problem described in this bug report should be resolved in oVirt 4.5.1 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.