Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providing a symid for initial connection #35

Closed
NuisanceLevel7 opened this issue Mar 13, 2019 · 15 comments
Closed

Providing a symid for initial connection #35

NuisanceLevel7 opened this issue Mar 13, 2019 · 15 comments

Comments

@NuisanceLevel7
Copy link

Creating a connection requires specifying a symid known to the Unisphere host I'm trying to connect to. This is an issue for me because I've written a script to iterate over 4 Unisphere servers and collect performance data from 12 VMAX arrays. It would be nicer if I didn't need to know which arrays were on each unisphere server in advance. If I could connect without the symid, I could then use get_array_list to iterate over the arrays and set the array for each iteration. It seems like all I should need to connect is the ip address, port and credentials. I should be able to dynamically discover the arrays. I'm working around this by just adding configuration to the script so that for each unisphere IP I have a known symid on that unisphere instance. It would be better if I could connect without the symid because in the future the arrays in the unisphere server may change.

@rawstorage
Copy link
Collaborator

Vic,
if you check out the HelloUnisphere script.. I think this is doing exactly what you need. The latest versions of PyU4V don't require you to have the array specified in the initial connection string..

Below is the code

#Sample Script

from PyU4V import U4VConn

conn = U4VConn(u4v_version='90', server_ip='IPaddress', port=8443,
verify=False, username='smc', password='smc')

Make a get call to find the version

version = conn.common.get_uni_version()

Get a list of managed arrays

array_list = conn.common.get_array_list()

print("Congratulations you have just connected to Unisphere for "
"VMAX your Version is ", version[1])
print("This Unisphere instance manages the following arrays", array_list)

local_array_list = []

for i in array_list:
check_local = conn.common.get_array(i)
if check_local["local"]:
local_array_list.append(i)

print("The following arrays are local to this Unisphere instance",
local_array_list)

@NuisanceLevel7
Copy link
Author

Got it! Thanks!

@NuisanceLevel7
Copy link
Author

Got another question. Is it possible to call get_host_list for a VMAX2? This works as expected for VMAX3 but for VMAX2 arrays I get this...

"The status code received is 400 and the message is {'message': "SLO Provisioning is not supported on Symmetrix 'xxxxxxxxxxxxxx'"

I looked around in the module for an alternate get_host_list function for VMAX2 but didn't find anything. Maybe I missed it. My environment has 2 40ks left, both are being migrated this year but it would be nice to be able to work with them while they're here. Is there a discussion board for this kind of question?

@NuisanceLevel7
Copy link
Author

I see in the docs vmax v3 and newer are supported.

@anishxv
Copy link

anishxv commented Mar 19, 2019

Sorry to ask here but has anyone got this error ?

Traceback (most recent call last):
File "C:\restapi\an1.py", line 7, in
from PyU4V import U4VConn
File "C:\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyU4V_init_.py", line 7, in
from .univmax_conn import U4VConn
ModuleNotFoundError: No module named 'PyU4V.univmax_conn'

@rawstorage
Copy link
Collaborator

Anish, I just did a fresh install on a test system without issues running Python 3.7.2 on windows same as you, I had no issues. Try running python -m pip --upgrade PyU4V and retrying.

@anishxv
Copy link

anishxv commented Mar 19, 2019 via email

@rawstorage
Copy link
Collaborator

rawstorage commented Mar 19, 2019 via email

@anishxv
Copy link

anishxv commented Mar 19, 2019

Reinstalling did the trick I guess. Thanks a lot.

@anishxv
Copy link

anishxv commented Apr 5, 2019

Regarding the api to create srdf replication,
We can start the replicaiton from source array to destination using an existing rdf group.
Does it gives the option to create a new rdf group.
Could you please help with this query.
Thanks in advance.

@rawstorage
Copy link
Collaborator

Anish,
if you are working with metro or async protection a new RDFG is created automatically for each storage group you are protecting as Metro and RDF/A have a hard requirement for this.

Alternatively you could modify the replication.py file to change the following lines.

line 467: def create_storagegroup_srdf_pairings(
self, storagegroup_id, remote_sid, srdfmode, establish=None,
_async=False, rdfg_number=None, new_rdfg=False):

line 484: rdf_payload = {"replicationMode": srdfmode,
"remoteSymmId": remote_sid,
"remoteStorageGroupName": storagegroup_id,
"establish": establish_sg,
"forceNewRdfGroup":new_rdfg}

@anishxv
Copy link

anishxv commented Apr 6, 2019

Thank you. I tried it and getting below error now.

PyU4V.utils.exception.VolumeBackendAPIException: Bad or unexpected response from the storage volume backend API: Error Create storagegroup/rmr_test/rdf_group resource. The status code received is 500 and the message is {'message': 'A problem occurred creating the Storage Group SRDF Group resource: A problem occurred creating srdf storage group [rmr_test]: SRDF Group [51] on Symmetrix [SYMM_ID] cannot be found'}.

btw, 51 is the freeerdfg we are trying to create.

@rawstorage
Copy link
Collaborator

rawstorage commented Apr 6, 2019 via email

@anishxv
Copy link

anishxv commented Apr 8, 2019

Many thanks for your reply.

My scenario is,

With restapi we can create srdf replication with acp_disk mode from source array to target array.
The problem is , the session always select an existing rdfg.
We want to create a new rdfg each time a session is created.
Could you please help with this.

@rawstorage
Copy link
Collaborator

rawstorage commented Apr 8, 2019 via email

@dell dell locked as off-topic and limited conversation to collaborators Apr 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants