Start a Conversation

Unsolved

This post is more than 5 years old

4166

May 8th, 2015 08:00

xtremio allocation

Hi,

Looking for some help with xtremio allocation via ssh.

typically i prepare a script(output.txt) something like

command1

command2

command3

-

-

- commandn

and run it via ssh

ssh xmstest < output.txt

among all the above commands there is one command which prompts for a reponse Yes/No,  here i want to pass "Yes" ( when we map a lun to multiple hosts) , just wondering if there is a way to respond to the promt. I tried to include "Yes" after the command in the script but it dint work. If i just copy and paste all the commands it works simply by adding "Yes" after the command.

Thanks for any help!

3 Posts

May 10th, 2015 20:00

Hi Avi,

I’m trying to map a shared lun to multiple servers in a cluster.

map-lun ig-id="ampesx1" vol-id="esx0t_xms_lun1" lun=1

map-lun ig-id="ampesx2" vol-id="esx0t_xms_lun1" lun=1 --> here array will prompt for Yes/No as I’m allocating same lun to multiple servers.

Yes

It works if I simply copy and paste the command with “Yes” in the next line in xmcli but when I do the same thing through SSH its not working.

Here is the error when I do this via ssh

Are you sure you want to create additional LUN mapping for Volume esx0t_xms_lun1 ? (Yes/No): ** Error: History index cannot be negative

727 Posts

May 10th, 2015 20:00

Btw, we highly recommend using the RestAPI interface for any scripting that you need to do with XtremIO. Take a look at the RestAPI guide that we have published on the Support website.

727 Posts

May 10th, 2015 20:00

Are you open to using RestAPI for doing this mapping operation?

727 Posts

May 10th, 2015 20:00

What is the command that you are running (which needs a yes/no answer)?

3 Posts

May 10th, 2015 21:00

Yes I would love to explore the RESTful API option but for now I have a completely written PS script which will generate the required commands to do the allocation, all I need is to find a way to run all the commands through SSH.

5 Practitioner

 • 

274.2K Posts

January 30th, 2018 23:00

I am new to RESTful API and my requirement is to integrate the scripts from hpux host to XtremIO using the REST API scripts for every month end snapshot refresh. Thanks in advance

4 Posts

February 4th, 2018 08:00

syedaval

Please refer to the XtremIO Storage Array RESTful API (Ver. 2.1) Guide for a comprehensive guide on RESTful API usage with XtremIO storage arrays.

4 Posts

February 4th, 2018 08:00

storagehip

I tried out a similar scenario to your own on one of our lab arrays.

Following is what I saw when I attempted to perform 2 LUN mapping operations (same volume, different initiator groups) using the XMCLI interface:

xmcli (admin@cluster-1)> map-lun vol-id=10 ig-id=1

LUN 2 mapped to Volume test_vol [10]

xmcli (admin@cluster-1)> map-lun vol-id=10 ig-id=2

ATTENTION: Volume test_vol [10] is mapped to an Initiator Group.

Are you sure you want to create additional LUN mapping for Volume test_vol [10]? (Yes/No): Yes

LUN 1 mapped to Volume test_vol [10]

However, I did not receive the above prompt when I attempted to execute the same operations using a script (named test_script.txt in the below example), as per the following output:

[root@srv tmp]# ssh < test_script.txt

Pseudo-terminal will not be allocated because stdin is not a terminal.

root@ 's password:

LUN 2 mapped to Volume 10

ATTENTION: Volume 10 is mapped to an Initiator Group.

LUN 1 mapped to Volume 10

The content of the test_script.txt script (referenced in the above example) was as follows:

xmcli -u "admin" -p " " -c "map-lun ig-id=1 vol-id=10 cluster-id=2"

xmcli -u "admin" -p " " -c "map-lun ig-id=2 vol-id=10 cluster-id=2"


Can you please elaborate more on the syntax that you are using within your output.txt script in order to perform your LUN mapping operations? Once this information is provided, I will be more than happy to assist you with your issue. I look forward to your response.

No Events found!

Top