Bug 1468882 - heketi allows to create block volumes exceeding the capacity of block hosting volume
heketi allows to create block volumes exceeding the capacity of block hosting...
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: heketi (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: CNS 3.6
Assigned To: Mohamed Ashiq
krishnaram Karthick
Depends On:
Blocks: 1445448
  Show dependency treegraph
Reported: 2017-07-09 06:43 EDT by krishnaram Karthick
Modified: 2018-03-15 14:23 EDT (History)
7 users (show)

See Also:
Fixed In Version: heketi-5.0.0-5 rhgs-volmanager-docker-3.3.0-7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-10-11 03:07:22 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:2879 normal SHIPPED_LIVE heketi bug fix and enhancement update 2017-10-11 07:07:06 EDT

  None (edit)
Description krishnaram Karthick 2017-07-09 06:43:46 EDT
Description of problem:

Block volume creation should fail when the total capacity of block hosting volume is exhausted.

For ex, when block hosting volume is 500 GB, the total size of all block devices that could be created should be limited to 500 GB and any attempt to create a block device over and above that mark should fail. 

Gluster allows to create block devices above the capacity of volume it is hosting on as only sparse files are created by default in gluster. so heketi cannot depend on gluster command to fail, rather the request to create block volume should not proceed from heketi to gluster if the capacity is exceeded.

[root@dhcp47-10 ~]# heketi-cli blockvolume create --size=480
Name: blockvol_be664f518291761bf14fd5741362b5b8
Size: 480
Volume Id: be664f518291761bf14fd5741362b5b8
Cluster Id: 6bed12159b987cf70338ac6d1d3d0720
Hosts: []
IQN: iqn.2016-12.org.gluster-block:15695855-a4ab-4f20-9670-6eb9901ba1a1
LUN: 0
Hacount: 3
Block Hosting Volume: 78dfd43a5abacb9e8365500d54d4f6e5

[root@dhcp47-10 ~]# heketi-cli blockvolume create --size=30
Name: blockvol_0ced9f74bb5cb6d364a35f2752603c6c
Size: 30
Volume Id: 0ced9f74bb5cb6d364a35f2752603c6c
Cluster Id: 6bed12159b987cf70338ac6d1d3d0720
Hosts: []
IQN: iqn.2016-12.org.gluster-block:cfa768eb-723a-4a30-8b41-fdc56dfab6a9
LUN: 0
Hacount: 3
Block Hosting Volume: 78dfd43a5abacb9e8365500d54d4f6e5
[root@dhcp47-10 ~]# heketi-cli blockvolume create --size=30
Name: blockvol_b7d4e9737f20d25f0b305a10dd519076
Size: 30
Volume Id: b7d4e9737f20d25f0b305a10dd519076
Cluster Id: 6bed12159b987cf70338ac6d1d3d0720
Hosts: []
IQN: iqn.2016-12.org.gluster-block:04a8d622-314d-49bf-80c4-28ad2137ded6
LUN: 0
Hacount: 3
Block Hosting Volume: 78dfd43a5abacb9e8365500d54d4f6e5

[root@dhcp47-10 ~]# heketi-cli blockvolume list
Id:0ced9f74bb5cb6d364a35f2752603c6c    Cluster:6bed12159b987cf70338ac6d1d3d0720    Name:blockvol_0ced9f74bb5cb6d364a35f2752603c6c
Id:a3b7006bde73028b651d7362f6ba78a1    Cluster:6bed12159b987cf70338ac6d1d3d0720    Name:blockvol_a3b7006bde73028b651d7362f6ba78a1
Id:b7d4e9737f20d25f0b305a10dd519076    Cluster:6bed12159b987cf70338ac6d1d3d0720    Name:blockvol_b7d4e9737f20d25f0b305a10dd519076
Id:be664f518291761bf14fd5741362b5b8    Cluster:6bed12159b987cf70338ac6d1d3d0720    Name:blockvol_be664f518291761bf14fd5741362b5b8
[root@dhcp47-10 ~]# heketi-cli volume list
Id:78dfd43a5abacb9e8365500d54d4f6e5    Cluster:6bed12159b987cf70338ac6d1d3d0720    Name:vol_78dfd43a5abacb9e8365500d54d4f6e5 [block]
Id:fee4f0b4b98d1c468d1ebac9ed5acd44    Cluster:6bed12159b987cf70338ac6d1d3d0720    Name:heketidbstorage

[root@dhcp47-10 ~]# heketi-cli volume info 78dfd43a5abacb9e8365500d54d4f6e5
Name: vol_78dfd43a5abacb9e8365500d54d4f6e5
Size: 500
Volume Id: 78dfd43a5abacb9e8365500d54d4f6e5
Cluster Id: 6bed12159b987cf70338ac6d1d3d0720
Mount Options: backup-volfile-servers=,
Block: true
Free Size: -50  ---->>> SIZE GONE NEGATIVE
Block Volumes: [0ced9f74bb5cb6d364a35f2752603c6c a3b7006bde73028b651d7362f6ba78a1 b7d4e9737f20d25f0b305a10dd519076 be664f518291761bf14fd5741362b5b8]
Durability Type: replicate
Distributed+Replica: 3

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1. create a block hosting device of 500GB
2. Try to create multiple block devices over above 500 GB mark

Actual results:
block vol creation succeeds oversubscribing from 500GB

Expected results:
block volume creation should fail

Additional info:
Comment 7 krishnaram Karthick 2017-09-01 12:08:21 EDT
Verified the fix in build - cns-deploy-5.0.0-25.el7rhgs.x86_64

Heketi now fails appropriately when a block device of size greater than that of block hosting volume is requested.

Access Modes:   
  FirstSeen     LastSeen        Count   From                                                            SubObjectPath   Type            Reason                  Message
  ---------     --------        -----   ----                                                            -------------   --------        ------                  -------
  11s           11s             1       gluster.org/glusterblock 695d0b4b-8ed9-11e7-be38-0a580a8100dd                   Normal          Provisioning            External provisioner is provisioning volume for claim "storage-project/test-04"
  10s           10s             1       gluster.org/glusterblock 695d0b4b-8ed9-11e7-be38-0a580a8100dd                   Warning         ProvisioningFailed      Failed to provision volume with StorageClass "glusterblockip": glusterblock: failed to create volume: [heketi] error creating volume No space
  11s           9s              3       persistentvolume-controller                                                     Normal          ExternalProvisioning    cannot find provisioner "gluster.org/glusterblock", expecting that a volume for the claim is provisioned either manually or via external software

Moving the bug to verified.
Comment 8 errata-xmlrpc 2017-10-11 03:07:22 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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