-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I need some help, please.
I have a script that has been running fine for many months.
However, after we upgraded Pmax from version 10.2 to 10.3, my script is failing.
Despite the script failing, the link is being created successfully on the Pmax (I can confirm this in the Pmax GUI).
I have already checked the REST API documentation and confirmed that nothing has changed in the API endpoints or structure relevant to the script.
Could you please review my script to help me determine if something is wrong with it, as the link creation seems successful, but the script is reporting a failure?
I am attaching the script for your review.
var srcStorageGrpId = refreshSourceSG;
var tgtStorageGrpId = refreshTargetSG;
var snapId = srcSnapIdRefresh;
var url = "/univmax/restapi/" + apiVer + "/replication/symmetrix/" + encodeURIComponent(symmetrixId) +
"/storagegroup/" + encodeURIComponent(refreshSourceSG) +
"/snapshot/" + encodeURIComponent(srcSnapRefresh) +
"/snapid/" + encodeURIComponent(srcSnapIdRefresh);
System.log("Link URL: " + url);
System.sleep(1000);
var body = {
"action": "Link",
"link": {
"storage_group_name": tgtStorageGrpId
}
};
var req = pmaxHost.createRequest("PUT", url, JSON.stringify(body));
req.setHeader("Authorization", "Basic " + basicAuth);
req.setHeader("Accept", "application/json");
req.setHeader("Content-Type", "application/json");
var res = req.execute();
var statusCode = res.statusCode;
System.log("Response Status Code: " + statusCode);
if (statusCode == 200) {
System.log("Snapshot was successfully linked.");
var responseJson = JSON.parse(res.contentAsString);
System.log("Link Response to Existing sg: " + JSON.stringify(responseJson, null, 2));
} else {
var errorException = "Failed to Create link snapshot. Error code: " + statusCode + ". Response: " + res.contentAsString;
System.log("~~~~ Error: " + errorException + " ~~~");
throw errorException;
}
this is error I get code 502
storageGroup source: sg_myVMxxx10_REFRESH
storageGroup Target: sg_myVMxxx26_REFRESH
infosrcSnapIdRefresh: 95737447424
infosrcSnapRefresh: snapRef_myVMxxx10_04-12_0712
infoLink URL: /univmax/restapi/103/replication/symmetrix/12345678/storagegroup/sg_myVMxxx10_REFRESH/snapshot/snapRef_myVMxxx10_04-12_0712/snapid/95737447424
Response Status Code: 502
Error: Failed to create link snapshot.
Error code: 502. Response: {"message":"cvc-complex-type.2.4.a:
Invalid content was found starting with element '{[http://www.emc.com/em/2012/07/univmax/restapi/103/replication\](http://www.emc.com/em/2012/07/univmax/restapi/103/replication/):linked_volume_name}'.
One of '{[http://www.emc.com/em/2012/07/univmax/restapi/103/replication\](http://www.emc.com/em/2012/07/univmax/restapi/103/replication/):source_volume_name}' is expected."} ~~~