Downloads  |  Contact Us

Getting Started with Mayastor Storage Server

Table of Contents

Introduction
How to Install Mayastor Storage Server?
How to configure disk drives for Mayastor use?
How to Start Mayastor storage server?
How to Create Virtual Volumes?
How to Create Proxy Devices?
How to Map Virtual volumes?
How to Configure  Application Server?

Introduction

The Mayastor Storage server is a set of kernel drivers designed for Linux servers that provides enhanced disk services over Fibre Channel or IP based Storage Area Network (SAN).  It provides a simple to use command-line interface (CLI) mayacli for managing the storage server operation.

How to Install Mayastor Storage Server?

The software is available as standard Linux RPM distribution, which can be easily installed as follows.  Once you are logged in as root, type the follow command

# rpm -ivh mayastor-fc-iscsiPRO-1.0-8.i686.rpm

Note:
It maybe required to erase previous version of Mayastor before the installation.

After installation of Mayastor RPM the product has to be activated by providing the license information.  The license information consists of user name and license key.

# /etc/init.d/mayastor activate
User Name: Evaluation User
License Key: Enter your License key

How to configure Disk Drives for Mayastor use?

Mayastor supports creating virtual disks from several types of block devices available in the Linux server.  It can be just a physical disk, physical partition, Linux software raid disk, LVM volume, LVM snapshot volume and other block devices such as loop, dm-crypt devices.

For SCSI devices alone Mayastor provides proxy mode.   In this mode of operation Mayastor acts as fibre-channel/iSCSI to SCSI bridge.  It is mostly useful to add Fibre-channel or iSCSI protocol to legacy SCSI devices such as disk arrays and tape library or to share devices such as CD/DVD recorders.

Mayastor does not require any preparation work of writing proprietary format on the disks before they can be configured for operation.  However the disk should be made online before proceeding with the configuration.  For example If it is a LVM volume then it has be made active or if it is a Linux MD device then it has to be assembled by using mdadm command.

How to Start Mayastor storage server?

Mayastor is  automatically started by the standard Linux rc script startup mechanism in /etc/init.d/mayastor.  To manually start the services make use of the following command.

# /etc/init.d/mayastor start

How to Create Mayastor Virtual Volumes?

Identify the device name that will be used as Mayastor volume and the use the mayacli command-line interface to create the virtual volume.

Example 1:

If your storage server has a 3ware RAID disk identified as /dev/sda then issue the following command to create a single virtual volume.

# /opt/mayastor/bin/mayacli
mayacli> create volume label=myfirstvol disk=/dev/sda
mayacli> show volume
Configured Volumes:
Type: id = Individual Disk, bd = Block Device, raid = Software RAID,
lvm = LVM disk, snap = Snapshot Volume, vtape = Virtual Tape Volume,
crypt = Block level encrypted volume

Volume                           Type   Size      Device
-------------------------------- ------ --------- ------------------
myfirstvol                       bd      931.28G /dev/sda
mayacli> save volume

Example 2:

If your storage server has 6 disk drives from JBOD identified as devices /dev/sda ... /dev/sdf and wish to use Linux raid0 on them, then issue the following commands:

# mdadm -C -c 256 -l stripe -n 6 /dev/md0 /dev/sd[a-f]
mdadm: array /dev/md0 started.
# /opt/mayastor/bin/mayacli
mayacli> create volume myraidvol disk=/dev/md0
mayacli> show vol
Type: id = Individual Disk, bd = Block Device, raid = Software RAID,
lvm = LVM disk, snap = Snapshot Volume, vtape = Virtual Tape Volume,
crypt = Block level encrypted volume

Volume                           Type   Size      Device
-------------------------------- ------ --------- ------------------
myraidvol                        bd     102.55G   /dev/md0
mayacli> save volume

Example 3:

The following example uses scripting to show the benefit of CLI if you have to create several virtual volumes.  If your storage server has 6 disk drives from JBOD identified as devices /dev/sda ... /dev/sdf and wish to create virtual volume from them then issue the following commands:

#for i in /dev/sd[a-f]
do
    /opt/mayastor/bin/mayacli create volume label=disk_$(basename $i) disk=$i
done
#/opt/mayastor/bin/mayacli save volume
# /opt/mayastor/bin/mayacli show vol
Configured Volumes:
Type: id = Individual Disk, bd = Block Device, raid = Software RAID,
lvm = LVM disk, snap = Snapshot Volume, vtape = Virtual Tape Volume,
crypt = Block level encrypted volume

Volume                           Type   Size      Device
-------------------------------- ------ --------- ------------------
disk_sda                         bd     17.09G    /dev/sda
disk_sdb                         bd     17.09G    /dev/sdb
disk_sdc                         bd     17.09G    /dev/sdc
disk_sdd                         bd     17.09G    /dev/sdd
disk_sde                         bd     17.09G    /dev/sde
disk_sdf                         bd     17.09G    /dev/sdf
 

 

How to Create Mayastor Proxy Devices?

Only SCSI devices can be configured for proxy mode.  First identify the SCSI addresses which is a combination of SCSI host number, Channel, Target ID and LUN. This information is available by viewing the file  /proc/scsi/scsi

# cat /proc/scsi/scsi
Attached devices:
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: CDWRITER Model: IDE5232        Rev: A036
Type:   CD-ROM                         ANSI SCSI revision: 02
# /opt/mayastor/bin/mayacli
mayacli> create volume cdwriter disk=(2,0,0,0)
mayacli> show vol
Configured Volumes:
Type: id = Individual Disk, bd = Block Device, raid = Software RAID,
lvm = LVM disk, snap = Snapshot Volume, vtape = Virtual Tape Volume,
crypt = Block level encrypted volume

Volume                           Type   Size      Device
-------------------------------- ------ --------- ------------------
cdwriter                         id     0.00G
 

How to Map Virtual volumes?

Use the create mapping statement to specify the controller channel and device address by which the virtual volume will be available to the application servers.  To get a list of valid controller channels on your storage server issue the following command:

# /opt/mayastor/bin/mayacli show controller
fc1:
    QLA2312 Target mode Fibre Channel Host Adapter:
    PCI-X 100MHz/64-bit bus 1 device 3 iobase 0x9400 irq 28
    Firmware version: 3.02.28, Driver version 0.6
    WWN-Node: 200000e08b0aec54, WWN-Port: 210000e08b0aec54
    Request entries: Active 0, Available 2048

fc2:
    QLA2312 Target mode Fibre Channel Host Adapter:
    PCI-X 100MHz/64-bit bus 1 device 3 iobase 0x9800 irq 29
    Firmware version: 3.02.28, Driver version 0.6
    WWN-Node: 200100e08b2aec54, WWN-Port: 210100e08b2aec54
    Request entries: Active 0, Available 2048

iSCSI on eth0:
eth0 Link encap:Ethernet HWaddr 00:E0:81:52:F6:AA
     inet addr:10.1.1.95 Bcast:10.1.1.255 Mask:255.255.255.0
     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
     RX packets:1527 errors:0 dropped:0 overruns:0 frame:0
     TX packets:1344 errors:0 dropped:0 overruns:0 carrier:0
     collisions:0 txqueuelen:1000
     RX bytes:147816 (144.3 Kb) TX bytes:142623 (139.2 Kb)
     Interrupt:24
 

Example 1

A mapping over the iSCSI interface is defined by using the keyword iscsiName and specifying iscsi as the controller.
Note:
The iscsiName has to be of the following format and cannot contain characters such as underscore. The following are examples of iSCSI qualified names that might be generated by "EXAMPLE Storage Arrays, Inc."
Naming String defined by
Type Date Auth "example.com" naming authority
+--++-----+ +---------+ +--------------------------------+
| || | | | | |
iqn.2001-04.com.example:storage:diskarrays-sn-a8675309
iqn.2001-04.com.example
iqn.2001-04.com.example:storage.tape1.sys1.xyz
iqn.2001-04.com.example:storage.disk2.sys1.xyz
 

# /opt/mayastor/bin/mayacli
mayacli> create mapping volume=myfirstvol controller=iscsi  iscsiname=iqn.2004-10.com.pavitrasoft:storage.disk1
mayacli> show mapping
Configured Volume Mappings:
Stat: A = Active, I = Inactive, E = Error

Volume             Device            Controller TID LUN Stat Options
------------------ ----------------- ---------- --- --- ---- --------
myfirstvol         /dev/sda          iscsi0     0   0   I     iqn.2004-10.com.pavitrasoft:storage.disk1
 

The above statement creates a single target with LUN 0.  You have full flexibility over LUN and target ID assignments for the virtual volume by specifying the keywords targetid and lun.

Note:
There is no targetid for fibre-channel mappings.  The LUN 0 has to be created first and it should be the last one to unbind.  For iSCSI mappings each target will result in a new iSCSI session and may quickly exceed the limit of allowed iSCSI sessions.  In that case the volumes have to be mapped as LUNs.

 To create another target with LUN 0 you would use:

mayacli> create mapping volume=myvol2  controller=iscsi iscsiname=iqn.2004-10.com.pavitrasoft: storage.disk1 targetid=1

Otherwise to create another LUN 1 to a target you would use:

mayacli> create mapping volume=myvol2  controller=iscsi iscsiname=iqn.2004-10.com.pavitrasoft: storage.disk1 targetid=0 lun=1

Example 2

To create mapping over the fibre channel controller use the desired FC port as shown by the show controller output.  If you have multiple FC ports it may be tricky to identify the correct I/O channel.  By matching the IO address and PCI function ID it would be easy to identify the correct IO channel.

mayacli> create mapping volume=myfirstvol controller=fc1

Example 3

The following example uses scripting to show the benefit of CLI if you have to create mapping for several virtual volumes that were created in Example 3 of How to Create Virtual Volumes.

id=0
for i in /dev/sd[a-f]
do
    /opt/mayastor/bin/mayacli create mapping disk_$(basename $i) controller=iscsi iscsiname=iqn.2003-05.com.pavitrasoft:home.disk.$(basename $i) target=0 lun=$id
    id=$((id+1))
done
 

Once you are satisfied that the mapping is created over correct controller channel and device address, proceed with the bind statement to effectively connect  the storage resource to the application server.

In its simplest form just use the wildcard * to bind all the mappings.

# /opt/mayastor/bin/mayacli
mayacli> bind mapping *

Or to bind one specific volume

mayacli> bind mapping myfirstvol

Or to bind a volume that has multiple mappings over FC and iSCSI and you want to bind only the iSCSI mapping now.

mayacli> bind mapping myfirstvol controller=iscsi

After successful completion of bind statement the storage resources are ready to be scanned from the application servers.

How to Configure  Application Servers?

By default the storage resources provided by Mayastor storage server can be accessed by any application server in the SAN environment.  If you wish to specify a list of SAN clients that can have access to a storage resource then the mapping has to be created with access keyword.

First identify the application server for creating host entries.  The Fibre-channel application server is identifed by its unique world-wide port name. (Note that it is not the WWN node name).  The iSCSI initiator is identified by its iSCSI qualified name and/or by its IP address.

To create host entry for iSCSI client

mayacli> create host appserver1 iscsiname=iqn.1987-05.com.cisco:01.41e02d12b37

To create host entry for FC client:

mayacli> create host label=appserver2  wwn=0a0b0c0d12345678

Now these host names can be used in the mapping statement to specify the list of authorized SAN clients.

mayacli> create mapping volume=myfirstvol controller=fc1 access=appserver2