disk setlabel

Adds a label to disks or a storage pool. Permissions required: fc or a.

Syntax

CLI
maprcli disk setlabel
  -host name/ip 
  -disks comma-separated list of disks 
  -label label-name 
[ -force Need this parameter to reassign label to sp, otherwise reassignment of label 
         will not happen on sp. Parameter takes no value]
REST
Request Type POST
Request URL
http[s]://<host>:<port>/rest/disk/setlabel?<parameters> 

Parameters

Parameter: host (Required)
Default Value: No default value
Possible Values: Any valid host or IP
Description: The hostname or IP address of the machine on which to set the label.
Parameter: disks (Required)
Default Value: No default value
Possible Values: Any valid disk names
Description: A comma-separated list of disk names. Examples:
  • /dev/sdc
  • /dev/sdd,/dev/sde,/dev/sdf
Parameter: label (Required)
Default Value: HDD
Possible Values: Any label
Description: The label to use for the storage pool. See Using Storage Labels for more information on labels.
The label should contain only the following characters:
A-Z a-z 0-9 _ - .
Parameter: force (Optional)
Default Value: Not Applicable
Possible Values: Not Applicable
Description: Forces reassignment of the label to a storage pool.

Output

# maprcli disk setlabel -host atsqa4-161.qa.lab -disks /dev/sdd -label label1 -json
             {
             "timestamp":1590420155635,
             "timeofday":"2020-05-25 08:22:35.635 GMT-0700 AM",
             "status":"OK",
             "total":0,
             "data":[        ]
             }        

Examples

Set label label1 on disk /dev/sdd:

# maprcli disk setlabel -host atsqa4-161.qa.lab -disks /dev/sdd -label label1 -json
{
        "timestamp":1590420155635,
        "timeofday":"2020-05-25 08:22:35.635 GMT-0700 AM",
        "status":"OK",
        "total":0,
        "data":[        ]
}
NOTE
When using a self-signed certificate, pass the -k option to curl to avoid the certificate check.
curl -k -u <username> -X POST https://abc.sj.us:8443/rest/disk/setlabel?host="atsqa4-161.qa.lab"&disks=["/dev/sdd"]&label="label1"