Skip to content

CLI Guide (mayacli)

mayacli is a lightweight RPC client for managing MayaNAS and MayaScale storage servers. It can run interactively or execute single commands from the shell.

Terminal window
# Single command
mayacli [flags] <command> <object> [args...]
# Interactive mode
mayacli [flags]
mayacli> show volume
FlagDescription
-h hostnameConnect to a remote server
-fForce mode
-jJSON/CGI output mode
-sSuppress headers and decorative output
-vPrint version
-t timeoutRPC timeout in seconds
CommandDescription
showDisplay object settings
createCreate a new object
setModify object settings
deleteDelete an object
bindActivate / apply settings (export a share, start a service)
unbindDeactivate / revoke settings (unexport a share, stop a service)
startStart an operation
stopStop an operation
savePersist configuration to disk

Keywords are case-insensitive and support partial matching. The wildcard * matches all objects.

ObjectDescription
cloudCloud storage accounts and buckets
zpoolZFS storage pools
volumeVolumes (ZVOLs, filesystems, block devices)
mappingVolume-to-controller mappings (NFS, SMB, iSCSI, NVMe-oF)
snapshotSnapshot management and policies
replicationReplication pairs and schedules
failoverHigh-availability clustering
hostApplication servers (iSCSI/NVMe-oF clients)
iscsiiSCSI targets, portals, sessions
nvmetNVMe-oF targets, portals, sessions
diskPhysical and cloud disks
controllerStorage controllers (Ethernet, FC, InfiniBand)
credsLocal users and groups
mayastorServer configuration
statsVolume/controller statistics
perfPerformance metrics
rgSoftware RAID groups
vgLVM volume groups
licenseProduct licensing
tapeVirtual tape devices
vtlVirtual tape library

Manage cloud storage accounts (GCS, S3, Azure Blob).

show cloud <name> [bucket=<name> type=size] [type=list]
create cloud [label=]<name> [s3type=aws|amazon|azure|google]
accesskey=<ID:Secret> [region=<name>] [project=<name>]
[baseurl=<base-url>]
delete cloud <name> [disk=<s3disk>] | [bucket=<name>]
set cloud [label=]<name> [accesskey=<ID:Secret>] [region=<name>]
[baseurl=<base-url>]

Examples:

Terminal window
mayacli create cloud proj-devops s3type=azure accesskey=testdev:FIzTY4AB3deaBcpOo1278===
mayacli show cloud proj-devops type=list
mayacli show cloud proj-devops type=size bucket=vault1
mayacli delete cloud disk=mys3testdisk
mayacli delete cloud proj-devops bucket=testbucket

Manage physical and cloud-backed disks.

show disk [<devname>|*|all]
create disk <cloud-disk-name> cloud=<cloud-label>
size=<size>[kKmMgGtT] blocksize=<size>[KM]
[bucket=<name>] [cachefile=<path>] [loopdev=<dev>]
[clusterid=<num>]
set disk locate=[0|1]|power_status=[on|off]|fault=[0|1] <devname>
set disk disk=<cloud-disk> online=[0|1] [loopdev=yes|no|loopX]
delete disk <devname>

Examples:

Terminal window
mayacli show disk
mayacli create disk cloud_disk1 cloud=mys3account bucket=zettatest-blobdisk-13 cachefile=blobdisk-13 size=40g blocksize=1024K
mayacli set disk locate=1 /dev/sda
mayacli delete disk cloud_disk1

Manage ZFS storage pools.

create zpool [label=]<poolname> [description=<text>] [force=1|0]
[raidlevel=mirror|raidz|raidz1|raidz2]
[options="<zpool-opts>"]
(disk=<device>) ...
[logdevice=<dev>] [cachedevice=<dev>]
[sparedevice=<dev>] [special=<dev>]
show zpool [<poolname>]
bind zpool <poolname> (disk=<device>) ...
unbind zpool <poolname> (disk=<device>) ...
set zpool <poolname> [[online=yes|no] | [discard=1|0] |
[replace=<disk>] | [scrub=yes|no]]
[disk=<device>] [writeprotect=yes|no]
delete zpool <poolname>

Additional: zpool import <poolname> [force=1]

Examples:

Terminal window
mayacli create zpool tank raidlevel=raidz2 disk=/dev/sda disk=/dev/sdb disk=/dev/sdc
mayacli show zpool tank
mayacli set zpool tank scrub=yes
mayacli set zpool tank discard=1
mayacli bind zpool tank disk=/dev/nvme3n1
mayacli zpool import tank

Manage volumes (block devices, filesystems, ZVOLs, LVM, snapshots).

create volume [label=]<volname> disk=<device> [size=<size>[kKmMgGtT]]
create volume [label=]<volname> vg=<vg-name>|snapshotof=<volname>
disk=<device> size=<size>[kKmMgGtT] [options=<lvopts>]
create volume [label=]<volname> filesys=xfs|ext4|zfs
pathname=<fs-path> [perm=<owner:group:mode>]
[acl=<acl-string>] [disk=<disk>] [zp=<pool>]
create volume [label=]<thinpool> thinpool=1 vg=<vg-name>
size=<size>[kKmMgGtT]
create volume [label=]<volname> thinpool=<thinpoolname>
size=<size>[kKmMgGtT]
delete volume [label=]<volname> [type=<voltype>] [uuid=<uuid>]
set volume <volname> [size|capacity=<size>[kKmMgGtT]]
[readAheadEnabled=boolean] [readAheadMulti=integer]
[readCacheEnabled=boolean] [writeCacheEnabled=boolean]
[readOnly|writeProtect=boolean]
show volume [[label=]<volname>]

Examples:

Terminal window
mayacli create volume testvol disk=/dev/sda
mayacli create volume testvol vg=vgtest size=200G
mayacli create volume export1 filesys=zfs pathname=/tank/data zp=tank
mayacli create volume snap_test snapshotof=testvol size=20G
mayacli set volume testvol size=400G
mayacli show volume
mayacli delete volume testvol

Map volumes to controllers (NFS, SMB, iSCSI, NVMe-oF, Fibre Channel).

create mapping [volume=]<volname> [controller=fc<n>]
[lun=<lun>|auto] [access=<host>] [clusterid=<num>]
create mapping [volume=]<volname> [controller=iscsi]
[lun=<lun>|auto] [targetid=<num>
nodename=<iscsi-iqn>] [access=<host>]
[clusterid=<num>] [bind=boolean]
create mapping [volume=]<volname> [controller=nvmet]
[lun=<lun>|auto] [targetid|port=<num>
nodename=<nvme-nqn>] [access=<host>]
[clusterid=<num>] [bind=boolean]
create mapping [volume=]<volname> [controller=nfs3]
[options="<nfs-export-options>"]
create mapping [volume=]<volname> [controller=smb]
[options="<smb-export-options>"]
delete mapping [volume=]<volname>
[controller=fc<n>|iscsi|nvmet|nfs|smb]
delete mapping *
bind mapping [volume=]<volname>
[controller=fc<n>|iscsi|nvmet] [force=boolean]
unbind mapping [volume=]<volname>
[controller=fc<n>|iscsi|nvmet] [force=boolean]
show mapping [volume=<volname>] [controller=<type>]
[clusterid=<num>]

Examples:

Terminal window
mayacli create mapping testvol controller=fc1 lun=0
mayacli create mapping testvol controller=iscsi lun=0 access=appserv1
mayacli create mapping testvol controller=nvmet targetid=1 lun=1 nodename=nqn.2017-08.com.zettalane:storage.node1 access=appserv1
mayacli create mapping testvol controller=nfs3 options='"*(rw,sync)"'
mayacli create mapping testvol controller=smb
mayacli bind mapping testvol
mayacli unbind mapping testvol
mayacli delete mapping testvol controller=iscsi

Manage snapshots and snapshot policies.

create snapshot snapshotof=<volName> [size=<size>[kKmMgGtT]]
[options=<lvCreateOptions>]
delete snapshot <snapName>|<volName>
set snapshot <volName> interval=<none|frequent|hourly|daily|monthly>
[period=<integer>] [keep=<integer>] [offset=<integer>]
set snapshot <volName> [groupTag=<string>]
set snapshot <snapName> [size|capacity=<size>[kKmMgGtT]]
show snapshot [<volName>|<snapName>]
rollback snapshot <snapName>
copy snapshot <snapName> <destVolName>|<device>
reset snapshot [volName] | [snapName]

Examples:

Terminal window
mayacli create snapshot snapshotof=tank/data
mayacli show snapshot tank/data
mayacli set snapshot tank/data interval=daily period=1 keep=7
mayacli set snapshot tank/data interval=frequent period=15 keep=4
mayacli set snapshot tank/data interval=none
mayacli snapshot rollback tank/data@snap-2024-01-15
mayacli snapshot copy tank/data@snap-2024-01-15 backup/data
mayacli delete snapshot tank/data@snap-2024-01-15

Manage replication pairs and schedules.

create replication <volName> remote=<server:volName>
type=async|async-safe|sync|snapshot
[controller=<eth-interface>]
[syncrate=<rate-percent>]
[options=<repliOptions>]
delete replication <volName>
bind replication [volName] # Start replication
unbind replication [volName] # Stop replication
set replication <volName>
interval=<none|frequent|hourly|daily|monthly>
[period=<integer>] [keep=<integer>] [offset=<integer>]
set replication <volName> [groupTag=<string>]
show replication [<volName>]

Examples:

Terminal window
mayacli create replication sql_vol remote=server2:sql_vol_mirror type=snapshot
mayacli create replication tank/data remote=server2:tank/data type=sync controller=eth1 syncrate=50
mayacli show replication
mayacli bind replication tank/data
mayacli unbind replication tank/data
mayacli set replication tank/data interval=daily period=3 keep=8
mayacli delete replication tank/data

Manage high-availability clustering.

create failover node=<node1,node2>
options="[keepalive=<msecs>] [initdead=<secs>]
clusterid=<num1[,num2]>
ipaddress=<ipaddr1[,ipaddr2]>
hblink=<primary-if><standbyIP>:<secondary-if><primaryIP>[,..]"
show failover
delete failover
bind failover # Start failover service
unbind failover # Stop failover service
standby failover # Release all resources
takeover failover [local|all|foreign|failback]

Examples:

Terminal window
mayacli create failover node=server1.local,server2.local options="clusterid=3 ipaddress=10.1.1.111 hblink=eth0>10.1.1.101:eth0>10.1.1.100,eth1>192.168.100.101:eth1>192.168.100.100"
mayacli show failover
mayacli bind failover
mayacli unbind failover
mayacli failover standby
mayacli failover takeover
mayacli failover takeover failback
mayacli delete failover

Define application servers that consume storage.

create host [label=]<hostname> wwn|wwpn=<wwn-port-addr>
create host [label=]<hostname> [iscsiname=<iqn-or-eui>]
[ipaddress=<ipv4-addr>]
create host [label=]<hostname> [nqn|nvmename=<nqn>]
[ipaddress=<ipv4-addr>]
set host <hostname> [ipaddr=<ipv4>] [iscsiname=<iqn>]
[nvmename=<nqn>] [wwn=<wwn>]
delete host <hostname>
show host [<hostname>]

Examples:

Terminal window
mayacli create host xchgserv wwn=0a0b0c102030
mayacli create host dbserver iscsiname=iqn.2024-01.com.example:dbserver ipaddress=10.0.1.50
mayacli create host appserver nqn=nqn.2024-01.com.example:appserver ipaddress=10.0.1.51
mayacli show host
mayacli delete host dbserver

Manage iSCSI targets, portal groups, and sessions.

show iscsi [targets|sessions|connections|initiators|hosts]
create iscsi nodename=<iscsiname> [immediateData=1|0]
[user=<user> password=<pass>]
[portalGroup=<tpgt>[,..]]
create iscsi portalgroup=<tpgt> portal=<ipaddr>[ ...]
set iscsi nodename=<iscsiname> [user=<user> password=<pass>]
[portalGroup=<tpgt>[,..]]
delete iscsi nodename=<iscsiname>
delete iscsi portalgroup=<tpgt>

Examples:

Terminal window
mayacli create iscsi portalgroup=1 portal="10.1.1.91 10.1.1.95"
mayacli create iscsi portalgroup=2 portal="192.168.1.1 192.168.1.5"
mayacli create iscsi nodename=iqn.2017-08.com.zettalane:storage.node1 user=testuser password=testpass portalgroup=1,2
mayacli show iscsi
mayacli show iscsi targets
mayacli show iscsi sessions
mayacli show iscsi connections
mayacli delete iscsi nodename=iqn.2017-08.com.zettalane:storage.node1
mayacli delete iscsi portalgroup=1

Manage NVMe over Fabrics targets, portal groups, and sessions.

show nvmet [targets|sessions|connections|initiators|hosts]
create nvmet nodename|subsystem=<nqnName> [user=<user> password=<pass>]
[portalGroup=<tpgt>[,..]]
create nvmet portalgroup=<tpgt> portal=<ipaddr>[ ...]
set nvmet nodename=<nvmetname> [user=<user> password=<pass>]
[portalGroup=<tpgt>[,..]]
delete nvmet nodename=<nqnName>
delete nvmet portalgroup=<tpgt>

Examples:

Terminal window
mayacli create nvmet portalgroup=1 portal="10.1.1.91:4420"
mayacli create nvmet portalgroup=2 portal="192.168.1.1:4422"
mayacli create nvmet nodename=nqn.2017-08.com.zettalane:storage.node1 portalgroup=1,2
mayacli show nvmet
mayacli show nvmet targets
mayacli show nvmet sessions
mayacli delete nvmet nodename=nqn.2017-08.com.zettalane:storage.node1
mayacli delete nvmet portalgroup=1

Manage local Unix users and groups.

create creds [label=]<name> type=user [uid=<uid>] [gid=<gid>]
[home=<homedir>] [shell=<shell>] [gecos=<comment>]
[samba=yes|no] [password[=<password>]]
create creds [label=]<name> type=group [gid=<gid>]
set creds <name> [shell=<shell>] [home=<homedir>]
[gecos=<comment>] [gid=<gid>] [samba=yes|no]
[password[=<password>]]
show creds [<name>] [type=user|group] [uid=<uid>] [gid=<gid>]
delete creds <name> [type=user|group]
bind creds <user> group=<group> # Add user to group
unbind creds <user> group=<group> # Remove user from group

Examples:

Terminal window
mayacli create creds jdoe type=user uid=1001 gid=1001 home=/home/jdoe shell=/bin/bash gecos="John Doe"
mayacli create creds smbuser type=user samba=yes password=secret123
mayacli create creds smbuser2 type=user samba=yes password
mayacli create creds developers type=group gid=2001
mayacli set creds jdoe shell=/bin/zsh
mayacli set creds smbuser password=newsecret samba=yes
mayacli bind creds jdoe group=developers
mayacli unbind creds jdoe group=developers
mayacli show creds type=user
mayacli show creds type=group
mayacli delete creds jdoe

View storage controllers (read-only).

show controller [<label>]

Terminal window
mayacli show stats # Volume/controller statistics
mayacli show perf # Performance metrics
Terminal window
mayacli create rg <name> level=<raid-level> disk=<dev> ...
mayacli show rg [<name>]
mayacli delete rg <name>
Terminal window
mayacli create vg <name> disk=<dev> ...
mayacli show vg [<name>]
mayacli delete vg <name>
Terminal window
mayacli show license
mayacli set license key=<license-key>