On Sun, Jun 5, 2022 at 7:00 PM Patrick Hibbs <hibbsncc1701@gmail.com> wrote:
You can use the all_disks_for_vms view, instead of all_disks. Then add the vm_id and / or vm_names columns.

For example:

/usr/share/ovirt-engine/dbscripts/engine-psql.sh -c "select disk_id,image_guid,disk_alias,disk_profile_name,vm_id,vm_names from all_disks_for_vms where disk_content_type='0' order by disk_alias" > /root/disk_ids-to_vms.txt

-Patrick Hibbs




Thas seems indeed better, thanks!

 engine=# select disk_id,image_guid,disk_alias,disk_profile_name,vm_id,vm_names from all_disks_for_vms where disk_content_type='0' and disk_alias='ostack-ceph1_Disk3';
               disk_id                |              image_guid              |     disk_alias     |
disk_profile_name |                vm_id                 |   vm_names  
--------------------------------------+--------------------------------------+--------------------+-
------------------+--------------------------------------+--------------
 1093ada3-65b2-407a-a6b8-fd9529f4a0db | ded7c7c7-477f-44e3-8ac5-8908bde6340c | ostack-ceph1_Disk3 |
2t_1              | 711e5dc6-04a1-42a4-b52c-96685bc19b1f | ostack-ceph1
(1 row)

so that I can link the directory and disk file under /2t_1/images/caa6fd69-e371-4476-89eb-cbbae82c2add/images

1093ada3-65b2-407a-a6b8-fd9529f4a0db/ded7c7c7-477f-44e3-8ac5-8908bde6340c

with the disk alias ostack-ceph1_Disk3

and with the corresponding vm id as seen from GUI 711e5dc6-04a1-42a4-b52c-96685bc19b1f and its name ostack-ceph1

I'm going to crosscheck in a SAN based configuration if any sort of"translation" is to be done, due to the layout based on LVM and not on filesystem

Gianluca