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.
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. ~~~
sorry, Koutuk, not Vaibhav.
Maor, do we take into consideration the disk state (active/not active) when detaching a storage domain?
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
(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
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
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.
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)
Ryan, can I close as a dup of bug 1108904?
Ok with me
*** This bug has been marked as a duplicate of bug 1108904 ***