gluster-block(8)

NAME
gluster-block - Gluster Block Storage Console Manager (command line utility)

SYNOPSIS
gluster-block [timeout <seconds>] <create|list|info|delete|modify|replace|genconfig> <volname[/blockname]> [<args>] [--json*]

DESCRIPTION
The Gluster Block Storage Console Manager(gluster-block) is a CLI utility, which aims at making gluster backed block storage creation and maintenance as simple as possible. Note that the gluster-blockd daemon is responsible for block management, hence the daemon must be running on all servers.

COMMANDS

  create <VOLNAME/NEW-BLOCKNAME> [ha <COUNT>] [auth <enable|disable>] [prealloc <full|no>] [storage <filename>] [ring-buffer <size-in-MB-units>] <HOST1[,HOST2,..]> [BYTES]
create block device.

[ha <COUNT>]
    multipath requirement for high availability (default: 1)

[auth <enable|disable>]
    authentication setting (default: disable)

[prealloc <full|no>]
    "full" mode preallocates space by writing zeros to storage (default: full)

[storage <filename>]
    existing file(only name) in the gluster volume, that needs to be linked while creating block (default: creates a new file)

[ring-buffer <size-in-MB-units>]
    kernel ring buffer size for exchanging iSCSI commands, range [1MB - 64MB] (default: as per kernel)

<HOST1,[HOST2....]>
    servers in the pool where targets will be exported

[BYTES]
    size in B|KiB|MiB|GiB|TiB|PiB ... (default: bytes)

  list <VOLNAME>
list available block devices.

  info <VOLNAME/BLOCKNAME>
details about block device.

  delete <VOLNAME/BLOCKNAME> [unlink-storage <yes|no>] [force]
delete block device.

[unlink-storage <yes|no>]
    unlink the backend file from gluster volume (default: yes)

  modify <VOLNAME/BLOCKNAME> [<auth enable|disable>] [size <size>] [force]
modify block device.

[<auth enable|disable>]
    modify authentication on the device

[size <size>]
    modify size of the device

  replace <VOLNAME/BLOCKNAME> <old-node> <new-node> [force]
replace block device.

  genconfig <VOLNAME1[,VOLNAME2,VOLNAME3,...]> enable-tpg <host>
generate the block volumes target configuration.

enable-tpg <host>
    specify the active path node

  help
show help message and exit.

  version
show version info and exit.

COMMON CLI OPTIONS

  [timeout <seconds>]
it is the time in seconds that cli can wait for daemon to respond (default: 300)

  [--json*]
used to request the output result in json format (default: plain text) and supported JSON formats: --json|--json-plain|--json-spaced|--json-pretty

EXAMPLES
To create a block device of size 1GiB
# gluster-block create blockVol/sampleBlock ${HOST} 1GiB
To create a block device of size 1GiB with timeout 300 seconds
# gluster-block timeout 300 create blockVol/sampleBlock ${HOST} 1GiB
To create a block device of size 1GiB with auth enable
# gluster-block create blockVol/sampleBlock auth enable ${HOST} 1GiB
To create a block device of size 1GiB, by preallocating storage with zero fill
# gluster-block create blockVol/sampleBlock prealloc full ${HOST} 1GiB
To create a thinly-provisioned block device of size 1GiB
# gluster-block create blockVol/sampleBlock prealloc no ${HOST} 1GiB
To create a block device with existing file in blockVol
# gluster-block create blockVol/sampleBlock storage 3c242959-9238-4ce0-a1ed-19086aa23c7b ${HOST}
To create a block device with ring buffer size 16MB
# gluster-block create blockVol/sampleBlock ring-buffer 16 ${HOST} 1GiB
To create a block device of size 1GiB with multi-path(replica) 3
# gluster-block create blockVol/sampleBlock ha 3 ${HOST1},${HOST2},${HOST3} 1GiB
To create a block device of size 1GiB and expect response in json format
# gluster-block create blockVol/sampleBlock ${HOST} 1GiB --json
You can pass more no. of nodes than ha count, this will actually help create in recovering from
failures, incase creation of block fails on any of scheduled(always first in list) ha count nodes.
# gluster-block create blockVol/sampleBlock ha 3 ${HOST1},${HOST2},${HOST3},${HOST4},${HOST5} 1GiB
To disable auth on a block device
# gluster-block modify blockVol/sampleBlock auth disable
To enable auth on a block device
# gluster-block modify blockVol/sampleBlock auth enable
To resize an existing block device sampleBlock of size 1GiB to new size 2GiB
# gluster-block modify blockVol/sampleBlock size 2GiB
To list available block devices
# gluster-block list blockVol
To get details of a block device
# gluster-block info blockVol/sampleBlock
To delete a block device
# gluster-block delete blockVol/sampleBlock
To delete a block device, but let backend file persist in blockVol(for later use)
# gluster-block delete blockVol/sampleBlock unlink-storage no
To replace a block device from ${NODE1} to ${NODE2}
# gluster-block replace blockVol/sampleBlock ${NODE1} ${NODE2}
To simply generate the block volumes target configuration.
# gluster-block genconfig blockVol1[,blockVol2,blockVol3,...] enable-tpg ${HOST} | tee new_saveconfig.json
To generate the block volumes target configuration and load it
# mv /etc/target/saveconfig.json /etc/target/saveconfig.json.bak
# gluster-block genconfig blockVol1[,blockVol2,blockVol3,...] enable-tpg ${HOST} | tee /etc/target/saveconfig.json
# systemctl restart gluster-blockd tcmu-runner

FILES
/var/log/gluster-block/*
/var/run/gluster-block.socket
/var/run/gluster-block.lock
/etc/sysconfig/gluster-blockd
/etc/logrotate.d/gluster-blockd

REPORTING BUGS
Report bugs via gluster-devel <gluster-devel@gluster.org
or <https://github.com/gluster/gluster-block/issues>

AUTHOR
Prasanna Kumar Kalever <prasanna.kalever@redhat.com>

THANKS
Vijay Bellur <vbellur@redhat.com>
Pranith Kumar Karampuri <pkarampu@redhat.com>

SEE ALSO
gluster-blockd(8), targetcli(8), tcmu-runner(8), glusterfs(8), glusterd(8), gluster(8)

COPYRIGHT
Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>