Flash Storage​

 View Only

 Change the Host Storage Domain name via script.

  • Flash Storage
  • Flash Storage
  • Hitachi Virtual Storage Platform VSP
Daniel Buergin's profile image
Daniel Buergin posted 03-16-2021 10:08

We would like to change our HSD names on a couple of G900 and F700 due to a naming convention change. I know, i can do it with the SN GUI, but i need a way to do it by script. Is this in any way possible ?


#HitachiVirtualStoragePlatformVSP
#FlashStorage
William Jansen Van Nieuwenhuizen's profile image
William Jansen Van Nieuwenhuizen

Hello

 

There are a few ways. The G900/G700 have embedded CCI running on the controllers. so you can make a quick list, copy and paste the name changes using CCI.

 

If you have Ops Center Administrator or via PFrest you can also script it using the REST interface and a simple powershell or python script.

Daniel Buergin's profile image
Daniel Buergin

Now i'm suprised, i was not able to find any command in CCI or REST to change a HSD name. So can you give me the CCI command to do that ?

 

raidcom get host_grp -port Cl5-J -I96PORT GID GROUP_NAME Serial# HMD HMO_BITsCL5-J 0 5J-G00 445430 LINUX/IRIXCL5-J 1 testvmhadn0001_2 445430 WIN_EX 2 7 13

What would be the command to change "testvmhadn0001_2" to "testvmhadn0001" ?

 

Regards, Daniel

 

William Jansen Van Nieuwenhuizen's profile image
William Jansen Van Nieuwenhuizen

Hello

 

Below a snippit from Changing it via REST in administrator:

Before the Change:

raidcom get host_grp -port CL3-A -I0PORT GID GROUP_NAME Serial# HMD HMO_BITsCL3-A 5 DC3_ESXi_55 445331 VMWARE_EX 54 63 

Executing it via REST:

curl 'https://<AdministratorIP>/v1/storage-systems/<arraySN>/host-groups/CL3-A-5' \ -X 'PATCH' \ -H 'Connection: keep-alive' \ -H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \ -H 'Accept: application/json, text/plain, */*' \ -H 'Cache-Control: no-store' \ -H 'x-auth-token: xxxxxxxxxxxxxxxxxxxxx' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36' \ -H 'Content-Type: application/json' \ -H 'Sec-Fetch-Site: same-origin' \ -H 'Sec-Fetch-Mode: cors' \ -H 'Sec-Fetch-Dest: empty' \ -H 'Accept-Language: en,en-US;q=0.9,af;q=0.8,nl;q=0.7' \ --data-raw '{"hostGroupName":"DC3_ESXi_55_0"}' \ --compressed \ --insecure

Viewing it via raidcom again:

raidcom get host_grp -port CL3-A -I0PORT GID GROUP_NAME Serial# HMD HMO_BITsCL3-A 5 DC3_ESXi_55_0 445331 VMWARE_EX 54 63

 

Daniel Buergin's profile image
Daniel Buergin

Perfect, thanks a lot !!

 

Daniel Buergin's profile image
Daniel Buergin

Feedback: Did not work for me, but after reading the CCI manuals again, we found the solution:

mmgsrv0001:~: raidcom get host_grp -port Cl5-J -I96PORT GID GROUP_NAME Serial# HMD HMO_BITsCL5-J 0 5J-G00 445430 LINUX/IRIXCL5-J 1 testvmhadn0001_2 445430 WIN_EX 2 7 13……… mmgsrv0001:~: raidcom add host_grp -host_grp_name "testvmhadn0001" -port CL5-J-1 -I96 mmgsrv0001:~: raidcom get host_grp -port Cl5-J -I96PORT GID GROUP_NAME Serial# HMD HMO_BITsCL5-J 0 5J-G00 445430 LINUX/IRIXCL5-J 1 testvmhadn0001 445430 WIN_EX 2 7 13……

Just add a new hostgroup but with the full port of the existing, will overwrite the actual name. CCI reference manual "add host_grp" command.

Daniel Buergin's profile image
Daniel Buergin

@James: Thanks, but it's fixed at least for us. We were not able to bring the tip from @William Jansen van Nieuwenhuizen​  to work. Don't know why, my collegue was testing it. Then we found the simple way with the "raidcom" command. And since i'm working mostly with raidcom in my scripts, thats exactly what i was Looking for.

William Jansen Van Nieuwenhuizen's profile image
William Jansen Van Nieuwenhuizen

I'm using the local Administrator Username/Password combo for my script to return the token and then update the token in the PATCH REST call. In the example above I just copied and pasted my token from my browser.

 

If you have a preference in a programming language you can let me know which; I can make a short little video to show you how to do it programatically. Alternatively check out some of my older posts where I show how to do it in Ansible/Powershell/Python/Curl etc.