Bug 1982083 - [Cinderlib][MBS] Cloning VM with managed block storage raise a NPE
Summary: [Cinderlib][MBS] Cloning VM with managed block storage raise a NPE
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.4.7.6
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.5.0
: 4.5.0
Assignee: shani
QA Contact: sshmulev
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-14 07:29 UTC by Sandro Bonazzola
Modified: 2022-04-20 06:33 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Cloning a VM with an MBS disk. Consequence: While trying to remove the auto-generated snapshot, the operation fails with an NPE. Fix: Fix the disks' filtering to include the MBS disks as well. Result: The operation finished without throwing an NPE.
Clone Of:
Environment:
Last Closed: 2022-04-20 06:33:59 UTC
oVirt Team: Storage
Embargoed:
pm-rhel: ovirt-4.5?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-engine pull 56 0 None Merged core: skiping snapshots for VMs with MBS disks and attaching MBS disks while cloning a VM 2022-02-24 13:26:47 UTC
Red Hat Issue Tracker RHV-42789 0 None None None 2021-10-19 08:50:04 UTC
Red Hat Issue Tracker RHV-42790 0 None None None 2022-02-23 13:29:37 UTC
oVirt gerrit 118169 0 master POST core: skip snapshots for VMs with MBS disks 2022-02-02 20:39:47 UTC

Description Sandro Bonazzola 2021-07-14 07:29:14 UTC
While cloning a VM using Ceph managed block storage the engine raises a NPE and the cloning is aborted.


2021-07-14 07:20:36,862Z INFO  [org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommand] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-9) [5a9b3ea6] Running command: RemoveSnapshotCommand internal: true. Entities affected :  ID: bd3ad688-4498-4ba4-a36e-e1e1893f7ceb Type: VMAction group MANIPULATE_VM_SNAPSHOTS with role type USER
2021-07-14 07:20:36,886Z INFO  [org.ovirt.engine.core.bll.storage.disk.managedblock.RemoveManagedBlockStorageSnapshotCommand] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-9) [5a9b3ea6] Running command: RemoveManagedBlockStorageSnapshotCommand internal: true.
2021-07-14 07:20:39,504Z INFO  [org.ovirt.engine.core.common.utils.cinderlib.CinderlibExecutor] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-9) [5a9b3ea6] cinderlib output: 
2021-07-14 07:20:39,572Z ERROR [org.ovirt.engine.core.bll.SerialChildCommandsExecutionCallback] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-9) [5a9b3ea6] Command 'CloneVm' id: '97405a72-16a6-4b52-9eab-c6641d05cde5' with children [49c3b8bd-6928-401c-80eb-07629c7bd3d1] failed when attempting to perform the next operation, marking as 'ACTIVE'
2021-07-14 07:20:39,572Z ERROR [org.ovirt.engine.core.bll.SerialChildCommandsExecutionCallback] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-9) [5a9b3ea6] null: java.lang.NullPointerException
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.buildStorageToDiskMap(ImagesHandler.java:288)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.CloneVmCommand.setSnapshotId(CloneVmCommand.java:148)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.CloneVmCommand.removeVmSnapshot(CloneVmCommand.java:292)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.CloneVmCommand.executeNextOperation(CloneVmCommand.java:210)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.CloneVmCommand.performNextOperation(CloneVmCommand.java:191)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.SerialChildCommandsExecutionCallback.childCommandsExecutionEnded(SerialChildCommandsExecutionCallback.java:32)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.ChildCommandsCallbackBase.doPolling(ChildCommandsCallbackBase.java:80)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.tasks.CommandCallbacksPoller.invokeCallbackMethodsImpl(CommandCallbacksPoller.java:175)
        at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.tasks.CommandCallbacksPoller.invokeCallbackMethods(CommandCallbacksPoller.java:109)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at org.glassfish.javax.enterprise.concurrent//org.glassfish.enterprise.concurrent.internal.ManagedScheduledThreadPoolExecutor$ManagedScheduledFutureTask.access$201(ManagedScheduledThreadPoolExecutor.java:360)
        at org.glassfish.javax.enterprise.concurrent//org.glassfish.enterprise.concurrent.internal.ManagedScheduledThreadPoolExecutor$ManagedScheduledFutureTask.run(ManagedScheduledThreadPoolExecutor.java:511)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
        at org.glassfish.javax.enterprise.concurrent//org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl$ManagedThread.run(ManagedThreadFactoryImpl.java:227)

2021-07-14 07:20:39,572Z INFO  [org.ovirt.engine.core.bll.SerialChildCommandsExecutionCallback] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-9) [5a9b3ea6] Command 'CloneVm' id: '97405a72-16a6-4b52-9eab-c6641d05cde5' child commands '[49c3b8bd-6928-401c-80eb-07629c7bd3d1]' executions were completed, status 'FAILED'
2021-07-14 07:20:40,580Z INFO  [org.ovirt.engine.core.bll.ConcurrentChildCommandsExecutionCallback] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-92) [5a9b3ea6] Command 'RemoveSnapshot' id: '59200d32-fb05-43fa-a83b-4a4d0537c618' child commands '[00745fdd-cccb-45c3-a257-81ee380f784e]' executions were completed, status 'SUCCEEDED'
2021-07-14 07:20:40,621Z ERROR [org.ovirt.engine.core.bll.CloneVmCommand] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-92) [aff794e2-11f4-4296-9309-8eede8b23534] Ending command 'org.ovirt.engine.core.bll.CloneVmCommand' with failure.
2021-07-14 07:20:40,645Z INFO  [org.ovirt.engine.core.bll.CloneVmCommand] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-92) [aff794e2-11f4-4296-9309-8eede8b23534] Lock freed to object 'EngineLock:{exclusiveLocks='[aefd639e-e79b-41c2-9e25-a8e65be2825b=DISK, bd3ad688-4498-4ba4-a36e-e1e1893f7ceb=VM, test3=VM_NAME]', sharedLocks=''}'
2021-07-14 07:20:40,680Z ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-92) [aff794e2-11f4-4296-9309-8eede8b23534] EVENT_ID: USER_ADD_VM_FINISHED_FAILURE(60), Failed to complete VM test3 creation.
2021-07-14 07:20:41,699Z INFO  [org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommand] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-32) [5a9b3ea6] Ending command 'org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommand' successfully.

Comment 1 Sandro Bonazzola 2021-07-14 07:30:00 UTC
ovirt-engine-4.4.7.6-1.el8.noarch

Comment 4 shani 2022-01-02 09:51:01 UTC
Steps to reproduce:
1) Create a new MBS domain via rest API
2) Create a new disk under the new MBS domain.
3) Create a new VM and attach the disk to it.
4) Press the 'Clone VM' button.

Comment 5 sshmulev 2022-03-01 13:34:35 UTC
Verified successfully.

Versions:
ovirt-engine-4.5.0-743c0a787472.209.el8ev
vdsm-4.50.0.7-1.el8ev

Steps to reproduce:
1) Create a new MBS domain via rest API
2) Create a new disk under the new MBS domain.
3) Create a new VM and attach the disk to it.
4) Press the 'Clone VM' button.
5) Run the VMs (source and cloned one)
6) Check the VMs are running (source and cloned one)
7) Check disk size is correct on the cloned VM.
 
Actual results - As expected:
VM was cloned successfully, with the MBD attached disk to it as a copy.
The VMs run without any issue and the disks are ok.

Comment 7 Sandro Bonazzola 2022-04-20 06:33:59 UTC
This bugzilla is included in oVirt 4.5.0 release, published on April 20th 2022.

Since the problem described in this bug report should be resolved in oVirt 4.5.0 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.


Note You need to log in before you can comment on or make changes to this bug.