Microsoft Virtualization Discussions

Start-NaNdmpCopy cmdlet questions

madden
9,864 Views

Hi,

In the Start-NaNdmpCopy cmdlet we have this parameter:

    -SrcAuthType <NdmpMessageAuthType>

        Authentication type to use when authenticating connection to source cont

        roller.  Possible values: text, md5, none.  Default is none.

       

        Required?                    false

        Position?                    named

        Default value               

        Accept pipeline input?       false

        Accept wildcard characters?  false

What exactly is 'none'?  How is this different than 'text'?

Also for the level parameter I see this:

    -Level <Int32>

        The incremental level to be used for the transfer is restricted to 0, 1

        or 2 only. The default level used is 0.

       

        Required?                    false

        Position?                    named

        Default value               

        Accept pipeline input?       false

        Accept wildcard characters?  false

The ndmpcopy binary from ndmpcopy.org  supports 0-9.  Is there a reason why the cmdlet also only supports 0-2 (coincedentally the same as the ndmpcopy in Data ONTAP 7-mode)?  Could it be adapted easily to support higher levels?

Thanks!

Chris

11 REPLIES 11

beam
9,831 Views

Hi Chris,

What exactly is 'none'?  How is this different than 'text'?

'None' performs no authentication whereas 'text' performs plaintext authentication.  The -SrcAuthType and -DstAuthType parameters should be either 'text' or 'md5' in most cases.

Is there a reason why the cmdlet also only supports 0-2 (coincedentally the same as the ndmpcopy in Data ONTAP 7-mode)?  Could it be adapted easily to support higher levels?

The cmdlet can be updated to support 0-9.

Thanks,

Steven

paulhar
9,831 Views

Yes, please aupport all levels (0-9) and/or support multiple uses of levels >0 (e.g. run several level 1s) so that we can simulate "incremental forever".

danekantner
9,831 Views

I'm having troubles getting this to work as expected, but I'm wondering a few things as well... I'm actually trying to just do a simple test for synchronous transfer with invoke and not having much luck.

I'm attempting to test existence of files on a file system, typically I guess this would live outside of the DataOnTap toolkit, but there isn't necessarily a direct correlation in scripting between the data I'm trying to test and the filer shares. I considered creating a temporary hidden share for testing the existence of folders in a given location, but then I run into needing the one user running this script to have access to all of said locations.  I probably will end up doing that anyway, but I also would like to figure out this ndmpcopy in powershell as I use it often in CLI.

My initial thought on testing whether a given directory exists was to do an ndmpcopy -whatif locally to either a temp location or madeup location... the -whatif saving the actual copy from maybe happening. But I can't even get that simple test to work.

The src and dstcontroller parameters are asking for an IP address. Everything else is working w/ IP name of controller or the vfiler. I tried IP name and it error out stating it cannot convert it to a system.net.IPAddress.  I obviously can convert an IP name to address, manually or in a script, and provide that address instead. But the next issue is authentication. I'd like to use my stored NA-Credentials. The documentation implies leaving out the authentication and specifying text or MD5 authentication will lead to it checking my stored cache.  It does seem to do this, but not exactly....  the stored cache obviously refers to IP names and not IP numbers.  So I really have to store the same credentials twice?  If I can convert in a script IP name to address, why can't the toolkit when it goes to look for stored credentials? Why would we be encouraged to store an IP address over IP names anyway? Is there any way to alias existing credentials onto other controller names? I'm guessing not?  (the lack of it seems a bit redundant... if I'm not using RPC I'm probably using same or similar credentials on multiple systems, why not just allow a list of systems to share the same credentials under the add-nacredential? --obviously allowing someone to add an extra alias after the fact is a security concern, but at run time of initial add-nacredential it doesn't seem like it would matter? Is this a toolkit future need to explore?

In the scenario of a local/local copy...  invoke-ndmpcopy doesn't seem to allow me to not specify source/destination filer controllers. Is that correct?  I can't do beam's simple    ndmpcopy -l 0 /vol/1 /vol/2 ...  I tried even when I had an active NA-connection sitting global, though there's no reference anywhere that it would use that anyway.  Architecturally, is there a technical reason why the toolkit couldn't use a stored connection to pass on for authentication? Is it that a local to local connection is rarely used, so the other options are always going to come into play anyway, or is there more to it? How can I make this work?  I could invoke-ssh I suppose and more or less get what I need maybe, but I'm thinking I have to be missing something more obvious?

beam
9,831 Views

Thanks for the feedback.  I'll try to answer your questions as best as I can.

The src and dstcontroller parameters are asking for an IP address. Everything else is working w/ IP name of controller or the vfiler. I tried IP name and it error out stating it cannot convert it to a system.net.IPAddress.  I obviously can convert an IP name to address, manually or in a script, and provide that address instead.

The SrcController and DstController parameters are both System.Net.IpAddress.  You will have to resolve your hostnames to IP addresses before calling Start/Invoke-NaNdmpCopy.  I think it would be a worthwhile upgrade to the cmdlet to be able to accept hostnames as well.

The documentation implies leaving out the authentication and specifying text or MD5 authentication will lead to it checking my stored cache.  It does seem to do this, but not exactly....  the stored cache obviously refers to IP names and not IP numbers.

Yes, I see the issue here.  If you have constructed your credentials cache using the hostnames instead of IP addresses, the NDMP cmdlets will not be able to find the proper credentials.  Storing the credentials twice would resolve the issue; however, I understand why that may be a hassle.  If the NDMP cmdlets were updated to support hostnames as well as IP addresses, this wouldn't be an issue since you would be able to specify the source and destination controllers in whatever form they are stored as in the credentials cache.

Invoke-ndmpcopy doesn't seem to allow me to not specify source/destination filer controllers. Is that correct?

This is correct.  You must specify both source and destination controllers.  Keep in mind that the Toolkit is acting as a basic NDMP client--connecting to the NDMP service on both the source and destination and orchestrating the operation.  The connection contexts used are not the same as the connection contexts used to execute the APIs that most other Toolkit cmdlets use.  Would we be able to extract enough information from $currentNaController to establish an NDMP connection?  Yes, in the case of a direct 7-Mode connection, enough information is available to connect to the NDMP service in most cases.  However, for vfiler connections (both tunneled and direct), and any connections to clustered ONTAP, there just isn't enough information to reliably make a connection.  With that being said, I think it makes sense to make the destination controller parameter optional for simplicity in the case that the source and destination are the same.

Once again, thanks for the feedback.  I have put 3 items to improve the NDMP cmdlets for consideration in a future release:  1) accept source and destination hostnames as well as IP addresses, 2) make the credential lookup more intelligent, and 3) make the destination controller parameter optional for the case of local copies.

-Steven

pdean
9,831 Views

Is the below an indication of windows host running the powershell having the ports closed, as I've performed in out lab the same without issue, it shouldn't matter which host you've connect to to do this right?

Start-NaNdmpCopy : Exception from ndmp message DATA_CONNECT: Invalid or missing response.

At line:1 char:17

+ Start-NaNdmpCopy <<<<  -SrcController 10.23.225.106 -SrcPath "/vol/vol_cmdcmbxmex004_mbxdb_4/.snapshot/2013-07-08_0047+1000_weekly_SnapMgr_Exchange_CMDCMBX-M

EX004_nwdcdsa-fas031_vol_cmdcmbxmex004_mbxdb_4_.-.qt_mbxdb003_4.qt_mbx/qt_mbxdb015_4/lun_mbxdb015_4" -DstController 10.22.253.179 -DstPath "/vol/vol_cmdcmbxmex

005_recovery/qt_recoverydb_r" -SrcCredential root -DstCredential root -SrcAuthType md5 -DstAuthType md5

    + CategoryInfo          : InvalidOperation: (:) [Start-NaNdmpCopy], NdmpMessageException

    + FullyQualifiedErrorId : NdmpError,DataONTAP.PowerShell.SDK.Cmdlets.Ndmp.StartNaNdmpCopy

If I change SrcIP I get a different message, using anothe IP from the same controller.

Start-NaNdmpCopy : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed be

cause connected host has failed to respond 10.23.24.117:10000

BrendonHiggins
8,275 Views

I have been having problems with the "Invoke-NaNdmpCopy" and was able to get everything working with some simple but not known to me fixes.

  1. Could ping the vfiler but unable to log on with Powershell.  - Solved by turning on http admin, so powershell could connect.  "options httpd.admin.enable on"
  2. Use the NDMPD version 4 password which is different!    - Get the correct local NDMP password using "ndmpd password a_name version 4"

Powershell NDMP copies now work for me between two different systems.

Hope it helps

Bren

skiser
9,831 Views

I'm not sure if this helps, but below is an example of how I'm using NDMP copy in a VM restore script.  The script leverages SnapRestore if you select the local Filer to restore from.  If you select a DR Filer to restore from, it switches over to NDMP copy.  I had the script prompt for the root password of the Filer if you selected a DR Filer so I didn't have to store it in the script.  These commands are from several different functions, but I believe this is all the commands required for this to run in our scenario.  I tried Invoke-NaNdmpCopy, but I wasn't having much luck.  Therefore I switched to the Start-NaNdmpCopy cmdlet.  I also had to use public IPs, not those of our non-routed storage network.

$user = "root"

$pass = Read-Host -AsSecureString "Enter the Filer root password"

$global:cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user,$pass

$filer1 = Connect-NaController $MyFiler | Out-Null

$global:Source_IP_Pub = Get-NaNetInterface | Where {($_.PrimaryAddresses -like "192.128.1*") -or ($_.PrimaryAddresses -like "192.130.1*")} | Select PrimaryAddresses | ForEach {$_.PrimaryAddresses}

Start-NaNdmpCopy -SrcController $Source_IP_Pub -SrcPath "/vol/$MyVol/.snapshot/$snapshot1/$vmDatastore/$vm2restore/$vm2restore-flat.vmdk" -DstController $Dest_IP_Pub -DstPath "$ProdPath/$vm2restore/" -SrcCredential $cred -DstCredential $cred -SrcAuthType md5 -DstAuthType md5 -Confirm:$false

Start-NaNdmpCopy -SrcController $Source_IP_Pub -SrcPath "/vol/$MyVol/.snapshot/$snapshot1/$vmDatastore/$vm2restore/$vm2restore.vmdk" -DstController $Dest_IP_Pub -DstPath "$ProdPath/$vm2restore/" -SrcCredential $cred -DstCredential $cred -SrcAuthType md5 -DstAuthType md5 -Confirm:$false

We don't do many NDMP copies, so I was able to use the Get-NaNdmpCopy cmdlet to know when to have the script move on.

Do {

                                                            Start-Sleep -Seconds 5

                                                            $ndmp = Get-NaNdmpCopy

                                                  }

                                                  While ($ndmp.State -eq "RUNNING")

madden
9,831 Views

If you just want to check the existence of a file or dir why not use the Get-NaFile cmdlet?

pdean
9,831 Views

Following is a script I wrote to use help test a semi graphical powershell to go and find LUN's, the volume and snapshot to prove it could be done.  One problem powershell 3.0 broke the script, it happily worked in Powershell 2. the way it broke it was to not hold the string varibles of the items you click on.

import-module DataONTAP

# TextBox for NetApp Server Name

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

$objForm = New-Object System.Windows.Forms.Form

$objForm.Text = "Controller Name for SnapVault NDMPCopy"

$objForm.Size = New-Object System.Drawing.Size(300,200)

$objForm.StartPosition = "CenterScreen"

$objForm.KeyPreview = $True

$objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")

    {$x=$objTextBox.Text;$objForm.Close()}})

$objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")

    {$objForm.Close()}})

$OKButton = New-Object System.Windows.Forms.Button

$OKButton.Location = New-Object System.Drawing.Size(75,120)

$OKButton.Size = New-Object System.Drawing.Size(75,23)

$OKButton.Text = "OK"

$OKButton.Add_Click({$NetAppController=$objTextBox.Text;$objForm.Close()})

$objForm.Controls.Add($OKButton)

$CancelButton = New-Object System.Windows.Forms.Button

$CancelButton.Location = New-Object System.Drawing.Size(150,120)

$CancelButton.Size = New-Object System.Drawing.Size(75,23)

$CancelButton.Text = "Cancel"

$CancelButton.Add_Click({$objForm.Close()})

$objForm.Controls.Add($CancelButton)

$objLabel = New-Object System.Windows.Forms.Label

$objLabel.Location = New-Object System.Drawing.Size(10,20)

$objLabel.Size = New-Object System.Drawing.Size(280,20)

$objLabel.Text = "Enter NWDCDSA-FAS031 or NWDCDSA-FAS032:"

$objForm.Controls.Add($objLabel)

$objTextBox = New-Object System.Windows.Forms.TextBox

$objTextBox.Location = New-Object System.Drawing.Size(10,40)

$objTextBox.Size = New-Object System.Drawing.Size(260,20)

$objForm.Controls.Add($objTextBox)

$objForm.Topmost = $True

$objForm.AcceptButton = $OKButton

$objForm.Add_Shown({$objForm.Activate()})

$objTextBox.Select()

[void] $objForm.ShowDialog()

# TextBox for NetApp UserName for NetApp Server Name

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

$objForm = New-Object System.Windows.Forms.Form

$objForm.Text = "Access to $NetAppController"

$objForm.Size = New-Object System.Drawing.Size(300,200)

$objForm.StartPosition = "CenterScreen"

$objForm.KeyPreview = $True

$objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")

    {$x=$objTextBox.Text;$objForm.Close()}})

$objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")

    {$objForm.Close()}})

$OKButton = New-Object System.Windows.Forms.Button

$OKButton.Location = New-Object System.Drawing.Size(75,120)

$OKButton.Size = New-Object System.Drawing.Size(75,23)

$OKButton.Text = "OK"

$OKButton.Add_Click({$NetAppAccessUserName=$objTextBox.Text;$objForm.Close()})

$objForm.Controls.Add($OKButton)

$CancelButton = New-Object System.Windows.Forms.Button

$CancelButton.Location = New-Object System.Drawing.Size(150,120)

$CancelButton.Size = New-Object System.Drawing.Size(75,23)

$CancelButton.Text = "Cancel"

$CancelButton.Add_Click({$objForm.Close()})

$objForm.Controls.Add($CancelButton)

$objLabel = New-Object System.Windows.Forms.Label

$objLabel.Location = New-Object System.Drawing.Size(10,20)

$objLabel.Size = New-Object System.Drawing.Size(280,20)

$objLabel.Text = "Username for access:"

$objForm.Controls.Add($objLabel)

$objTextBox = New-Object System.Windows.Forms.TextBox

$objTextBox.Location = New-Object System.Drawing.Size(10,40)

$objTextBox.Size = New-Object System.Drawing.Size(260,20)

$objForm.Controls.Add($objTextBox)

$objForm.Topmost = $True

$objForm.AcceptButton = $OKButton

$objForm.Add_Shown({$objForm.Activate()})

$objTextBox.Select()

[void] $objForm.ShowDialog()

connect-naController -Name $NetAppController -Credential $NetAppAccessUserName

#ListBox for Displaying LUN's on Above Controller

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

$objForm = New-Object System.Windows.Forms.Form

$objForm.Text = "Restoring which Exchange Database"

$objForm.Size = New-Object System.Drawing.Size(600,600)

$objForm.StartPosition = "CenterScreen"

$objForm.KeyPreview = $True

$objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")

    {$x=$objListBox.SelectedItem;$objForm.Close()}})

$objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")

    {$objForm.Close()}})

$OKButton = New-Object System.Windows.Forms.Button

$OKButton.Location = New-Object System.Drawing.Size(75,520)

$OKButton.Size = New-Object System.Drawing.Size(75,23)

$OKButton.Text = "OK"

$OKButton.Add_Click({$SourceLUNPath=$objListBox.SelectedItem;$objForm.Close()})

$OKButton.Is

$objForm.Controls.Add($OKButton)

$CancelButton = New-Object System.Windows.Forms.Button

$CancelButton.Location = New-Object System.Drawing.Size(150,520)

$CancelButton.Size = New-Object System.Drawing.Size(75,23)

$CancelButton.Text = "Cancel"

$CancelButton.Add_Click({$objForm.Close()})

$objForm.Controls.Add($CancelButton)

$objLabel = New-Object System.Windows.Forms.Label

$objLabel.Location = New-Object System.Drawing.Size(10,20)

$objLabel.Size = New-Object System.Drawing.Size(280,20)

$objLabel.Text = "Select the LUN Path for Recovery:"

$objForm.Controls.Add($objLabel)

$objListBox = New-Object System.Windows.Forms.ListBox

$objListBox.Location = New-Object System.Drawing.Size(10,40)

$objListBox.Size = New-Object System.Drawing.Size(260,20)

$objListbox.Height = 480

$objListBox.Width = 500

get-NaLun |Where-Object {($_.Path -match "srvexch") -AND ($_.Path -match "mbxdb")} | foreach {

    $_.Path

    [void] $objListBox.Items.Add($_.Path)

}

$objForm.Controls.Add($objListBox)

$objForm.Topmost = $True

$objForm.AcceptButton = $OKButton

$objForm.Add_Shown({$objForm.Activate()})

[void] $objForm.ShowDialog()

Write-Host ($SourceLUNPath) -foregroundcolor red -backgroundcolor yellow

#Break Up Soure LUN Path

$SourceLUNDetails = @($SourceLUNPath -split("/"))

#ListBox for Snapshot's on above Source LUN Path

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

$objForm = New-Object System.Windows.Forms.Form

$objForm.Text = "SnapShots For Exchange Database "

$objForm.Size = New-Object System.Drawing.Size(700,600)

$objForm.StartPosition = "CenterScreen"

$objForm.KeyPreview = $True

$objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")

    {$x=$objListBox.SelectedItem;$objForm.Close()}})

$objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")

    {$objForm.Close()}})

$OKButton = New-Object System.Windows.Forms.Button

$OKButton.Location = New-Object System.Drawing.Size(75,520)

$OKButton.Size = New-Object System.Drawing.Size(75,23)

$OKButton.Text = "OK"

$OKButton.Add_Click({$SourceLUNVolumeSnapshot=$objListBox.SelectedItem;$objForm.Close()})

$OKButton.Is

$objForm.Controls.Add($OKButton)

$CancelButton = New-Object System.Windows.Forms.Button

$CancelButton.Location = New-Object System.Drawing.Size(150,520)

$CancelButton.Size = New-Object System.Drawing.Size(75,23)

$CancelButton.Text = "Cancel"

$CancelButton.Add_Click({$objForm.Close()})

$objForm.Controls.Add($CancelButton)

$objLabel = New-Object System.Windows.Forms.Label

$objLabel.Location = New-Object System.Drawing.Size(10,20)

$objLabel.Size = New-Object System.Drawing.Size(280,20)

$objLabel.Text = "Select the LUN Path for Recovery:"

$objForm.Controls.Add($objLabel)

$objListBox = New-Object System.Windows.Forms.ListBox

$objListBox.Location = New-Object System.Drawing.Size(10,40)

$objListBox.Size = New-Object System.Drawing.Size(260,20)

$objListbox.Height = 480

$objListBox.Width = 650

get-NaSnapShot $SourceLUNDetails[2] | foreach {

    $_.Name

    [void] $objListBox.Items.Add($_.Name)

}

$objForm.Controls.Add($objListBox)

$objForm.Topmost = $True

$objForm.AcceptButton = $OKButton

$objForm.Add_Shown({$objForm.Activate()})

[void] $objForm.ShowDialog()

Write-Host ($SourceLUNVolumeSnapshot) -foregroundcolor red -backgroundcolor yellow

$NDMPcopySourcePath = "/"+$SourceLUNDetails[1]+"/"+$SourceLUNDetails[2]+"/"+$SourceLUNDetails[3]+"/.snapshot/"+$SourceLUNVolumeSnapshot+"/"+$SourceLUNDetails[4]

Get-NaSnapvaultSecStatus |where-object{$_.Secondary -match ($SourceLUNDetails[3])} |foreach{

    $DestinationNDMPcopyNetApp = @($_.Primary -split(":"))

}

$FQDNDstController = $DestinationNDMPcopyNetApp[0]+".sydlab.netapp.au"

$NDMPcopySrcController = $CurrentNaController.Address.IPAddressToString

$NDMPcopyDstController = [System.Net.Dns]::GetHostEntry($FQDNDstController).AddressList[0].IPAddressToString

$NDMPcopyDestinationPath = "/vol/vol_srvexch11svc_recoverydb"

# TextBox for NDMPCopy User Name

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

$objForm = New-Object System.Windows.Forms.Form

$objForm.Text = "Username For NDMPCopy"

$objForm.Size = New-Object System.Drawing.Size(300,200)

$objForm.StartPosition = "CenterScreen"

$objForm.KeyPreview = $True

$objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")

    {$x=$objTextBox.Text;$objForm.Close()}})

$objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")

    {$objForm.Close()}})

$OKButton = New-Object System.Windows.Forms.Button

$OKButton.Location = New-Object System.Drawing.Size(75,120)

$OKButton.Size = New-Object System.Drawing.Size(75,23)

$OKButton.Text = "OK"

$OKButton.Add_Click({$NDMPUsername=$objTextBox.Text;$objForm.Close()})

$objForm.Controls.Add($OKButton)

$CancelButton = New-Object System.Windows.Forms.Button

$CancelButton.Location = New-Object System.Drawing.Size(150,120)

$CancelButton.Size = New-Object System.Drawing.Size(75,23)

$CancelButton.Text = "Cancel"

$CancelButton.Add_Click({$objForm.Close()})

$objForm.Controls.Add($CancelButton)

$objLabel = New-Object System.Windows.Forms.Label

$objLabel.Location = New-Object System.Drawing.Size(10,20)

$objLabel.Size = New-Object System.Drawing.Size(280,20)

$objLabel.Text = "Enter NWDCDSA-FAS031 or NWDCDSA-FAS032:"

$objForm.Controls.Add($objLabel)

$objTextBox = New-Object System.Windows.Forms.TextBox

$objTextBox.Location = New-Object System.Drawing.Size(10,40)

$objTextBox.Size = New-Object System.Drawing.Size(260,20)

$objForm.Controls.Add($objTextBox)

$objForm.Topmost = $True

$objForm.AcceptButton = $OKButton

$objForm.Add_Shown({$objForm.Activate()})

$objTextBox.Select()

[void] $objForm.ShowDialog()

$NDMPSrcCredential = $NDMPUsername

$NDMPDstCredential = $NDMPUsername

$NDMPcopyLogSourcePath = $NDMPcopySourcePath -replace "mbxdb", "mbxlog"

$NDMPcopyLogDestinationPath = $NDMPcopyDestinationPath -replace "recoverydb", "recoverylog"

#Log NDMP Copy

$NDMPCopyCommand = "Start-NaNdmpCopy -SrcController "+$NDMPcopySrcController+" -SrcPath "+$NDMPcopyLogSourcePath+" -DstController "+$NDMPcopyDstController+" -DstPath "+$NDMPcopyLogDestinationPath+" -SrcCredential "+$NDMPSrcCredential+" -DstCredential "+$NDMPDstCredential+" -SrcAuthType md5 -DstAuthType md5"

Write-Host ($NDMPCopyCommand) -foregroundcolor red -backgroundcolor yellow

Start-NaNdmpCopy -SrcController $NDMPcopySrcController -SrcPath $NDMPcopyLogSourcePath -DstController $NDMPcopyDstController -DstPath $NDMPcopyLogDestinationPath -SrcCredential $NDMPSrcCredential -DstCredential $NDMPDstCredential -SrcAuthType md5 -DstAuthType md5

#Database NDMP Copy

$NDMPCopyCommand = 'Invoke-NaNdmpCopy -SrcController '+$NDMPcopySrcController+' -SrcPath '+$NDMPcopySourcePath+' -DstController '+$NDMPcopyDstController+' -DstPath '+$NDMPcopyDestinationPath+' -SrcCredential '+$NDMPSrcCredential+' -DstCredential '+$NDMPDstCredential+' -SrcAuthType md5 -DstAuthType md5'

Write-Host ($NDMPCopyCommand) -foregroundcolor red -backgroundcolor yellow

Invoke-NaNdmpCopy -SrcController $NDMPcopySrcController -SrcPath $NDMPcopySourcePath -DstController $NDMPcopyDstController -DstPath $NDMPcopyDestinationPath -SrcCredential $NDMPSrcCredential -DstCredential $NDMPDstCredential -SrcAuthType md5 -DstAuthType md5

danekantner
9,830 Views

Very good question.  I didn't know that command existed.  I just wrote 800 lines of code to do what I wanted and it's all accessing it via CIFS/UNC path, which I imagine is quite slower than querying locally via get-nafile. On top of that it's requiring me to have security access to these files, so between the slowness and that I was just beginning to figure out a way to split up the work into helper scripts that report the needed data back to the main. 

I just searched and even the newest document "making the most of the data ontap powershell module" document put out by NetApp has zero mentions of the get-nafile command. It was my understanding that this was their only real documentation on the toolkit aside of going through Posh help files manually. Is there something else somewhere that I'm missing?

Now I'm kind of annoyed.

W/ the new 3.0 toolkit, though, they did rehash the NDMP command and implemented the changes mentioned above, specifically the credentials issues I was having. Haven't tested yet

"The NDMP copy cmdlets (Start-NaNdmpCopy and Invoke-NaNdmpCopy) use the credentials cache to look up credentials to use to authenticate the NDMP session when no credentials are given in the cmdlet parameters.  Before Toolkit 3.0, the credentials would only be looked up based on the IP addresses supplied in the cmdlet parameters.  If the credentials are stored by hostname, the cmdlet would not find them and the NDMP session would not successfully authenticate.  With Toolkit 3.0, the NDMP copy cmdlets will look up the credentials based on the IP addresses given and the hostnames associated with the IP addresses.

Prior to Toolkit 3.0, both SrcController and DstController were required parameters on Start-NaNdmpCopy and Invoke-NaNdmpCopy.  In Toolkit 3.0, DstController is no longer required.  If the DstController parameter is omitted, the cmdlet uses the SrcController as the destination.

PS C:\Toolkit\3.0> Invoke-NaNdmpCopy -SrcController 10.61.169.29 -SrcPath /vol/vol2/cifs/dynamic.vhdx -DstPath /vol/powershell/vol2dst -SrcAuthType md5 -DstAuthType md5

"

beam
8,274 Views

The making the most of document highlights the new features of a release of the Data ONTAP PowerShell Toolkit.  For documentation on all available cmdlets in the module, check out the online help (Show-NaHelp).  You can also look through the available cmdlets using Get-NaCommand (for 7-Mode cmdlets) and Get-NcCommand (for clustered ONTAP cmdlets).

-Steven

Public