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

Bug 1489463

Summary: Leftover LUN in engine DB after restore with --he-remove-storage-vm (seen on FC)
Product: [oVirt] ovirt-engine Reporter: Simone Tiraboschi <stirabos>
Component: Backup-Restore.EngineAssignee: Simone Tiraboschi <stirabos>
Status: CLOSED CURRENTRELEASE QA Contact: Nikolai Sednev <nsednev>
Severity: medium Docs Contact:
Priority: high    
Version: 4.2.0CC: bugs, fgarciad, gveitmic, lsvaty, ylavi
Target Milestone: ovirt-4.1.7Keywords: Triaged
Target Release: 4.1.7.3Flags: rule-engine: ovirt-4.1+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Better filter DB values filtering out the hosted-engine storage domain at DB restore time. In the past there was a leftover in the LUN table if involved.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-13 12:24:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1502747    
Bug Blocks:    

Description Simone Tiraboschi 2017-09-07 13:49:01 UTC
Description of problem:
After running "engine-backup --mode=restore --he-remove-storage-vm ..." the FC LUN used in the initial deployment is still saved in luns table.

If the new env is going to be deployed on the same LUN, the engine will fail importing the hosted-engine storage domain with 
 INFO  [org.ovirt.engine.core.bll.storage.domain.AddExistingBlockStorageDomainCommand] (org.ovirt.thread.pool-6-thread-34) [7d2e6cb2] There are existing luns in the system which are part of VG id 

Version-Release number of selected component (if applicable):
4.1.5

How reproducible:
tbd

Steps to Reproduce:
1. deploy hosted-engine on FC/iSCSI
2. take a backup with engine-backup
3. try to restore with --he-remove-storage-vm

Actual results:
The LUN used on the initial deployment is still in luns table on the restored DB.
If the new env is going to be deployed on the same LUN, the engine will fail importing the hosted-engine storage domain with
 INFO  [org.ovirt.engine.core.bll.storage.domain.AddExistingBlockStorageDomainCommand] (org.ovirt.thread.pool-6-thread-34) [7d2e6cb2] There are existing luns in the system which are part of VG id 

Expected results:
The LUN used by the hosted-engine storage domain is going to be removed as well.

Additional info:
seen on FC, to be verified also on iSCSI

Comment 1 Sandro Bonazzola 2017-10-11 11:12:13 UTC
Should be in oVirt 4.1.7 RC3

Comment 2 Nikolai Sednev 2017-10-18 11:07:09 UTC
Successfully restored engine's db over FC.
More details about reproduction steps available from here: http://pastebin.test.redhat.com/525638.

Moving to verified.

---------------------------After successful initial deployment over FC----------
nsednev-he-5 ~]# sudo -u postgres psql -d engine -c "select * from luns"
could not change directory to "/root"
           physical_volume_id           |      lun_id       |            volume_group_id             |              se
rial              | lun_mapping | vendor_id | product_id | device_size | discard_max_size | discard_zeroes_data
----------------------------------------+-------------------+----------------------------------------+----------------
------------------+-------------+-----------+------------+-------------+------------------+---------------------
 cqJI3t-U5mp-IYZ5-9Gtf-wBWV-SGas-bsm6YO | 3514f0c5a51600f38 | blC01U-dy5m-dV3B-CpWL-4Mk8-OuZX-UJi1mB | SXtremIO_XtremA
pp_XIO00153500071 |           6 | XtremIO   | XtremApp   |          80 |          8388608 | t
(1 row)
--------------------------------------------------------------------------------


---------------------------After successful SHE restor over FC------------------
nsednev-he-5 ~]# sudo -u postgres psql -d engine -c "select * from luns"
could not change directory to "/root"
           physical_volume_id           |      lun_id       |            volume_group_id             |              se
rial              | lun_mapping | vendor_id | product_id | device_size | discard_max_size | discard_zeroes_data
----------------------------------------+-------------------+----------------------------------------+----------------
------------------+-------------+-----------+------------+-------------+------------------+---------------------
 cqJI3t-U5mp-IYZ5-9Gtf-wBWV-SGas-bsm6YO | 3514f0c5a51600f38 | blC01U-dy5m-dV3B-CpWL-4Mk8-OuZX-UJi1mB | SXtremIO_XtremA
pp_XIO00153500071 |           6 | XtremIO   | XtremApp   |          80 |          8388608 | t
(1 row)
--------------------------------------------------------------------------------