Microsoft Virtualization Discussions

Error When creating Flexclone through PS

brandon_hilyer

$Filer = "netappfiler2"
$narootpasswd = "randompass"
################################

$password = ConvertTo-SecureString "randompass" -AsPlainText -Force
$Cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "root",$password
Connect-NaController netappfiler2 -Credential $Cred

New-NaVolClone -ParentVolume /vol/aspdbdtvdr2 -CloneVolume /vol/eqxdbdr01_newb -Controller $Filer

the error I receive, its seems the controller connects but something else is going

New-NaVolClone : Incorrect credentials for netappfiler2.
At C:\Users\bhilyer\Desktop\script.ps1:11 char:15
+ New-NaVolClone <<<<  -ParentVolume /vol/aspdbdtvdr2 -CloneVolume /vol/eqxdbdr01_newb -Controller $Filer
    + CategoryInfo          : InvalidOperation: (NetApp.Ontapi.Filer.NaController:NaController) [New-NaVolClone], NaAuthException
    + FullyQualifiedErrorId : ApiException,DataONTAP.PowerShell.SDK.Cmdlets.Volume.NewNaVolClone

Thanks

1 REPLY 1

cknight

Hello, Brandon.  The value of $Filer in your code is just a string, which isn't what the -Controller argument of Toolkit cmdlets expects.  See this post for examples.

Try something more like this:

$FilerName = "netappfiler2"
$narootpasswd = "randompass"
################################

$password = ConvertTo-SecureString "randompass" -AsPlainText -Force
$Cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "root",$password
$Filer = Connect-NaController $FilerName -Credential $Cred

New-NaVolClone -ParentVolume /vol/aspdbdtvdr2 -CloneVolume /vol/eqxdbdr01_newb -Controller $Filer

Announcements
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