Description of problem: When getting total_size from a disk that does not have any snapshot. The reported value is 0. Version-Release number of selected component (if applicable): 4.2.2.6 How reproducible: 100% Steps to Reproduce: 1.Crate VM and one disk 2.get the total_size from the RestAPI Actual results: 0 in SDK, not displayed in the API Expected results: The total_size should be the same as the actual size. 0 total_size is not logical.
Hi Roman, Please add the link/path to the specific collection in the rest-api. Thanks
Moreover, It seems like you created thin-provision disk that doesn't actually use any byte. the total_size attribute specifies only the used space, here is the relevant documentation: " The total size of the disk including all of its snapshots, in bytes. The total size is the number of bytes actually used by the disk plus the size of its snapshots. It won't be populated for direct LUN and Cinder disks. For disks without snapshots the total size is equal to the actual size." If this is the case, please close this bug as NOTABUG.
(In reply to Eyal Shenitzky from comment #2) > Moreover, > > It seems like you created thin-provision disk that doesn't actually use any > byte. > the total_size attribute specifies only the used space, here is the relevant > documentation: > > " The total size of the disk including all of its snapshots, in bytes. > The total size is the number of bytes actually used by the disk plus the > size of its snapshots. > It won't be populated for direct LUN and Cinder disks. > For disks without snapshots the total size is equal to the actual size." > > If this is the case, please close this bug as NOTABUG. In this case, The storage domain is FC so even if there are no changes to the disk the LV is 1GB in size. <?xml version="1.0"?> <disk href="/ovirt-engine/api/disks/3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f" id="3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f"> <actions> <link href="/ovirt-engine/api/disks/3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f/sparsify" rel="sparsify"/> <link href="/ovirt-engine/api/disks/3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f/move" rel="move"/> <link href="/ovirt-engine/api/disks/3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f/refreshlun" rel="refreshlun"/> <link href="/ovirt-engine/api/disks/3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f/copy" rel="copy"/> <link href="/ovirt-engine/api/disks/3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f/export" rel="export"/> </actions> <name>olimpb-test1_Disk1</name> <link href="/ovirt-engine/api/disks/3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f/permissions" rel="permissions"/> <link href="/ovirt-engine/api/disks/3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f/statistics" rel="statistics"/> <actual_size>3355443200</actual_size> <alias>olimpb-test1_Disk1</alias> <content_type>data</content_type> <format>cow</format> <image_id>e8162fbb-47cb-4dda-9051-f3f718489bf2</image_id> <propagate_errors>false</propagate_errors> <provisioned_size>10737418240</provisioned_size> <qcow_version>qcow2_v2</qcow_version> <shareable>false</shareable> <sparse>true</sparse> <status>ok</status> <storage_type>image</storage_type> <total_size>0</total_size> <wipe_after_delete>false</wipe_after_delete> <storage_domains> <storage_domain href="/ovirt-engine/api/storagedomains/26050f66-8486-4974-ba43-bc71b4d9652f" id="26050f66-8486-4974-ba43-bc71b4d9652f"/> </storage_domains> </disk> lvs -o lv_size,lv_name,lv_tags | grep 3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f 3.12g e8162fbb-47cb-4dda-9051-f3f718489bf2 IU_3f2fb0c5-d6de-4ded-b380-18f34c5d5a6f,MD_156,PU_00000000-0000-0000-0000-000000000000
Hey Roman, I tried to reproduce the bug, I created a VM with one FC disk (thin and preallocation), but I see that the actual size seems to reflect the disk size - thin-disk: <name>fc_thin_Disk1</name> <link href="/ovirt-engine/api/disks/4195b866-4999-4ce8-a665-2a4259a98796/permissions" rel="permissions"/> <link href="/ovirt-engine/api/disks/4195b866-4999-4ce8-a665-2a4259a98796/statistics" rel="statistics"/> <actual_size>1073741824</actual_size> <alias>fc_thin_Disk1</alias> <content_type>data</content_type> <format>cow</format> <image_id>3be091cf-8337-4de3-a056-1a31247caaa2</image_id> <propagate_errors>false</propagate_errors> <provisioned_size>3221225472</provisioned_size> <qcow_version>qcow2_v3</qcow_version> <shareable>false</shareable> <sparse>true</sparse> <status>ok</status> <storage_type>image</storage_type> <total_size>1073741824</total_size> <wipe_after_delete>false</wipe_after_delete> preallocation disk: <name>fc_pre_Disk1</name> <link href="/ovirt-engine/api/disks/667c5f79-fb5a-4171-88ed-e10f2d89be0c/permissions" rel="permissions"/> <link href="/ovirt-engine/api/disks/667c5f79-fb5a-4171-88ed-e10f2d89be0c/statistics" rel="statistics"/> <actual_size>3221225472</actual_size> <alias>fc_pre_Disk1</alias> <content_type>data</content_type> <format>raw</format> <image_id>50d76fc2-7f4f-442a-99b1-09b6d6da0e89</image_id> <propagate_errors>false</propagate_errors> <provisioned_size>3221225472</provisioned_size> <shareable>false</shareable> <sparse>false</sparse> <status>ok</status> <storage_type>image</storage_type> <total_size>3221225472</total_size> <wipe_after_delete>false</wipe_after_delete> Can you reproduce it with other engine/storage?
I am reopening this bug as I was able to reproduce this issue in a different environment. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <disk href="/ovirt-engine/api/disks/adfeab7d-0e98-4fa2-a1c5-37401ba524e2" id="adfeab7d-0e98-4fa2-a1c5-37401ba524e2"> <actions> <link href="/ovirt-engine/api/disks/adfeab7d-0e98-4fa2-a1c5-37401ba524e2/move" rel="move"/> <link href="/ovirt-engine/api/disks/adfeab7d-0e98-4fa2-a1c5-37401ba524e2/refreshlun" rel="refreshlun"/> <link href="/ovirt-engine/api/disks/adfeab7d-0e98-4fa2-a1c5-37401ba524e2/copy" rel="copy"/> <link href="/ovirt-engine/api/disks/adfeab7d-0e98-4fa2-a1c5-37401ba524e2/export" rel="export"/> <link href="/ovirt-engine/api/disks/adfeab7d-0e98-4fa2-a1c5-37401ba524e2/sparsify" rel="sparsify"/> </actions> <name>test04_Disk1</name> <link href="/ovirt-engine/api/disks/adfeab7d-0e98-4fa2-a1c5-37401ba524e2/permissions" rel="permissions"/> <link href="/ovirt-engine/api/disks/adfeab7d-0e98-4fa2-a1c5-37401ba524e2/statistics" rel="statistics"/> <actual_size>1073741824</actual_size> <alias>test04_Disk1</alias> <content_type>data</content_type> <format>cow</format> <image_id>01a281ab-bab5-46c5-b028-4a10ebe12dea</image_id> <propagate_errors>false</propagate_errors> <provisioned_size>5368709120</provisioned_size> <qcow_version>qcow2_v3</qcow_version> <shareable>false</shareable> <sparse>true</sparse> <status>ok</status> <storage_type>image</storage_type> <total_size>0</total_size> <wipe_after_delete>false</wipe_after_delete> <disk_profile href="/ovirt-engine/api/diskprofiles/cea68115-f390-48b5-b3f1-b6f12e43c456" id="cea68115-f390-48b5-b3f1-b6f12e43c456"/> <quota href="/ovirt-engine/api/datacenters/626f7850-5b6c-48d0-88d8-9b26d1ccfebd/quotas/994e2344-fcbb-4c7b-bdf2-3e7515d8ebab" id="994e2344-fcbb-4c7b-bdf2-3e7515d8ebab"/> <storage_domains> <storage_domain href="/ovirt-engine/api/storagedomains/08ef5828-b427-494f-b680-09ba32470926" id="08ef5828-b427-494f-b680-09ba32470926"/> </storage_domains> </disk> DB: engine=# select * from images JOIN disk_image_dynamic on images.image_guid = disk_image_dynamic.image_id where image_group_id ='adfeab7d-0e98-4fa2-a1c5-37401ba524e2'; -[ RECORD 1 ]---------+------------------------------------- image_guid | 01a281ab-bab5-46c5-b028-4a10ebe12dea creation_date | 2018-05-25 12:57:08+00 size | 5368709120 it_guid | 00000000-0000-0000-0000-000000000000 parentid | 00000000-0000-0000-0000-000000000000 imagestatus | 1 lastmodified | 1970-01-01 00:00:00+00 vm_snapshot_id | 3d5531b1-e888-4eb1-9a92-df3bb0bc2a29 volume_type | 2 volume_format | 4 image_group_id | adfeab7d-0e98-4fa2-a1c5-37401ba524e2 _create_date | 2018-05-25 12:57:03.784241+00 _update_date | 2018-05-25 12:57:19.289531+00 active | t volume_classification | 0 qcow_compat | 2 image_id | 01a281ab-bab5-46c5-b028-4a10ebe12dea read_rate | write_rate | actual_size | 1073741824 read_latency_seconds | write_latency_seconds | flush_latency_seconds | _update_date | 2018-05-25 12:57:19.289531+00 1) Create VM 1.1) Template Blank 1.20 Optimized for Desktop 2) Click Create in "Instance Images" 2.1) Size = 5 2.2) Storage Domain iscsi 2.3) Allocation policy = Thin Provision 2.4) Click Ok 3) Click Ok rpm -q rhvm rhvm-4.2.3.6-0.1.el7.noarch Result: total size is 0.
I tried to reproduce according to the steps above and got the expected result: <disk href="/ovirt-engine/api/disks/708e1408-0592-43fa-a43c-5381cdb4845f" id="708e1408-0592-43fa-a43c-5381cdb4845f"> <name>size_vm_Disk1</name> <link href="/ovirt-engine/api/disks/708e1408-0592-43fa-a43c-5381cdb4845f/permissions" rel="permissions"/> <link href="/ovirt-engine/api/disks/708e1408-0592-43fa-a43c-5381cdb4845f/statistics" rel="statistics"/> <actual_size>1073741824</actual_size> <alias>size_vm_Disk1</alias> <content_type>data</content_type> <format>cow</format> <image_id>250310e6-3162-4967-b9ba-2b9a3a46a98b</image_id> <propagate_errors>false</propagate_errors> <provisioned_size>5368709120</provisioned_size> <qcow_version>qcow2_v3</qcow_version> <shareable>false</shareable> <sparse>true</sparse> <status>ok</status> <storage_type>image</storage_type> <total_size>1073741824</total_size> <wipe_after_delete>false</wipe_after_delete> <disk_profile href="/ovirt-engine/api/diskprofiles/1dfcc896-91d0-4de3-90b5-354390d2f617" id="1dfcc896-91d0-4de3-90b5-354390d2f617"/> <quota href="/ovirt-engine/api/datacenters/8152ad85-4bfe-4e2e-9a72-469e4dc79c8d/quotas/3067cea8-61ab-4270-b330-5f2670571299" id="3067cea8-61ab-4270-b330-5f2670571299"/> <storage_domains> <storage_domain href="/ovirt-engine/api/storagedomains/fa8e6dda-2d2b-4402-b108-c95af781cf51" id="fa8e6dda-2d2b-4402-b108-c95af781cf51"/> </storage_domains> </disk> image_guid | 250310e6-3162-4967-b9ba-2b9a3a46a98b creation_date | 2018-05-27 09:06:23+03 size | 5368709120 it_guid | 00000000-0000-0000-0000-000000000000 parentid | 00000000-0000-0000-0000-000000000000 imagestatus | 1 lastmodified | 1970-01-01 02:00:00+02 vm_snapshot_id | 520ef495-fba3-4855-8217-4fc942af570a volume_type | 2 volume_format | 4 image_group_id | 708e1408-0592-43fa-a43c-5381cdb4845f _create_date | 2018-05-27 09:06:21.050865+03 _update_date | 2018-05-27 09:06:36.436157+03 active | t volume_classification | 0 qcow_compat | 2 image_id | 250310e6-3162-4967-b9ba-2b9a3a46a98b read_rate | write_rate | actual_size | 1073741824 read_latency_seconds | write_latency_seconds | flush_latency_seconds | _update_date | 2018-05-27 09:06:36.436157+03 Can I get an access to your environment to see what is the difference?
Thanks Roman, I suppose I should have asked this before.
Disk total size is reported correctly for a disk both in /disks collection and in /disks/%disk_id% From /disks - <disk href="/ovirt-engine/api/disks/b0c84e87-7bd1-4e0b-8766-6dcb7de005b2" id="b0c84e87-7bd1-4e0b-8766-6dcb7de005b2"> ... <total_size>2147483648</total_size> And from /disks/b0c84e87-7bd1-4e0b-8766-6dcb7de005b2 - <disk href="/ovirt-engine/api/disks/b0c84e87-7bd1-4e0b-8766-6dcb7de005b2" id="b0c84e87-7bd1-4e0b-8766-6dcb7de005b2"> ... <total_size>2147483648</total_size> ==================== Used: rhvm-4.2.5-0.1.el7ev.noarch ovirt-engine-restapi-4.2.5-0.1.el7ev.noarch
This bugzilla is included in oVirt 4.2.5 release, published on July 30th 2018. Since the problem described in this bug report should be resolved in oVirt 4.2.5 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.