Bug 1593363 - Disk is not visible in Disk Import Tab after re-attaching the Data domain containing the disk to Datacenter.
Summary: Disk is not visible in Disk Import Tab after re-attaching the Data domain con...
Keywords:
Status: CLOSED DUPLICATE of bug 1108904
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.2.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact: meital avital
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-20 16:52 UTC by Koutuk Shukla
Modified: 2023-12-15 16:06 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-02 18:10:56 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1411133 0 None None None 2018-08-29 20:27:16 UTC

Description Koutuk Shukla 2018-06-20 16:52:41 UTC
Description of problem:

Disk not visible in Disk Import Tab after re-attaching the Data domain containing the disk to Datacenter.

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

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with 2 disks. Each disk on seperate data domain.
2. Deactivate one of the disk lets say Disk2. Detach the Data domain containing Disk2. Re-attach the Data domain. 
3. Check Disk Import tab. Disk2 is missing.

Actual results:

- Disk is missing from Disk Import tab.

Expected results:

- We should be able to import the disk sucessfully.

Additional info:


- Disk info is updated in the ovf stores.

Comment 11 Marina Kalinin 2018-08-29 20:27:17 UTC
Here it is: 
https://bugzilla.redhat.com/show_bug.cgi?id=1138139

Vaibhav, is the solution mentioned in this bug not resolving the problem?
~~~
This release adds the ability to register unregistered floating disks through the GUI. Previously, because floating disks are not part of any virtual machine or template, the user could only register floating disks from the REST API, not from the GUI. Now there is a subtab in the GUI called "Import Disk" which allows the user to register a floating disk into the setup. Storage domains also support a functionality called "Scan Disks", which scans the storage domain for unregistered floating disks that are not reflected in the setup. This can be helpful for managing disks from external storage domains.
~~~

Comment 12 Marina Kalinin 2018-08-29 20:27:53 UTC
sorry, Koutuk, not Vaibhav.

Comment 13 Tal Nisan 2018-08-30 09:53:55 UTC
Maor, do we take into consideration the disk state (active/not active) when detaching a storage domain?

Comment 14 Maor 2018-08-30 11:10:15 UTC
The disk state should not be a factor.
If I remember correctly if the disk is related to an entity we filter it out of the disk registration to avoid any problems when the user will try to register the VM.
Can you please share the output of the following sql commands:
1) SELECT * FROM unregistered_disks;
2) SELECT * FROM unregistered_disks_to_vms ;

If the disk is related to a VM entity it will not be shown in the unregistered disks sub tab

Comment 15 Koutuk Shukla 2018-08-30 16:32:18 UTC
(In reply to Maor from comment #14)
> The disk state should not be a factor.
> If I remember correctly if the disk is related to an entity we filter it out
> of the disk registration to avoid any problems when the user will try to
> register the VM.
> Can you please share the output of the following sql commands:
> 1) SELECT * FROM unregistered_disks;
> 2) SELECT * FROM unregistered_disks_to_vms ;
> 
> If the disk is related to a VM entity it will not be shown in the
> unregistered disks sub tab


Hello Maor,

Below is the information from an attempt I carried out recently.

- Added a new disk "Test2_Disk1" to VM Test2 which already had one more disk.  
- Deactivated the disk Test2_Disk1
- Detached and removed the ISCSI storage domain holding disk Test2_Disk1
- Imported ISCSI storage domain again.
- Disk Test2_Disk1 missing from Disk import tab.
- VM Test2 available in Import vm tab.
- Ran below command from rhevm database after Storage domain import.

engine=# SELECT * FROM unregistered_disks where disk_alias='Test2_Disk1';
               disk_id                | disk_alias  | disk_description |          storage_domain_id           |     creation_date      |     last_modified      | volume_type | volume_format | actual_size |    si
ze    |               image_id               
--------------------------------------+-------------+------------------+--------------------------------------+------------------------+------------------------+-------------+---------------+-------------+------------+--------------------------------------
 f8be06db-24de-4adf-b4d3-e3b5de92da98 | Test2_Disk1 |                  | 0f1a7d0d-442f-4d1c-8fa6-767df40ac54d | 2018-08-30 11:55:31-04 | 1969-12-31 19:00:00-05 |           1 |             5 |  1073741824 | 1073741824 | 7ed772cf-deba-4fa4-8111-cd07f6e1b275

engine=# SELECT * FROM unregistered_disks_to_vms where disk_id ='f8be06db-24de-4adf-b4d3-e3b5de92da98';
               disk_id                |              entity_id               | entity_name |          storage_domain_id           
--------------------------------------+--------------------------------------+-------------+--------------------------------------
 f8be06db-24de-4adf-b4d3-e3b5de92da98 | 8baf913d-7cc8-4222-8306-76c88adfaf4b | Test2       | 0f1a7d0d-442f-4d1c-8fa6-767df40ac54d

Thanks,
Koutuk Shukla

Comment 16 Maor 2018-08-30 19:10:23 UTC
The engine filters out all unregistered disks that have VMs associate with them in the GUI, since the unregistered disks tab is mainly aim to register floating disks.
The reason for that is that once a disk will be registered it might be problematic to register the VM later that is why we hide those disks.

If you want to register a specific disk which is attached to a VM, you can do that through the REST by doing the following commands:
1. This is how you list all the unregistered disks in a storage domain:
https://ovirt.org/develop/release-management/features/storage/importstoragedomain/#get-all-the-unregistered-disks-in-the-storage-domain
2. Once you know which disk you desire to register, use the following REST command:
https://ovirt.org/develop/release-management/features/storage/importstoragedomain/#register-an-unregistered-disk

Comment 17 Ryan Barry 2018-08-31 16:22:05 UTC
That was the workaround (REST API), Maor, which works.

I guess the question is: "shouldn't the engine re-attach disks with IDs known to VMs automatically when the domain is re-attached?" There's a very low risk of GUID conflicts, but it seems like it would not be difficult to do.

Comment 18 Maor 2018-09-02 13:23:33 UTC
Hi Ryan,

The problem of doing that automatically is because the VM's snapshots might not be synced.
If the VM was changed since it was registred to the engine, for example if one of its snapshots got deleted or a new snapshot was added to it, it will be a problem to registrer the other disk later since the chain of the disk's volumes will not be synced with the VM's snapshots.

we have an old RFE which adress part of this requirement (see https://bugzilla.redhat.com/1108904):
*  Register the remaining disks to the existing VM in the setup (While there
was no change in the VM)

Comment 19 Tal Nisan 2018-09-02 14:43:06 UTC
Ryan, can I close as a dup of bug 1108904?

Comment 20 Ryan Barry 2018-09-02 15:25:05 UTC
Ok with me

Comment 21 Maor 2018-09-02 18:10:56 UTC

*** This bug has been marked as a duplicate of bug 1108904 ***


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