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.
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.
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.
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:
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.
storagehip
3 Posts
3458
0
Posted 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