Bug 1446375 - [RFE] New option for heketi volume naming
Summary: [RFE] New option for heketi volume naming
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: kubernetes
Version: rhgs-3.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: CNS 3.9
Assignee: Humble Chirammal
QA Contact: Rachael
URL:
Whiteboard:
Depends On:
Blocks: 1526413
TreeView+ depends on / blocked
 
Reported: 2017-04-27 19:00 UTC by Cal Calhoun
Modified: 2023-09-15 00:01 UTC (History)
12 users (show)

Fixed In Version: 3.9.0-0.36.0.git.0.8f8b69d
Doc Type: Enhancement
Doc Text:
With this release, OpenShift supports a new option "volumenameprefix" in the storage class deployment. It provide a means to create custom volume names or at least custom volume name components for dynamically provisioned volumes. Sometimes, you may want to tell more about the purpose and contents of the volume by looking at its name. Hence, the request to support custom volume name components via persistent volume claims. When this option is specified in the PVC, the volume name will be of the form "<volumenameprefix>_<pvc-namespace>_<pvc-name>_<uuid>". This allows filtering of dynamically provisioned PVs based on any of volumenameprefix, pvc name or project/namespace name. By default, volumes created through the glusterfs dynamic provisioner will have an automatically created name in the following format: vol_<UUID>.
Clone Of:
Environment:
Last Closed: 2018-04-05 05:12:31 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1447684 0 unspecified CLOSED gluster-swift cannot use volume names having underscore 2021-06-10 12:16:25 UTC
Red Hat Product Errata RHEA-2018:0645 0 None None None 2018-04-05 05:12:58 UTC

Internal Links: 1447684

Description Cal Calhoun 2017-04-27 19:00:39 UTC
When an Openshift Glusterfs provisioner asks for a new volume from Heketi, volumes are created with a naming convention of “vol_<UUID>” to ensure unique volume names.

Managing hundreds of volumes with 'random' names makes gluster management and monitoring very problematic.  Additionally, the "_" underscore in a volume name results in those volumes not being exportable via Gluster Swift.

This request is to enable custom naming via a Storage Class parameter similar to:

userFriendlyNames:  "yes" 

If set, we can create volumes with a name built up of: "<OC-namespace>-<UUID>-<OC-PVCname>" (no use of underscores)

It would be desirable if brick names belonging to that volume could inherit same naming format.

Humble Chirammal kindly requested this RFE be assigned to him.

This RFE is for an important Gluster opportunity and Sergi Jimenez Romero is the TAM for the account.

Comment 9 Luis Rico 2017-05-03 16:32:32 UTC
Humble, 
Volumes with underscores in names cannot be exported through Gluster Swift, this is a well known limitation, documented in our admin guide: 
https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.2/html-single/administration_guide/#Limitations4 
Please, it would be very desirable to avoid underscores in volume names, as spoken. Is it not possible to use dash "-" as separator for proposed volume name: <namespace>-<UUID>-<pvcname> ?
Thanks, Luis

Comment 10 Humble Chirammal 2017-05-04 10:56:15 UTC
(In reply to Luis Rico from comment #9)
> Humble, 
> Volumes with underscores in names cannot be exported through Gluster Swift,
> this is a well known limitation, documented in our admin guide: 
> https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.2/
> html-single/administration_guide/#Limitations4 
> Please, it would be very desirable to avoid underscores in volume names, as
> spoken. Is it not possible to use dash "-" as separator for proposed volume
> name: <namespace>-<UUID>-<pvcname> ?
> Thanks, Luis

Ok. Let me give some context about the difficulty on implementing this. 

We definitely need UUID in the volume name and this UUID need to be fetched at time of volume deletion. If we form <namespace/pvc>-<UUID>-<pvc/namespace> pattern we are kind of giving the control to user to define the volume name. The problem with this approach is that, the user can define any name for pvc/namespace which contains "-" in it.

For eg, 'claim-12345' is a valid PVC name [1]. so, this cause problems later when we fetch the volume UUID based on delimiter "-" and we may end up in wrong UUID fetch.  However "_" is not allowed by RFC in these names. So, if we depend on "_"  as a seperator we are safe. 

[1]  a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Comment 11 Luis Rico 2017-05-05 21:24:25 UTC
I could think of more char separators to avoid using underscore as separator, but not sure what are the rules or regex for Gluster Volume names.
In the other hand, I also don't know if the limitation of volume names with underscores in Gluster Swift is easier to fix than using a strange char separator for volume names generated from OCP-Heketi.
Could we use a double hyphen/dash "--" as separator or I'm saying something stupid?

Comment 20 Sergi Jimenez Romero 2018-01-12 19:51:02 UTC
Hi Humble!

any update you could share with us on this one? Thanks.

Comment 21 Humble Chirammal 2018-01-15 05:32:38 UTC
(In reply to Sergi Jimenez Romero from comment #20)
> Hi Humble!
> 
> any update you could share with us on this one? Thanks.

Yeah :), You are right on time! Friday the patch for custom volume name got merged in upstream. Now the volume names can be prefixed with your preferred string from storage class. I will give some more pointer on next bz update.

Comment 22 Humble Chirammal 2018-01-17 10:37:01 UTC
To document it: 

You can add a parameter called "volumenameprefix" in SC 

for ex:
  volumenameprefix: "dept-dev"


If `volumenameprefix` storageclass parameter is set, the dynamically provisioned volumes are created in below format where `_` is the field seperator/delimiter:

`customvolumeprefix_PVCname_randomUUID`

Please note that, the value for this parameter cannot contain `_` in storageclass. This is an optional parameter. If not specified heketi will create volumes as it did till now.

Comment 23 Luis Rico 2018-01-18 15:40:01 UTC
(In reply to Humble Chirammal from comment #22)
> To document it: 
> 
> You can add a parameter called "volumenameprefix" in SC 
> 
> for ex:
>   volumenameprefix: "dept-dev"
> 
> 
> If `volumenameprefix` storageclass parameter is set, the dynamically
> provisioned volumes are created in below format where `_` is the field
> seperator/delimiter:
> 
> `customvolumeprefix_PVCname_randomUUID`
> 
> Please note that, the value for this parameter cannot contain `_` in
> storageclass. This is an optional parameter. If not specified heketi will
> create volumes as it did till now.

Hi Humble, 
Thanks for the good news!
When we spoke at the beginning of this RFE, we were speaking about using NameSpaceName_PVCname part of the Gluster volume name. 
As different NameSpaces/Projects can have same PVCnames, it could be useful the ability to differentiate from which namespace the PVC comes.
Having a volumenameprefix at SC level doesn't help for that... only to know if this is coming, i.e. for CNS-Gold or CNS-Silver (or dev or prod as you example).
Please, is that still possible?
Thanks 
Luis

Comment 26 Humble Chirammal 2018-01-24 09:49:44 UTC
(In reply to Luis Rico from comment #23)
> (In reply to Humble Chirammal from comment #22)
> > To document it: 
> > 
> > You can add a parameter called "volumenameprefix" in SC 
> > 
> > for ex:
> >   volumenameprefix: "dept-dev"
> > 
> > 
> > If `volumenameprefix` storageclass parameter is set, the dynamically
> > provisioned volumes are created in below format where `_` is the field
> > seperator/delimiter:
> > 
> > `customvolumeprefix_PVCname_randomUUID`
> > 
> > Please note that, the value for this parameter cannot contain `_` in
> > storageclass. This is an optional parameter. If not specified heketi will
> > create volumes as it did till now.
> 
> Hi Humble, 
> Thanks for the good news!
> When we spoke at the beginning of this RFE, we were speaking about using
> NameSpaceName_PVCname part of the Gluster volume name. 
> As different NameSpaces/Projects can have same PVCnames, it could be useful
> the ability to differentiate from which namespace the PVC comes.
> Having a volumenameprefix at SC level doesn't help for that... only to know
> if this is coming, i.e. for CNS-Gold or CNS-Silver (or dev or prod as you
> example).
> Please, is that still possible?

Some more thoughts here, yes, however I kind of 'masked' namespace in volume name considering 2 things.

*) The volume name becomes more lenghty
*) if SC is dedicated for a namespace or if they want they can use 'volumenameprefix" with SC name or namespace name.  I understand SC is a global thing though. 

Regardless, I have added `namespace` to above option as requested here:

So, volumename becomes:

`volumenameprefix`_namespace_pvcname_uuid`


I hope this is what we want !! 


`volumenameprefix` is the only string which is 'given' for admin ( which is a must to trigger custom volume name) and they can fill any value for it, rest are automatically filled. 

I hope it close this RFE as you requested!

Please share your thought if any.

Comment 27 Humble Chirammal 2018-02-01 11:40:09 UTC
Origin 3.9 PR # https://github.com/openshift/origin/pull/18326

Comment 28 Humble Chirammal 2018-02-01 11:41:04 UTC
The Origin 3.9 PR was merged yesterday!

Comment 29 Sergi Jimenez Romero 2018-02-01 11:46:40 UTC
(In reply to Humble Chirammal from comment #28)
> The Origin 3.9 PR was merged yesterday!

Thanks Humble!

Comment 33 Rachael 2018-03-14 09:24:04 UTC
 A complete round of tests were performed on the new feature and the basic functionality works as expected.

Hence moving to verified.

Comment 37 errata-xmlrpc 2018-04-05 05:12:31 UTC
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.

https://access.redhat.com/errata/RHEA-2018:0645

Comment 38 Red Hat Bugzilla 2023-09-15 00:01:59 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


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