Start a Conversation

Solved!

Go to Solution

494

February 24th, 2023 11:00

Unity Rest API - update multiple hosts on LUNs

Hi I'm writing a Perl script to add a standby server to a server's LUNs as part of a DR scenario. The LUNs on the source host might also be accessible from RecoverPoint. I want to leave the access to the original host and RecoverPoint and just add access to the standby host.

I've been able to look up the source server LUNs and their associated HLUs and their associated servers. But when I run the post for storageResource modify LUN, I get this error.

'errorCode' => 131149864,
'httpStatusCode' => 422,
'messages' => [
{'en-US' => 'Cannot find the specified host by id/name Host_47,Host_49. Please recheck if it exists. (Error Code:0x7d13028)'

Host_47 is the source server and Host_49 is the standby server. Here is the code for this test.

$resp = request(POST, "instances/storageResource/sv_1164/action/modifyLun",
{"lunParameters"=> {"hostAccess"=> [{"host"=> {"id"=> "Host_47,Host_49"},
"accessMask"=> 1,
"hlu"=> 7 }]
}
});

When I removed "Host_47," from the call, it moved LUN sv_1164 from Host_47 to Host_49.

Is there a way to add Host_49 instead of replacing the current access?

Jim

3 Posts

March 17th, 2023 07:00

Found an issue with my code. Needed quotes around the server list and hlu list.

$resp = `uemcli -d $IP_ADDR -u $USER -p $PASS -silent -noHeader /stor/prov/luns/lun -id $str1 set -lunHosts \"$lun_servers{$str1}\" -hlus \"$lun_pairs{$str1}\" | grep "Operation completed successfully"`;

3 Posts

March 10th, 2023 15:00

This seems to be a bug with the Rest API. Rewrote the script using the CLI and it is working.

Where $str1 is the CLI LUN name,

$resp = `uemcli -d $IP_ADDR -u $USER -p $PASS -silent -noHeader /stor/prov/luns/lun -id $str1 set -lunHosts $lun_servers{$str1} -hlus $lun_pairs{$str1} | grep "Operation completed successfully"`;

I saw the script was hanging. When I ran the command by itself in bash I found it was prompting me yes or no. I found the -silent flag to stop that behavior.

3 Apprentice

 • 

415 Posts

March 11th, 2023 07:00

thanks @JimHInes its a known bug, rewriting the script will fix it.

No Events found!

Top