REX-Ray + Isilon Installation


## Environment 
##### 1. Check REX-Ray is installed and available on the server
Log into the server via ssh and run the REX-Ray command below. Confirm REX-Ray service is running and check its volume list.

```
[root@sunny ~]# rexray volume ls
ID                Name      Status       Size
c19deefe00000001  rexray01  unavailable  24
c19deefd00000000  vol01     attached     16
```

>*Note*: To install RexRay, follow this link https://rexray.codedellemc.com/

##### 2. Check Isilon OneFS is available
Access One FS server via web browser. 
![image](https://qiita-image-store.s3.amazonaws.com/0/186167/2ef93d4c-7d92-cee4-6931-bc458b695fa0.png)

##### 3. Check REX-Ray can connect to Isilon OneFS via SmartConnect
Ping to SmartConnect IP.

```
[root@sunny ~]# ping 192.168.20.40
PING 192.168.20.40 (192.168.20.40) 56(84) bytes of data.
64 bytes from 192.168.20.40: icmp_seq=1 ttl=64 time=0.284 ms
```


## REX-Ray configuration file overview
To set up REX-Ray, you can use REX-Ray Configuration Generator (http://rexrayconfig.codedellemc.com/). In this case, pick Dell EMC Isilon from "Add A Service" list.

![image](https://qiita-image-store.s3.amazonaws.com/0/186167/9c0b0f5b-cb3a-7955-4255-936b2791d1b9.png)    

To generate a configuration file, you need to know following Isilon parameters.
1. Endpoint
2. Volume Path
3. NFS Host
4. Data Subnet

Looking at the config generator page, it says "Optional" Storage Configuration.  Required parameters are only user info and endpoint?. 
In Isilon section of this [libstrage document](http://libstorage.readthedocs.io/en/stable/user-guide/storage-providers/), however, it mentions "Optional Storage Configuration" as "Extra Parameters" like below.
>***volumePath*** represents the location under /ifs/volumes to allow volumes to be created and removed.
***nfsHost*** is the configurable NFS server hostname or IP (often a SmartConnect name) used when mounting exports
***dataSubnet*** is the subnet the REX-Ray driver is running on. This is used for the NFS export host ACLs.

According to the [libstrage document](http://libstorage.readthedocs.io/en/stable/user-guide/storage-providers/), the parameters below are optional.
>***insecure*** defaults to false. 
***group defaults*** to the group of the user specified in the configuration. Only use this option if you need volumes to be created with a different group.
***volumePath*** defaults to "". This will have all new volumes created directly under /ifs/volumes.
***quotas*** defaults to false. Set to true if you have a SmartQuotas license enabled.

volumePath is optional but still nfsHost and dataSubnet are necessary to be defined. 

## Generate a REX-Ray configuration file
**1. Endpoint**
According to [OneFS 8.0.0 API Guide](https://www.emc.com/collateral/TechnicalDocument/docu66301.pdf), default API endpoint port is 8080. So, in this case, set https://192.168.20.40:8080 in the box.
　　
  
**2. Volume Path**
On File System Explorer page, create a new directory /ifs/volumes. Then, export it from UNIX Sharing (NFS) page.
![image](https://qiita-image-store.s3.amazonaws.com/0/186167/3cc3cebc-21db-ecd5-ba8a-0da85ed65ba5.png)
　　
  
**3. nfsHost**
According to the libStorage document, nfsHost can be SmartConnect's IP. In most cases, you configured SmartConnect when installing a new Isilon.  To check the parameter of SmartConnect IP, go to Cluster Management > External Network, then click View/Edit next to the subnet which you are going to use for REX-Ray.
![image](https://qiita-image-store.s3.amazonaws.com/0/186167/ec8a976f-fcb9-6d74-408a-54d8c96e111b.png)
　　　　
  　　
**4. Data Subnet**
You can use the subnet of SmartConnect IP. Or go to Cluster Management > External Network to check the parameter. Note that you need to set CIDR explicitly like "192.168.20.0/24" or you will get an error when you start REX-Ray service.


Finally, check "Insecure" option enabled. 
Now, configuration parameters are set like below.
![image](https://qiita-image-store.s3.amazonaws.com/0/186167/dbe9ec9e-1057-7655-7547-0898d2a8b8ac.png)

　　
Just leave libStorage Options as default. 
![image](https://qiita-image-store.s3.amazonaws.com/0/186167/257e26ed-02a7-6eaa-03df-4b90646947bb.png)

　　
Now you can copy the config file and paste it to /etc/rexray/config.yml file.
![image](https://qiita-image-store.s3.amazonaws.com/0/186167/d75ff478-f6cf-cbb1-66aa-eccb3e7b2ee6.png)
　　
## REX-Ray troubleshooting
During REX-Ray + Ision installation, I had a few issues needed to be solved.
If you have some troubles as well, please refer this post ["REX-Ray + Isilon Troubleshooting"]( http://qiita.com/bmj0114/items/47f4f2a7f7d55b051d5a).


## Start REX-Ray service
Currently, REX-Ray service is running on the server using ScaleIO volume. So the current daemon should be stopped by using the following command .

```
sudo /usr/bin/rexray stop | rexray stop
```
　　
Backup /etc/rexray/config.yml which was used for setting up REX-Ray with ScaleIO.
Then, create a new /etc/rexray/config.yml for REX-Ray with Isilon.

```
[root@sunny ~]# cat  /etc/rexray/config.yml
libstorage:
  service: isilon
isilon:
  endpoint: https://192.168.20.40:8080
  group: wheel
  username: root
  password: ****
  insecure: true
  volumePath: /ifs/volumes
  nfsHost: 192.168.20.40
  dataSubnet: 192.168.20.0/24
```
　　
**Start REX-Ray Service with Isilon.**

```
[root@sunny ~]# rexray start
Starting REX-Ray...SUCCESS!

  The REX-Ray daemon is now running at PID 26484. To
  shutdown the daemon execute the following command:

    sudo /usr/bin/rexray stop
``` 

**Create a new rexray volume.**

```
[root@sunny ~]# rexray volume create rexray_isilon_1 --size=2
ID               Name             Status     Size
rexray_isilon_1  rexray_isilon_1  available  0
```

**To create a new volume, the following command also works.**

```
docker volume create --driver rexray --opt size=20 --name rexray_isilon_2
```

**Finally, check REX-Ray volume list.**

```
[root@sunny ~]# rexray volume ls
ID                          Name                        Status     Size
rexray_isilon_1             rexray_isilon_1             available  0
rexray_isilon_2             rexray_isilon_2             available  0
test_at_isilon_ifs_volumes  test_at_isilon_ifs_volumes  available  0
```
　　 
Now, REX-Ray with Isilon is seemingly working fine. 

<!-- 
But I am still not sure why the list above shows the sizes of the rexray volume are 0. So further investigation may be necessary.
 -->

> Note: REX-Ray command referene:  https://rexray.readthedocs.io/en/stable/user-guide/usage/

　　
## *Memo: REX-Ray Multiple Storage Configuration*
>**Edit**: After a while, I tested multiple storage configuration and it worked. So I should say REX-Ray support multiple storage service. If you want to try multiple storage configuration, please refer [this post](http://qiita.com/bmj0114/items/d462c39a56ab48c606c3). 

In our system, REX-Ray is now running on ScaleIO. So I need to know how to configure REX-Ray on multiple storages. However, REX-Ray configuration generator doesn't support multiple storage configuration currently.  
 ![image](https://qiita-image-store.s3.amazonaws.com/0/186167/b7e3afb3-b892-b523-ad5f-ea6a79ccd86d.png)
 　　
So next, check [REX-Ray document](http://rexray.readthedocs.io/en/stable/) and it says "For more advanced and manual options, such as using multiple storage platforms, and sample configurations of all supported storage platforms, refer to the [libStorage Storage Providers documentation](http://libstorage.readthedocs.io/en/stable/user-guide/storage-providers/)."
　　
But unforunately, Dell EMC's ScaleIO and Isilon seemingly do not support multiple storage cofiguration whereas AWS supports that configuration. (I read through the libstorage document but I couldn't find any lines mentioned about the configuration in Dell EMC section. So this time, I didn't try to configure REX-Ray with multiple storages.  


<!-- 
### Old pictures

1. Add NIC to the VM on vCenter
![image](https://qiita-image-store.s3.amazonaws.com/0/186167/50b97668-8bd5-e7d2-3688-75285fb50d55.png)

Now, configuration paramters are set like below.
![image](https://qiita-image-store.s3.amazonaws.com/0/186167/d5f76d9e-305b-d370-1e49-762a1fc3e184.png)

![image](https://qiita-image-store.s3.amazonaws.com/0/186167/0453ec7d-3025-f57f-1795-2fa9b7365979.png)
 -->