This is a proper fix for the original BZ 1498580. When there are not enough macs in mac pool, preview vm snapshot fails. The fix for the original BZ was an agreed upon quick fix. Since the check for free macs can be performed at validation time, the validation should fail if there are no free macs in the pool. Description from original BZ Job isn't finished and stuck in the engine db. Them image is locked for ever and can't be released. Preview VM Snapshot is failed and engine aware of it, but the job keep running for ever. NO time out. <jobs> <jobhref="/ovirt-engine/api/jobs/19f3e594-a84c-406e-bd0f-5bf681179fc1"id="19f3e594-a84c-406e-bd0f-5bf681179fc1"> <actions> <linkhref="/ovirt-engine/api/jobs/19f3e594-a84c-406e-bd0f-5bf681179fc1/clear"rel="clear"/> <linkhref="/ovirt-engine/api/jobs/19f3e594-a84c-406e-bd0f-5bf681179fc1/end"rel="end"/> </actions> <description>Preview VM Snapshot snap4 of VM VM6</description> <linkhref="/ovirt-engine/api/jobs/19f3e594-a84c-406e-bd0f-5bf681179fc1/steps"rel="steps"/> <auto_cleared>true</auto_cleared> <external>false</external> <last_updated>2017-09-27T10:52:18.730+03:00</last_updated> <start_time>2017-09-27T10:52:16.205+03:00</start_time> <status>started</status> <ownerhref="/ovirt-engine/api/users/586c19dc-00b9-00fa-0364-00000000012f"id="586c19dc-00b9-00fa-0364-00000000012f"/> </job> - Snapshot-Preview snap4 for VM VM6 was initiated by admin@internal-authz. - No MAC addresses left in the MAC Address Pool. - Some MAC addresses had to be reallocated, but operation failed because of insufficient amount of free MACs. - Failed to complete Snapshot-Preview snap4 for VM VM6. - In case of snapshot preview and we need to allocate new MAC for the VM and we have no MACs left, the operation must failed. It is indeed failing and engine aware of the failure, but the job run for ever and stuck in Finalize state. The most worst thing here is that the image got locked for ever! - Steps to reproduce - 1) Master 4.2 2) 2 VMs in cluster 3) MAC pool range with only one MAC address in cluster 4) Start VM1 with 1 vNIC with MAC 'z' 5) Create snapshot from VM1 6) Unplug the vNIC from VM1 and give MAC 'w'(not from the pool) to VM1 and assign MAC address 'z'(the origin MAC) to VM2 7) Try to preview VM1 from snapshot Expected Result - should fail Actual result - Engine failed operation - - Snapshot-Preview snap4 for VM VM6 was initiated by admin@internal-authz. - No MAC addresses left in the MAC Address Pool. - Some MAC addresses had to be reallocated, but operation failed because of insufficient amount of free MACs. - Failed to complete Snapshot-Preview snap4 for VM VM6. But, the job is stuck and image stay locked!
Changing team to network, but assigning to Ravi as he posted a patch.
Hi Ravi, I wasn't aware of this bug and fix, should i run the same scenario test i did for BZ 1498580, making sure that snapshot preview is failed and the job ends up successfully and the image didn't locked? Thanks,
Verified on - 4.2.0-0.0.master.20171127212333.git11e14b9.el7.centos - Snapshot-Preview snap1 for VM V2 was initiated by admin@internal-authz. - No MAC addresses left in the MAC Address Pool. - Some MAC addresses had to be reallocated, but operation failed because of insufficient amount of free MACs. - Failed to complete Snapshot-Preview snap1 for VM V2. - Undoing a Snapshot-Preview for VM V2 was initialized by admin@internal-authz. - Undoing a Snapshot-Preview for VM V2 has been completed. Preview snapshot failed, job didn't stuck and the image didn't get locked. Undoing snapshot preview successfully completed.
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017. Since the problem described in this bug report should be resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.