Size units are ambiguous in blockstorage createVolume API documentation

Bug #1456631 reported by Richard Wall
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openstack-api-site
Fix Released
Medium
Diane Fleming
openstack-manuals
Fix Released
Medium
Diane Fleming

Bug Description

The documentation says size in GBs
 * http://developer.openstack.org/api-ref-blockstorage-v2.html#createVolume

```
The size of the volume, in GBs.
```

But the implementations (that I've looked at) seem to interpret the supplied size as GiB

 * http://bazaar.launchpad.net/~cinder-coresec/cinder/github/view/head:/cinder/volume/flows/api/create_volume.py#L35

```
GB = units.Gi
```

 * http://git.openstack.org/cgit/openstack/oslo.utils/tree/oslo_utils/units.py#n23

```
Gi = 1024 ** 3
```

Eg

 * The LVM driver appends `g` to the size

http://bazaar.launchpad.net/~cinder-coresec/cinder/github/view/head:/cinder/volume/drivers/lvm.py#L101

Which is interpreted by LVM as GiB...according to the `lvs` documentation

http://linux.die.net/man/8/lvs

```
--units hHbBsSkKmMgGtTpPeE
    All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.) instead of 1024. Can also specify custom units e.g. --units 3M
```

There is a related LVM documentation bug here:
 * https://bugs.launchpad.net/ubuntu/+source/lvm2/+bug/1083680

This is causing failures in our tests against Rackspace OpenStack, because we convert our `Byte` sizes to `GB` rather than `GiB`

 * https://github.com/ClusterHQ/flocker/pull/1419#issuecomment-103441866

Changed in openstack-api-site:
assignee: nobody → Diane Fleming (diane-fleming)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to api-site (master)

Fix proposed to branch: master
Review: https://review.openstack.org/184405

Changed in openstack-api-site:
status: Confirmed → In Progress
Revision history for this message
Diane Fleming (diane-fleming) wrote :
Changed in openstack-manuals:
assignee: nobody → Diane Fleming (diane-fleming)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-manuals (master)

Fix proposed to branch: master
Review: https://review.openstack.org/184406

Changed in openstack-manuals:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to api-site (master)

Reviewed: https://review.openstack.org/184405
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=b32caadc5dc500b04ee19fe9572a9205ec3ab903
Submitter: Jenkins
Branch: master

commit b32caadc5dc500b04ee19fe9572a9205ec3ab903
Author: Diane Fleming <email address hidden>
Date: Tue May 19 21:34:33 2015 -0500

    Update volume size from GB to GiB

    Change-Id: I090b9a3d46511061811bdaffda219a662497b61f
    Partial-Bug: #1456631

Changed in openstack-manuals:
assignee: Diane Fleming (diane-fleming) → Andreas Jaeger (jaegerandi)
Changed in openstack-manuals:
assignee: Andreas Jaeger (jaegerandi) → Diane Fleming (diane-fleming)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-manuals (master)

Reviewed: https://review.openstack.org/184406
Committed: https://git.openstack.org/cgit/openstack/openstack-manuals/commit/?id=9f3d13715a30746a495ee4abaf52c0854e9ecae3
Submitter: Jenkins
Branch: master

commit 9f3d13715a30746a495ee4abaf52c0854e9ecae3
Author: Diane Fleming <email address hidden>
Date: Tue May 19 21:51:46 2015 -0500

    Change GB to GiB for volume creation

    Change-Id: Ice7dd127a12ce453454808043af6ba34996e3a21
    Closes-Bug: #1456631

Changed in openstack-manuals:
status: In Progress → Fix Released
Revision history for this message
Richard Wall (richardw) wrote :

Another complication is that some cinder drivers appear to over allocate when the storage backend is only capable of allocating space in fixed intervals of > 1GiB.

For example,

After requesting a 100 GiB volume via `nova volume-create 100` and attaching it to my instance, `lsblk` now reports

```
[centos@clusterhq-flocker-buildslave ~]$ sudo lsblk --bytes --output SIZE /dev/vdb
        SIZE
111669149696

```

Which is exactly 104 GiB

```
In [12]: Byte(111669149696).to_GiB()
Out[12]: GiB(104.0)
```

Which makes me think that GB vs GiB is less important than I thought.
Telling people GB and actually creating GiB (or more) is just another form of over allocation, right?

One complication is that if I now fill this block device I might to be able to move the data to another 100 GiB cinder block device on another cinder platform....but that platform may have a different allocation interval and its 100 GiB volume may not have room.

Changed in openstack-api-site:
milestone: none → liberty
Changed in openstack-manuals:
milestone: none → liberty
Changed in openstack-api-site:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-manuals 15.0.0

This issue was fixed in the openstack/openstack-manuals 15.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.