Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1797528

Summary: ManagedBlockStorage disk is not deleted when VM is removed
Product: [oVirt] ovirt-engine Reporter: Andrew Sharapov <asharapov>
Component: BLL.StorageAssignee: shani <sleviim>
Status: CLOSED WORKSFORME QA Contact: sshmulev
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.3.7.2CC: bugs, eshenitz, michal.skrivanek, sfishbai, shalygin.k
Target Milestone: ovirt-4.4.9Flags: pm-rhel: ovirt-4.4+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-25 10:42:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine.log of VM removal operation none

Description Andrew Sharapov 2020-02-03 11:19:31 UTC
Created attachment 1657326 [details]
engine.log of VM removal operation

Description of problem:

Hello I try to use oVirt with enabled  ManagedBlockStorage feature (https://www.ovirt.org/develop/release-management/features/storage/cinderlib-integration.html) and ceph as a storage backend. I face a problem that when I remove a VM the disk for VM is not deleted. 

Version-Release number of selected component (if applicable): 4.3.7.2-1.el7

How reproducible: always 

Steps to Reproduce:
1. Create a VM with ManagedBockStorage disk.
2. In oVirt UI select VM and press "Remove" button. "Remove Virtual Machine(s)" dialog appears.
3. Make sure "Remove Disks" check box is selected.
4. Press "OK" button.

Actual results:
VM is deleted, but the VM's disk is not deleted. The following exception can be observed in the  /var/log/ovirt-engine/engine.log
===
2020-02-03 11:03:16,954Z INFO  [org.ovirt.engine.core.bll.storage.disk.managedblock.RemoveAllManagedBlockStorageDisksCommand] (EE-ManagedThreadFactory-commandCoordinator-Thread-4) [c87e1cf9-b903-43d8-9e43-b1d2ee13d5c7] Running command: RemoveAllManagedBlockStorageDisksCommand internal: true.
2020-02-03 11:03:16,992Z INFO  [org.ovirt.engine.core.bll.storage.disk.managedblock.RemoveManagedBlockStorageDiskCommand] (EE-ManagedThreadFactory-commandCoordinator-Thread-5) [c87e1cf9-b903-43d8-9e43-b1d2ee13d5c7] Running command: RemoveManagedBlockStorageDiskCommand internal: true.
2020-02-03 11:03:16,993Z ERROR [org.ovirt.engine.core.bll.storage.disk.managedblock.RemoveManagedBlockStorageDiskCommand] (EE-ManagedThreadFactory-commandCoordinator-Thread-5) [c87e1cf9-b903-43d8-9e43-b1d2ee13d5c7] Failed to remove volume: {}: java.lang.NullPointerException
	at org.ovirt.engine.core.bll.storage.disk.managedblock.RemoveManagedBlockStorageDiskCommand.executeCommand(RemoveManagedBlockStorageDiskCommand.java:75) [bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:1168) [bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1326) [bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:2001) [bll.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:202) [utils.jar:]

    ...
===

Expected results: 

VM and its ManagedBlockStorage disk(volume) should be deleted. 

If there were snapshots created  for this VM, then the snapshots should be deleted as well.

If previously for this VM a revert to snapshot operation has been  performed (and as the result a new volume has been cloned from the snapshot), then the whole chain  newVoume-->snapShot-->originalVolume should be deleted.  

   
Additional info:

Comment 1 RHEL Program Management 2020-02-03 15:30:33 UTC
The documentation text flag should only be set after 'doc text' field is provided. Please provide the documentation text and set the flag to '?' again.

Comment 3 shani 2021-08-24 10:42:10 UTC
Hi Andrew,
We had some changes and fixed several bugs related to the MBS feature.
Currently, I'm using the ovirt-engine-4.4.8.5_master version, and VMs containing MBS disks can be deleted from the UI for me.

Can you please share your current ovirt-engine and let us know if the issue still exists?
Also, can you please share your cinderlib log?
(var/log/ovirt-engine/cinderlib/cinderlib.log)

Comment 4 Andrew Sharapov 2021-08-24 11:49:07 UTC
Hello,

In my tests the VM was deleted as well, but the disk of the vm, which was located in MBS (ceph rbd backend) was not deleted.

Unfortunately the system I used to test MBS is no longer available, so I cannot re-run tests and provide any  new logs.

Comment 5 shani 2021-08-24 13:26:24 UTC
Thank you for the reply, Andrew.
IIUC, there are no logs from your current ovirt environment at all, right?
Are the tests you've mentioned based on the tries you did when you opened the bug?

I'm afraid that without any logs for examining the failure, there's no clear way how to progress from here.
As the code was changed, so the problematic scenario might act differently.

What do you think?

Comment 6 Eyal Shenitzky 2021-08-25 07:36:43 UTC
(In reply to shani from comment #5)
> Thank you for the reply, Andrew.
> IIUC, there are no logs from your current ovirt environment at all, right?
> Are the tests you've mentioned based on the tries you did when you opened
> the bug?
> 
> I'm afraid that without any logs for examining the failure, there's no clear
> way how to progress from here.
> As the code was changed, so the problematic scenario might act differently.
> 
> What do you think?

Let's test the basic flows of removing VMs with MBS disks attached - 

1. VM with MBS disks only
2. Remove the VM and mark 'Remove Disk(s)' checkbox

==> VM and disks should be removed

1. VM with MBS disks and 'regular' disks 
2. Remove the VM and mark 'Remove Disk(s)' checkbox

==> VM and disks should be removed

If all works well we can close this bug as 'WORKSFORME'

Comment 7 shani 2021-08-25 10:42:49 UTC
VM with MBS disks only - VM & disks removal succeeded.
VM with image + MBS disk - VM & disks removal succeeded.

Therefore, closing the bug as WORKSFORME.

Andrew, if there's another issue/same issue reproduced, please let us know.