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.
# Single commandmayacli [flags] <command> <object> [args...]
# Interactive modemayacli [flags]mayacli> show volume| Flag | Description |
|---|---|
-h hostname | Connect to a remote server |
-f | Force mode |
-j | JSON/CGI output mode |
-s | Suppress headers and decorative output |
-v | Print version |
-t timeout | RPC timeout in seconds |
Commands
Section titled “Commands”| Command | Description |
|---|---|
show | Display object settings |
create | Create a new object |
set | Modify object settings |
delete | Delete an object |
bind | Activate / apply settings (export a share, start a service) |
unbind | Deactivate / revoke settings (unexport a share, stop a service) |
start | Start an operation |
stop | Stop an operation |
save | Persist configuration to disk |
Keywords are case-insensitive and support partial matching. The wildcard * matches all objects.
Objects
Section titled “Objects”| Object | Description |
|---|---|
cloud | Cloud storage accounts and buckets |
zpool | ZFS storage pools |
volume | Volumes (ZVOLs, filesystems, block devices) |
mapping | Volume-to-controller mappings (NFS, SMB, iSCSI, NVMe-oF) |
snapshot | Snapshot management and policies |
replication | Replication pairs and schedules |
failover | High-availability clustering |
host | Application servers (iSCSI/NVMe-oF clients) |
iscsi | iSCSI targets, portals, sessions |
nvmet | NVMe-oF targets, portals, sessions |
disk | Physical and cloud disks |
controller | Storage controllers (Ethernet, FC, InfiniBand) |
creds | Local users and groups |
mayastor | Server configuration |
stats | Volume/controller statistics |
perf | Performance metrics |
rg | Software RAID groups |
vg | LVM volume groups |
license | Product licensing |
tape | Virtual tape devices |
vtl | Virtual 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:
mayacli create cloud proj-devops s3type=azure accesskey=testdev:FIzTY4AB3deaBcpOo1278===mayacli show cloud proj-devops type=listmayacli show cloud proj-devops type=size bucket=vault1mayacli delete cloud disk=mys3testdiskmayacli delete cloud proj-devops bucket=testbucketManage 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:
mayacli show diskmayacli create disk cloud_disk1 cloud=mys3account bucket=zettatest-blobdisk-13 cachefile=blobdisk-13 size=40g blocksize=1024Kmayacli set disk locate=1 /dev/sdamayacli delete disk cloud_disk1Manage 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:
mayacli create zpool tank raidlevel=raidz2 disk=/dev/sda disk=/dev/sdb disk=/dev/sdcmayacli show zpool tankmayacli set zpool tank scrub=yesmayacli set zpool tank discard=1mayacli bind zpool tank disk=/dev/nvme3n1mayacli zpool import tankvolume
Section titled “volume”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:
mayacli create volume testvol disk=/dev/sdamayacli create volume testvol vg=vgtest size=200Gmayacli create volume export1 filesys=zfs pathname=/tank/data zp=tankmayacli create volume snap_test snapshotof=testvol size=20Gmayacli set volume testvol size=400Gmayacli show volumemayacli delete volume testvolmapping
Section titled “mapping”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:
mayacli create mapping testvol controller=fc1 lun=0mayacli create mapping testvol controller=iscsi lun=0 access=appserv1mayacli create mapping testvol controller=nvmet targetid=1 lun=1 nodename=nqn.2017-08.com.zettalane:storage.node1 access=appserv1mayacli create mapping testvol controller=nfs3 options='"*(rw,sync)"'mayacli create mapping testvol controller=smbmayacli bind mapping testvolmayacli unbind mapping testvolmayacli delete mapping testvol controller=iscsisnapshot
Section titled “snapshot”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:
mayacli create snapshot snapshotof=tank/datamayacli show snapshot tank/datamayacli set snapshot tank/data interval=daily period=1 keep=7mayacli set snapshot tank/data interval=frequent period=15 keep=4mayacli set snapshot tank/data interval=nonemayacli snapshot rollback tank/data@snap-2024-01-15mayacli snapshot copy tank/data@snap-2024-01-15 backup/datamayacli delete snapshot tank/data@snap-2024-01-15replication
Section titled “replication”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 replicationunbind replication [volName] # Stop replicationset replication <volName> interval=<none|frequent|hourly|daily|monthly> [period=<integer>] [keep=<integer>] [offset=<integer>]set replication <volName> [groupTag=<string>]show replication [<volName>]Examples:
mayacli create replication sql_vol remote=server2:sql_vol_mirror type=snapshotmayacli create replication tank/data remote=server2:tank/data type=sync controller=eth1 syncrate=50mayacli show replicationmayacli bind replication tank/datamayacli unbind replication tank/datamayacli set replication tank/data interval=daily period=3 keep=8mayacli delete replication tank/datafailover
Section titled “failover”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 failoverdelete failoverbind failover # Start failover serviceunbind failover # Stop failover servicestandby failover # Release all resourcestakeover failover [local|all|foreign|failback]Examples:
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 failovermayacli bind failovermayacli unbind failovermayacli failover standbymayacli failover takeovermayacli failover takeover failbackmayacli delete failoverDefine 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:
mayacli create host xchgserv wwn=0a0b0c102030mayacli create host dbserver iscsiname=iqn.2024-01.com.example:dbserver ipaddress=10.0.1.50mayacli create host appserver nqn=nqn.2024-01.com.example:appserver ipaddress=10.0.1.51mayacli show hostmayacli delete host dbserverManage 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:
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,2mayacli show iscsimayacli show iscsi targetsmayacli show iscsi sessionsmayacli show iscsi connectionsmayacli delete iscsi nodename=iqn.2017-08.com.zettalane:storage.node1mayacli delete iscsi portalgroup=1Manage 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:
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,2mayacli show nvmetmayacli show nvmet targetsmayacli show nvmet sessionsmayacli delete nvmet nodename=nqn.2017-08.com.zettalane:storage.node1mayacli delete nvmet portalgroup=1Manage 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 groupunbind creds <user> group=<group> # Remove user from groupExamples:
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=secret123mayacli create creds smbuser2 type=user samba=yes passwordmayacli create creds developers type=group gid=2001mayacli set creds jdoe shell=/bin/zshmayacli set creds smbuser password=newsecret samba=yesmayacli bind creds jdoe group=developersmayacli unbind creds jdoe group=developersmayacli show creds type=usermayacli show creds type=groupmayacli delete creds jdoecontroller
Section titled “controller”View storage controllers (read-only).
show controller [<label>]Additional Objects
Section titled “Additional Objects”stats / perf
Section titled “stats / perf”mayacli show stats # Volume/controller statisticsmayacli show perf # Performance metricsrg (RAID Groups)
Section titled “rg (RAID Groups)”mayacli create rg <name> level=<raid-level> disk=<dev> ...mayacli show rg [<name>]mayacli delete rg <name>vg (LVM Volume Groups)
Section titled “vg (LVM Volume Groups)”mayacli create vg <name> disk=<dev> ...mayacli show vg [<name>]mayacli delete vg <name>license
Section titled “license”mayacli show licensemayacli set license key=<license-key>