Microsoft Virtualization Discussions

Netapp Powershell Toolkit 9.14.1 returns wrong values used without ONTAPI switch

Arvato_HDI
1,525 Views

Hi all,

I have been using the new version of PSTK 9.14.1 for a few days because I thought the previous bugs had been fixed.
But I will still have to use the switch "-ONTAPI" when connecting to the Netapp Cluster to get correct values.
Example:
CMDLET get-nccifsshare
Some wrong or no values are returned if the connection to the cluster is established without the ONTAPI switch and REST-API queries are used:

...profilename\documents> Get-Module

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Manifest 9.14.1.... Netapp.Ontap {Add-NaAggr, Add-NaCifsShare, Add-NaCredential, Add-NaFpolicyExtension...}
Script 1.2 PSReadline {Get-PSReadlineKeyHandler, Get-PSReadlineOption, Remove-PSReadlineKeyHandler, Set-PSReadlineKeyHandler...}


...profilename\documents> nc clustername -Credential $ncred

Name Address Vserver Version
---- ------- ------- -------
clustername 172.1.1.111 NetApp Release 9.12.1P10: Wed Dec 20 00:24:59 UTC 2023


...profilename\documents> $shares = Get-NcCifsShare -VserverContext vservername | select *

...profilename\documents> $shares | where {$_.sharename -like 'tmpshare$'}


Acl : {BUILTIN\Administrators / full_control, BUILTIN\Users / change, Everyone / full_control, ...}
AttributeCacheTtl :
CifsServer :
Comment :
DirUmask :
FileUmask :
ForceGroupForCreate :
MaxConnectionsPerShare :
NcController : clustername
OfflineFilesMode : manual
Path : /vol0815/q0815_11501
ShareName : tmpshare$
ShareProperties :
SymlinkProperties : {local}
Volume : vol0815
VscanFileopProfile : standard
Vserver : vservername
Name : tmpshare$
HomeDirectory : False
Oplocks : True
AccessBasedEnumeration : False
ChangeNotify : True
Encryption : False
NoStrictSecurity : False
AllowUnencryptedAccess : False
ShowSnapshot : False
ContinuouslyAvailable : False
NamespaceCaching : False
UnixSymlink : local
Browsable :
ShowPreviousVersion :
AttributeCache :
AttributeCacheTtlSpecified : False
DirUmaskSpecified : False
FileUmaskSpecified : False
MaxConnectionsPerShareSpecified : False

 

...profilename\documents> nc clustername -Credential $ncred -ONTAPI

Name Address Vserver Version
---- ------- ------- -------
clustername 172.1.1.111 NetApp Release 9.12.1P10: Wed Dec 20 00:24:59 UTC 2023


...profilename\documents> $shares = Get-NcCifsShare -VserverContext vservername | select *
...profilename\documents> $shares | where {$_.sharename -like 'tmpshare$'}


Acl : {BUILTIN\Administrators / Full Control, BUILTIN\Users / Change, Everyone / Full Control, ...}
AttributeCacheTtl :
CifsServer : cifsservername_missed_on_restapi
Comment :
DirUmask :
FileUmask :
ForceGroupForCreate :
MaxConnectionsPerShare : 4294967295_missed_on_restapi
NcController : clustername
OfflineFilesMode : manual
Path : /vol0815/q0815_11501
ShareName : tmpshare$
ShareProperties : {oplocks, browsable, changenotify, show_previous_versions}_missed_on_restapi
SymlinkProperties : {symlinks}_wrong_on_restapi
Volume : vol0815
VscanFileopProfile : no_scan_wrong_on_restapi
Vserver : vservername
Name : tmpshare$
HomeDirectory : False
Oplocks : False_wrong_on_restapi
AccessBasedEnumeration : False
ChangeNotify : False_wrong_on_restapi
Encryption : False
NoStrictSecurity : False
AllowUnencryptedAccess : False
ShowSnapshot : False
ContinuouslyAvailable : False
NamespaceCaching : False
UnixSymlink : _wrong_on_restapi
Browsable :
ShowPreviousVersion :
AttributeCache :
AttributeCacheTtlSpecified : False
DirUmaskSpecified : False
FileUmaskSpecified : False
MaxConnectionsPerShareSpecified : True_wrong_on_restapi

 

...profilename\documents>

 

 

In Addition I checked the return values of a direct REST-API call with System Mananger: 
Here the important value of vscan_profile is correctly "no_scan" other than "standard". It means, the cluster is delivering the correct values to the REST-API call:

"name": "volume1",
"uuid": "028baa66-41bd-11e9-81d5-00a0986138f7"
},
"vscan_profile": "no_scan"
}

 

Kind regards

Holger

1 ACCEPTED SOLUTION

saharsh
814 Views

Hello Holger,

 

Please send us the debug logs using Set-NatoolkitConfiguration debug command it will help us to understand the problem. Kindly drop a mail on ng-ontap-pstk-queries 

View solution in original post

6 REPLIES 6

saharsh
1,425 Views

Hi,

 

Can you please provide us the debug logs of the same, this will help us to understand the issue more efficiently.

You can enable the debug logs using Set-NatoolkitConfiguration debug command.

Arvato_HDI
1,417 Views

I'll try this. But I do not publish it here. Can I open a technical case for that?

Arvato_HDI
1,380 Views

I tried this.

Here is some output without confidential data (CLI-command with % char to blank names):

 
CLI-command:
s%%%%::> vserver cifs share show -vserver s%%%%%1 -share-name "%%%%%$"
 
                                      Vserver: s%%%%%1
                                        Share: %%%%%$
                     CIFS Server NetBIOS Name: S%%%%%%A
                                         Path: /%%%%%/%%%%
                             Share Properties: oplocks
                                               browsable
                                               changenotify
                                               show-previous-versions
                           Symlink Properties: symlinks
                      File Mode Creation Mask: -
                 Directory Mode Creation Mask: -
                                Share Comment: -
                                    Share ACL: BUILTIN\Administrators / Full Control
                                               BUILTIN\Users / Change
                                               Everyone / Full Control
more %%%%%
                File Attribute Cache Lifetime: -
                                  Volume Name: %%%%%%
                                Offline Files: manual
                Vscan File-Operations Profile: no-scan
            Maximum Tree Connections on Share: 4294967295
                   UNIX Group for File Create: -
 
Lines from Powershell output:
 
from connect-nccontroller (successfully):
2024-04-12 11:27:53,058 DEBUG NetApp.Ontapi.OntapiUtils - [Request URL]: https://clustername/api/private/cli/system/node/virtual-machine/instance/show-settings?fields=consumer
2024-04-12 11:27:53,074 DEBUG DataONTAP.C.PowerShell.SDK.ConnectNcController - [500]: This API is unsupported on this platform
2024-04-12 11:27:53,074 DEBUG DataONTAP.C.PowerShell.SDK.ConnectNcController - Filer connection type is:CLUSTER
2024-04-12 11:27:53,074 DEBUG DataONTAP.C.PowerShell.SDK.ConnectNcController - Setting value of global:CurrentNcController
 
From the last lines of connect-nccontroller:
2024-04-12 11:27:53,417 DEBUG NetApp.Ontapi.OntapiUtils - [Response StatusCode]: OK
2024-04-12 11:27:53,511 DEBUG NetApp.Ontapi.OntapiUtils - [Request Method]: GET
2024-04-12 11:27:53,511 DEBUG NetApp.Ontapi.OntapiUtils - [Request URL]: https://clustername/api/network/ip/interfaces?fields=scope&ip.address=clustername
2024-04-12 11:27:53,527 DEBUG DataONTAP.C.PowerShell.SDK.ConnectNcController - Failed to complete EMS logging
System.Net.WebException: The remote server returned an error: (400) Bad Request.
 
 
2024-04-12 11:29:24,088 DEBUG DataONTAP.C.PowerShell.SDK.NcRestInterface - [Request Method]: GET
2024-04-12 11:29:24,103 DEBUG DataONTAP.C.PowerShell.SDK.NcRestInterface - [Request URL]: https://clustername/api/protocols/cifs/shares?svm.name=vservame&fields=**
2024-04-12 11:29:24,135 DEBUG DataONTAP.C.PowerShell.SDK.NcRestInterface - [Response StatusCode]: OK
2024-04-12 11:29:24,150 DEBUG
(shortened:)
DataONTAP.C.PowerShell.SDK.NcRestInterface - [Response]: {
  "records": [
    {
      "svm": {
      "unix_symlink": "local",
      "acls": [
      ],
      "volume": {
      },
      "vscan_profile": "standard",
      "_links": {
        "self": {
        }
      }
    },

 

It's strange that NetApp.Ontapi.OntapiUtils is mentioned here.

 

Kind regards,

Holger

saharsh
1,013 Views

Please drop a mail on ng-ontap-pstk-queries 

saharsh
815 Views

Hello Holger,

 

Please send us the debug logs using Set-NatoolkitConfiguration debug command it will help us to understand the problem. Kindly drop a mail on ng-ontap-pstk-queries 

KevinMDavis
297 Views

Hello @saharsh 

Can you please explain why, since this is a "community", that this "accepted solution" was taken offline and not shown here??
I'm using PSTK 9.15, and clearly, this stuff is STILL broken.  Trying to run Add-NcCifsShare with the parameters that are clearly defined in 'get-help' as " This parameter is supported with Rest only", and NONE of them are set, and they fail SILENTLY.  I found another thread here that was years-old where the OP described essentially the same thing when running PSTK 9.12, and the solution was to downgrade PSTK.  That's not a solution. Or is the doco for this kit what's broken, in that it tells users to do things that are clearly broken.  When I attempted first to use the -ShareProperties parameter, I received the error "Add-NcCifsShare: ShareProperties parameter specified, which is not supported for REST call".  Ok, then I'll use the parameters defined in 'get-help' as "This parameter is supported with Rest only".  They all fail miserably, and silently. -Oplocks, -ChangeNotify, -ShowSnapshot.  Every one is a big, fat NOPE. I then tried to use Connect-NcController with the -ApplicationName to ONTAPI or HTTPS to try the -ShareProperties parameter, yet still receive the RestApi error.  What gives?

Public