Active IQ Unified Manager Discussions

WFA cannot connect to array on perl command

THORSTEN_KRAUSE

Hello,

 

got a problem in a WFA-Workflow.

I'm using several WFA commands in a workflow to work on a single cDot-cluster.

I use a couple of Powershell-commands that work flawless (connect & execute)

and one perl-command (from Netapp - "SnapMirror initialize or update set")

which fails on connecting to the array.

I did not change anything on the Perl-configuration that comes with WFA.

WFA is latest version 3.1.0.0.1P1 Build 3511759

Server is Win2012 R2 freshly installed.

 

Hope somebody can help me here?

 

Regards,

Thorsten

1 ACCEPTED SOLUTION

THORSTEN_KRAUSE

Hey,

 

sinhaa found the error:

in my case, it was a misinterpretation in wfautil.pm

Problem was that if you got a password that contains quotes or ampersands,

wfautil.pm will wrongly interpret it.

 

sinhaa filed a bug for that, hopefully it'll be fixed in WFA 4.0 GA

 

Regards and thanks for the help

View solution in original post

25 REPLIES 25

MATTHEWKOOSWN

Sinhaa,

 

I have this same issue.  Perl commands (in my cast transfer snapmirror) that were working previously when I was running WFA 3.1P1 seem to have been broken when I upgraded to WFA 3.1P2.  I am getting the same unable to connect to array error.  I tried adding in the cluster management name and IP into the hosts file and that changed the behavior of the problem.  It doesn't error out immediately instead it sits for a very long time and comes back with the following error:

 

C:\Program Files\NetApp\WFA\Perl64\bin>perl myfile.pl
Connection failedServer returned HTTP Error:

 

I tried adding in the environment variable as well as another poster suggested but it did not help.  Do you have any suggestions for me to try?

 

Thanks,

Matt.

 

sinhaa

@MATTHEWKOOSWN

 

Matt,

 

Unable to connect using perl commands is a very generic error and comes due to many reasons, they all have to be dealt case by case basis. I suggest you raise a netapp support case, so that I can have a look at your WFA env. Else its very difficult to pin-point the error and it will take long time as well.

 

 

I assure you, it will be resolved.

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Rutul

Hi All,

 

@sinhaa gave me the solution of this problem when he tried to debug this issue in my WFA environment. 

 

What we tried - 

 

1. Tried the Perl code posted by Abhishek Sinha, by running into command prompt

 

 

####

 

use NaServer;

 

#Set Array credentials below
$array="10.20.30.40";
$username = "admin";
$pass = "mypass";

 

$server = NaServer->new($array, 1, 14);
$server->set_style('LOGIN');
$server->set_admin_user($username, $pass);
$server->set_transport_type('HTTPS');
$server->set_server_cert_verification(0);
$output = $server->invoke( "system-get-version" );
if (ref ($output) eq "NaElement" && $output->results_errno != 0) {
# failed to establish connection
print "Connection failed";

print $output->results_reason;
}
else {
# successfully connected
print "Connected successfully";
}

 

########

 

2. It gave us the error as "Can't locate NaServer.pl @INC .."

 

Therefore we added the new Environment Variable as shown below. 

 

Go to MyComputer Properties > Click on "Advanced System Settings" > Press "Environment Variables" button > Add the New variable in System Variables section:

 

Variable Name:  PERL5LIB

Variable Value:  C:\Program Files\NetApp\WFA\perl\nmsdk; C:\Program Files\NetApp\WFA\Perl64\lib; C:\Program Files\NetApp\WFA\Perl64\site

 

After this I was able to connect to Array in WFA workflow using perl scripting. Thanks @sinhaa for the help.

 

All those who are facing this issue can try the same solution. 

 

@sinhaa and @abhit Let me know if I have missed something here.

THORSTEN_KRAUSE

Hey,

 

sinhaa found the error:

in my case, it was a misinterpretation in wfautil.pm

Problem was that if you got a password that contains quotes or ampersands,

wfautil.pm will wrongly interpret it.

 

sinhaa filed a bug for that, hopefully it'll be fixed in WFA 4.0 GA

 

Regards and thanks for the help

View solution in original post

Rutul

I am also facing the same issue. Please update if anybody has found the solution

abhit

To which version of ONTAP you are trying to connect?

 

Regards

Abhi

THORSTEN_KRAUSE

Hello,

 

it's 8.3.1P1 (cDot)

 

Thanks for your help,

Thorsten

sinhaa

Thorsten,

 

Kindly post the exact error that you are getting.

 

That could help in debugging.

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

rkiran

'netapp1' might not be reachable from wfa server.  Can you try to do test connectivity of 'netapp1' from GUI-->Execution-->Credentials dialog. Also, can you try to provide IP address or FQDN of the cluster to the command ?

 

THORSTEN_KRAUSE

Hello,

 

connectivity and credentials are definetely working,

the command "Create Storage Virtual Machine" in said workflow to the same cluster using the same credentials does work:

 

16:25:27.325 INFO  [Create and configure Storage Virtual Machine] ### Command 'Create and configure Storage Virtual Machine' in 'POWER_SHELL' ###
16:25:36.091 INFO  [Create and configure Storage Virtual Machine] Get-WfaCredentials -Host netapp1
16:25:36.122 INFO  [Create and configure Storage Virtual Machine] Credentials successfully provided for 'netapp1'
16:25:36.185 INFO  [Create and configure Storage Virtual Machine] Connect-Controller -Type CLUSTER -Name netapp1 -Credential System.Management.Automation.PSCredential -Vserver  -Timeout 60000
16:25:36.263 INFO  [Create and configure Storage Virtual Machine] Connect-NcController (with credentials) -Name netapp1 -Timeout 60000 -ErrorAction Stop
16:25:43.435 INFO  [Create and configure Storage Virtual Machine] Connected to cluster node
16:25:44.342 INFO  [Create and configure Storage Virtual Machine] Creating a new Storage Virtual Machine - Name 'testsvm' , Aggregate 'aggr_sas900_01_netapp11' on Root Volume 'netapp1_root'
16:25:49.233 INFO  [Create and configure Storage Virtual Machine] Configuring Storage Virtual Machine with Allowed protocols 'nfs cifs
16:25:50.655 INFO  [Create and configure Storage Virtual Machine] Command completed, took 23330 milliseconds

 

--> only difference in that workflow is that the command that is not working is written in perl. All others (written in powershell) do work absolutely fine.

sinhaa

Test-Connectivity uses powershell to verify connectivity. So this result was expected. To debug perl, can you do the following. 

  1.  Add a new command in language = perl and have this code. Just test it, it needs no inputs etc.

====

#Begin Code

 

use Getopt::Long;
use NaServer;
use WFAUtil;

 

my $Cluster="netapp1";

my $wfa_util = WFAUtil->new();


$wfa_util->sendLog('INFO', 'Connecting to cluster: ' . $Cluster);

my $server = $wfa_util->connect($Cluster);

 

#End Code

 

How does this work for you?

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

THORSTEN_KRAUSE

Hey,

 

sry for long delay.

 

Tried it, exactly the same problem:

 

11:12:03.032 INFO  [test_connectivity] Connecting to cluster: netapp1
11:12:03.079 INFO  [test_connectivity] Credentials successfully provided for 'netapp1'
11:12:04.188 INFO  [test_connectivity] Trying to connect to netapp1 using HTTPS
11:12:12.220 INFO  [test_connectivity] Trying to connect to netapp1 using HTTP
11:12:15.111 ERROR  [test_connectivity] Failed executing command. Exception:
Unable to connect to array

 

--> Also installed a fresh WFA on a Win2012R2 Server, same result

 

--> Maybe some problem on securing the connection?

sinhaa

There is a known problem with Perl NMSDK. If host names are unable to be resolved by the DNS, this problem is seen.

 

I suggest you add the hostname netapp1 in your WFA's windows's hosts file.

 

Got to: C:\Windows\System32\drivers\etc and open the file hosts for editing using some text editor like Notepad++

 

Add a line like

 

<IP_Address_of_netapp1>  <FQDN_of_netapp1>    netapp1

 

Save it

 

 

Now back to WFA and try the same test command.

 

sinhaa

 

 

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

sheelnidhig

Hello,

 

I am also facing the same issue.

The DNS resolution is also working well.

 

We could have a custom command on Powershell, but OnCommand Unified Manager does uses the default workflow's, not sure how can I attach a custom workflow with OnCommand Unified managers jobs.

 

Thanks,

Sheel

sinhaa

@sheelnidhig

 

It needs to be looked at the environment your WFA is in. You raise a case and ask the TSE to contact me.

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

THORSTEN_KRAUSE

Hey,

 

tried that.

 

This doesn't help either, still the same error.

 

Some other suggestion?

 

Thanks

sinhaa

@THORSTEN_KRAUSE

Have you tried giving the IP Address instead of the hostname to test the command?

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

THORSTEN_KRAUSE

Hey,

yes, also tried that, same result

sinhaa

@THORSTEN_KRAUSE

 

Okay lets keep WFA aside and try to see if any perl code is able to connect from your WFA server to your Array. This would help us to zero down the problem

 

below is a perl code, save it as  myfile.pl. Modify your array credentials as per your setting.

 

####

 

use NaServer;

 

#Set Array credentials below
$array="10.20.30.40";
$username = "admin";
$pass = "mypass";

 

$server = NaServer->new($array, 1, 14);
$server->set_style('LOGIN');
$server->set_admin_user($username, $pass);
$server->set_transport_type('HTTPS');
$server->set_server_cert_verification(0);
$output = $server->invoke( "system-get-version" );
if (ref ($output) eq "NaElement" && $output->results_errno != 0) {
# failed to establish connection
print "Connection failed";

print $output->results_reason;
}
else {
# successfully connected
print "Connected successfully";
}

 

########

 

On your WFA windows server, open a command prompt and execute this perl code. 

It will give result as Connected Successfully or Connection failed.

 

Awaiting your results.

 

sinhaa

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

THORSTEN_KRAUSE

Hello,

 

yes that was successful, so it seems to be somewhere in WFA?

 

THanks

Announcements
Register for Insight 2021 Digital

INSIGHT 2021 Digital: Meet the Specialists 2

On October 20-22, gear up for a fully digital, totally immersive virtual experience with a downright legendary lineup of world-renowned specialists. Tune in for visionary conversations, solution deep dives, technical sessions and more.

NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public