Microsoft Virtualization Discussions

Error When creating Flexclone through PS

brandon_hilyer
2,634 Views

$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
2,634 Views

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

Public