Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1518791 - [RHV] Wrong values of absolute and relative used size for VM's disks
Summary: [RHV] Wrong values of absolute and relative used size for VM's disks
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.2.2
: ---
Assignee: Idan Shaby
QA Contact: Jan Zmeskal
URL:
Whiteboard: testathon
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-29 15:00 UTC by Jan Zmeskal
Modified: 2018-02-05 08:25 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-04 12:32:42 UTC
oVirt Team: Storage


Attachments (Terms of Use)
1 (deleted)
2017-11-29 15:00 UTC, Jan Zmeskal
no flags Details
2 (deleted)
2017-11-29 15:02 UTC, Jan Zmeskal
no flags Details
3 (deleted)
2017-11-29 15:04 UTC, Jan Zmeskal
no flags Details

Description Jan Zmeskal 2017-11-29 15:00:27 UTC
Created attachment 1360384 [details]
1

Description of problem:
"Number of Disks" for Virtual Machine view displays wrong values in "Used Size" and "Percent Used of Provisioned Size" values. This is true for thin-provisioned and preallocated disks as well.

Version-Release number of selected component (if applicable):
CFME 5.9.0.11.20171127204214_e316988
RHV 4.1.7.6-0.1.el7

How reproducible:
100 %

Steps to Reproduce:
1. Have a RHV provider with VM that has one disk.
2. In CFME, refresh that VM, go to its summary page and click "Disks" field.
3. The values are already wrong - see screenshot 1.
4. In RHV, create a thin-provisioned disk and attach it to VM.
5. Mount the disk at VM and copy some file to it.
6. In CFME, refresh that VM and check Disks again.
See screenshot 2. I have added /dev/sda which has capacity of 1 GB and uploaded 150 MB file to it. You can see that df command show correct values. In CFME that disk is called virtio_scsi 0. The max size is correct, but the used size - relative and absolute - is way off. 
7. In RHV, create a preallocated disk and attach it to VM.
8. Mount the disk at VM and copy some file to it.
9. In CFME, refresh that VM and check Disks again.
See screenshot 3. I have added /dev/sdb which has capacity of 1 GB and uploaded 150 MB file to it. You can see that df command show correct values. In CFME that disk is called virtio_scsi 1. Note that it shows 100.4 % usage! Also the used size of virtio_scsi 0 has changed even though I have not touched it. 

Actual results:
Used Size and Percent Used of Provisioned Size columns show wrong values and change without any interaction with the actual disk

Expected results:
Correct values are shown and are not changed in CFME unless there's been a change on the disk.

Additional info:
VM used to test it runs clean install of RHEL 7.4.
Might be connected to this: https://bugzilla.redhat.com/show_bug.cgi?id=1481585

Comment 2 Jan Zmeskal 2017-11-29 15:02:04 UTC
Created attachment 1360385 [details]
2

Comment 3 Jan Zmeskal 2017-11-29 15:04:21 UTC
Created attachment 1360386 [details]
3

Comment 4 Boriso 2017-11-30 09:30:49 UTC
Allon, I am not sure that comparing the file-system used size to the one reported by rhv is the right comparison. 

Your thoughts?

Comment 8 Oved Ourfali 2017-12-05 09:29:41 UTC
Moving this to the RHV storage team to look at the numbers, as there is no manipulation going on in CFME.

Comment 10 Idan Shaby 2018-01-30 12:17:37 UTC
(In reply to Boriso from comment #4)
> Allon, I am not sure that comparing the file-system used size to the one
> reported by rhv is the right comparison. 
> 
> Your thoughts?

It's indeed not the right comparison.
What type of storage domain are you using? File or block?
In block domains, the actual size of the disk is the size of the LV.
In file domains, the actual size is the size of the file that consists of the disk. You can check the file's size by executing the following command from the command line in one of the hosts in your DC:
stat /rhev/data-center/<dc_id>/<storage_domain_id>/images/<disk_id>/<snapshot_id>

For example, in my env:

stat /rhev/data-center/b9aae904-6670-4ea9-a60f-4d466f34c49d/e1347d75-6665-4a80-a9a5-eadd71958b59/images/3b07c6bb-5357-46ca-9937-7af75064b5d9/86be93a7-98f0-47af-bffb-06323ec022a8
  File: ‘/rhev/data-center/b9aae904-6670-4ea9-a60f-4d466f34c49d/e1347d75-6665-4a80-a9a5-eadd71958b59/images/3b07c6bb-5357-46ca-9937-7af75064b5d9/86be93a7-98f0-47af-bffb-06323ec022a8’
  Size: 10737418240	Blocks: 5263904    IO Block: 1048576 regular file
Device: 29h/41d	Inode: 9043989     Links: 1
Access: (0660/-rw-rw----)  Uid: (   36/    vdsm)   Gid: (   36/     kvm)
Access: 2018-01-30 10:40:25.347805758 +0200
Modify: 2018-01-30 10:42:04.614610352 +0200
Change: 2018-01-30 10:42:04.614610352 +0200
 Birth: -

Multiple the amount of blocks in 512 to get the size in bytes.
Is this the size you get in your env, Jan?

Also, note that the size is updated in the DB every few seconds, so if you check it immediately after writing data to the disk inside the VM, most of the chances are against you. So you would probably want to wait a few seconds before checking the engine's DB.

Comment 11 Jan Zmeskal 2018-02-01 17:08:25 UTC
Hi Idan, I am using file domain and you are right. I used the method suggested by you and then the numbers displayed in CFME UI (and retreived from engine API) actually fit. 

That is unless we are talking about preallocated disk. Preallocated disks have actual size always a bit greater than provisioned size, I guess because of meta data. So now I jsut wonder what's the point of displaying "Percent Used of Provisioned Size" for preallocated disks in CFME UI since it does not reflect the actual usage of that storage.

Comment 12 Idan Shaby 2018-02-04 12:19:30 UTC
(In reply to Jan Zmeskal from comment #11)
> Hi Idan, I am using file domain and you are right. I used the method
> suggested by you and then the numbers displayed in CFME UI (and retreived
> from engine API) actually fit. 
> 
> That is unless we are talking about preallocated disk. Preallocated disks
> have actual size always a bit greater than provisioned size, I guess because
> of meta data.
Correct
> So now I jsut wonder what's the point of displaying "Percent
> Used of Provisioned Size" for preallocated disks in CFME UI since it does
> not reflect the actual usage of that storage.
Well, you are right. In RHV, a preallocated disk on a file domain has an actual size that is equal to its virtual size.

Comment 13 Nir Soffer 2018-02-04 12:28:01 UTC
(In reply to Idan Shaby from comment #12)
> (In reply to Jan Zmeskal from comment #11)
> > That is unless we are talking about preallocated disk. Preallocated disks
> > have actual size always a bit greater than provisioned size, I guess because
> > of meta data.
> Correct
> > So now I jsut wonder what's the point of displaying "Percent
> > Used of Provisioned Size" for preallocated disks in CFME UI since it does
> > not reflect the actual usage of that storage.

This question should be answered by CFME developers.

> Well, you are right. In RHV, a preallocated disk on a file domain has an
> actual size that is equal to its virtual size.

raw disks on file based storage virtual size is the file size (st_size). 

The actual size is the number of bytes used by the file system (st_blocks * 512)
this number may be bigger then the file size.

Comment 14 Idan Shaby 2018-02-04 12:32:42 UTC
Closing, please feel free to ask if you have any further questions.

Comment 15 Jan Zmeskal 2018-02-05 08:16:45 UTC
(In reply to Idan Shaby from comment #14)
> Closing, please feel free to ask if you have any further questions.

Hi Idan, just wanted to thank you for your looking into this and for your explanations.

Comment 16 Idan Shaby 2018-02-05 08:25:15 UTC
No problem, happy to help!


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