Subscribe
Accepted Solution

"Create export" command problem

My WF is 1. create a Vol; 2. Export the Vol.

The WF fails with the following:

Missing an argument for parameter 'Anon'. Specify a parameter of type 'System.String' and try again.

I look at log (i changed IP's, names etc.):

10:10:24.625 INFO  [Create Export] Executing command: ./Create_Export2162464948268547412.ps1 -Anon -Array filer16 -NoSuid $true -Path /export -RWhosts @('','root=<IPs here>') -VolumeName volname

..

10:10:49.363 INFO  [Create Export] Expression to invoke: Add-NaNfsExport -Persistent -Path /export -ActualPath /vol/volname -NoSuid -Anon -Root @() -ReadOnly @() -ReadWrite @('','root=IPs here)

10:10:49.545 ERROR  [Create Export] Missing an argument for parameter 'Anon'. Specify a parameter of type 'System.String' and try again.

10:10:49.979 ERROR  [Create Export] Missing an argument for parameter 'Anon'. Specify a parameter of type 'System.String' and try again.

10:10:49.993 INFO  [] ***** Workflow Execution Failed *****

So -Anon doesn't have any value, however it has '0' value in appropriate Define FindChart.

Now I look at "Create Export" command:

..

if ($Anon)

{

    $expression += " -Anon"

}

..

So it seems to me that it should be:

if ($Anon)

{

    $expression += " -Anon $Anon"

}

Or am I missing something here?

Vladimir

Re: "Create export" command problem

Hi Vladmir,

Good catch!

This issue is a known issue and has been fixed in subsequent builds.

The relevant logs :

Planner :
========

06:50:35.900 INFO  [Create Export] ### Command 'Create Export' ###
06:50:37.088 INFO  [Create Export] Executing command: ./Create_Export5845317870079201040.ps1 -Anon 65536 -Array x.x.x.x -VolumeName test_vol
06:50:37.150 INFO  [Create Export] Get-NaCredentials -Host x.x.x.x
06:50:37.275 INFO  [Create Export] Connect-NaController (with credentials) -Name x.x.x.x
06:50:41.447 INFO  [Create Export] Connected to controller
06:50:45.853 INFO  [Create Export] Removing NFS export : /vol/test_vol
06:50:47.275 INFO  [Create Export] Expression to invoke: Add-NaNfsExport -Persistent -Path /vol/test_vol -Anon 65536 -Root @() -ReadOnly @() -ReadWrite @('all-hosts')
06:50:48.744 INFO  [Create Export] Command completed, took 12844 milliseconds

The corresponding fix in the "Create Export" command(as you correctly pointed out) :

if ($Anon)

{

   $expression += " -Anon " + $Anon

}

       

Regards,

Tanzim

Re: "Create export" command problem

Are you wishing to pass something in the anon definition - if no then this field should be left blank in the define chart for the export

Example below...

Re: "Create export" command problem

I really needed to have "-Anon 0".

Vladimir

Re: "Create export" command problem

Hi Tanzim,

Indeed your fix works as expected.

There is another issue however =)

My execution logs (no changes to output whatsoever this time):

13:20:03.678 INFO  [BK -  Create Export] Executing command: ./BK_-__Create_Export6540396713782142586.ps1 -Anon 0 -Array 10.196.68.207 -NoSuid $true -Path /export -RWhosts @('10.196.68.0/24:10.196.69.0/24:10.196.174.0/24') -Roothosts @('10.146.68.45:10.146.68.7') -VolumeName csmail

13:20:04.075 INFO  [BK -  Create Export] Get-NaCredentials -Host 10.196.68.207

13:20:04.188 INFO  [BK -  Create Export] Connect-NaController (with credentials) -Name 10.196.68.207

13:20:26.569 INFO  [BK -  Create Export] Connected to controller

13:20:28.281 INFO  [BK -  Create Export] Expression to invoke: Add-NaNfsExport -Persistent -Path /export -ActualPath /vol/csmail -NoSuid -Anon 0 -Root @('10.146.68.45:10.146.68.7') -ReadOnly @() -ReadWrite @('10.196.68.0/24:10.196.69.0/24:10.196.174.0/24')

13:20:28.707 INFO  [BK -  Create Export] Command completed, took 29049 milliseconds

13:20:28.721 INFO  [] ***** Workflow Execution Completed *****

Now I check /etc/exports on the filer 10.196.68.207:

/vol/csmail     -sec=sys,rw,root=10.146.68.45,nosuid

I don't know what's wrong this time, Add-NaNfsExport  bug?

Vladimir

Re: "Create export" command problem

Hi Vladimir,

The follow up issue that you mentioned was quite tricky to debug. I've managed to find the issue and solution.

I found that when i provided values to the input parameters "RootHosts" and "RWhosts" as 

          RootHosts:     "root1"

          RWhosts:      "rw1 rw2"

the workflow failed to set anon=0 in the /etc/exports file on ONTAP.                                                           

However, when i provided the values as

      RootHosts:     root1

      RWhosts:       rw1,rw2

the workflow successfully set anon=0 in the /etc/exports file on ONTAP.

Please try this out in your setup and let me know if it worked for you.

Logs mentioned below :

FAILED SETTING

==============

11:44:23.348 INFO  [Create Export] ### Command 'Create Export' ###

11:44:24.551 INFO  [Create Export] Executing command: ./Create_Export3238572789650908080.ps1 -Anon 0 -Array 10.68.66.213 -NoSuid $true -Path /test_path9 -RWhosts @('rw1 tw2') -Roothosts @('root1') -VolumeName test_vol9

11:44:24.645 INFO  [Create Export] Get-NaCredentials -Host 10.68.66.213

11:44:24.707 INFO  [Create Export] Connect-NaController (with credentials) -Name 10.68.66.213

11:44:28.473 INFO  [Create Export] Connected to controller

11:44:32.864 INFO  [Create Export] Expression to invoke: Add-NaNfsExport -Persistent -Path /test_path9 -ActualPath /vol/test_vol9 -NoSuid -Anon 0 -Root @('root1') -ReadOnly @() -ReadWrite @('rw1 tw2')

11:44:34.285 INFO  [Create Export] Command completed, took 10937 milliseconds

/etc/exports entry

/vol/test_vol9  -sec=sys,rw,nosuid

SUCCESSFUL SETTING

===================

11:45:35.331 INFO  [Create Export] ### Command 'Create Export' ###

11:45:36.535 INFO  [Create Export] Executing command: ./Create_Export7555570186892756222.ps1 -Anon 0 -Array 10.68.66.213 -NoSuid $true -Path /test_path10 -RWhosts @('rw1','rw2') -Roothosts @('root1') -VolumeName test_vol10

11:45:36.628 INFO  [Create Export] Get-NaCredentials -Host 10.68.66.213

11:45:36.691 INFO  [Create Export] Connect-NaController (with credentials) -Name 10.68.66.213

11:45:40.503 INFO  [Create Export] Connected to controller

11:45:44.753 INFO  [Create Export] Expression to invoke: Add-NaNfsExport -Persistent -Path /test_path10 -ActualPath /vol/test_vol10 -NoSuid -Anon 0 -Root @('root1') -ReadOnly @() -ReadWrite @('rw1','rw2')

11:45:46.019 INFO  [Create Export] Command completed, took 10688 milliseconds

/etc/exports entry


/test_path10-actual=/vol/test_vol10,sec=sys,rw=rw1:rw2,root=root1,anon=0,nosuid

Re: "Create export" command problem

Hi Tanzin,

Thanks a lot for your help. I can confirm that passing values for both RootHosts and RWhosts as separated by comma in WF works as expected.

Vladimir