Subscribe

CDOT PowerShell toolkit 3.2.1 cmdlets

[ Edited ]

Hi All,

 

NetApp newbie here.

 

In the coming month we're going to implement CDOT in our environment, we're currently using the previous version and we have lots of scripts in Orchestrator that uses PowerShell toolkit for provisioning server storage. It's my tasks to review the old scripts we're using and to modify the scripts to adapt it to the new cmdlets introduced in PowerShell toolkit 3.2. I reviewed the documentation and release notes and found out that most of the command have been renamed (actually they set aliases on the psm1 file) to for example Get-Naxxx to Get-Ncxxx. But there are other cmdlets that I cannot find in PowerShell toolkit 3.2.1 like Get-NaSnapmirrorSchedule. while other cmdlets like Get-NaSystemInfo has been renamed to Get-NcNodeInfo in CDOT.


Is there any particular list of updated cmdlets or cmdlets that have been remove that I can review to be able to find out those old cmdlets that we cannot use when moving our scripts to CDOT? Or do I just need to modify the commands to use xxx-Ncxxx instead of xxx-Naxxx? 

 

Thanks in advance.

 

Regards,

gmf

 

Re: CDOT PowerShell toolkit 3.2.1 cmdlets

Hi,

 

You'll need to update your code to work with Clustered DataONTAP. The CmdLet names are *-nc*. This should give you a quick list of what CmdLets you have to work with

 

>Import-Module DataONTAP

>Get-Command -Module dataontap -Name *-nc* | Where-Object {$_.CommandType -eq "CmdLet"} | Select-Object -Property Name

 

And if there isn't an existing CmdLet to perform as a configuration task or query you can always use "Invoke-NcSsh". There are Functional and architecture differences between 7-Mode and cDOT, you will need to thrououghly review and update your code. If you have any trouble converting code to achieve the same results in cDOT as you are currently using on 7-Mode please post the code and i'll take a look.

 

/matt 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: CDOT PowerShell toolkit 3.2.1 cmdlets

[ Edited ]

Thanks for the quick response Matt. 

 

I'll review the codes in our script and report any cmdlets from 7-mode that do not have same capability in cDOT.

 

Regards,

gmf

Re: CDOT PowerShell toolkit 3.2.1 cmdlets

Hi,

 

What is the equivalent cmdlet for Set-NaSnapshotSchedule on cDOT? Is it Set-NcSnapshotPolicySchedule?

 

Thanks in advance.

 

gmf

Re: CDOT PowerShell toolkit 3.2.1 cmdlets

The replacement for set-nasnapshotschedule isn't as straight forward. 

 

#Read in volume template to variable $readobj

$readobj = get-ncvol -Template

$readobj.Name = "volume"

$readobj.Vserver = "vserver"

$readobj

 

 

############ Write the volume attributes back

$writeobj=get-ncvol -Template

Initialize-NcObjectProperty $writeobj VolumeSnapshotAttributes

$writeobj.VolumeSnapshotAttributes.SnapshotPolicy=”snapshot_policy”

$writeobj

#Updates the volume in $readobj with the snapshot policy from $writeobj

update-NcVol -query $readobj -Attributes $writeobj

 

 

 

 

Re: CDOT PowerShell toolkit 3.2.1 cmdlets

Thanks for the quick response.

 

I modified our orchestrator runbook scripts to add support for the cDOT, I replace the 7mode cmdlets with the cDOT counterpart by referencing the Data ONTAP PowerShell toolkit release notes and comparing the 7mode cmdlets with the cDOT cmdlets. I basically replaced the following 7mode cmdlets with the cDOT counterpart, can you please check if there are any cmdlets here that is not a direct replacements when implementing cDOT?

 

 

Add-NaLunMap                        Add-NcLunMap
Connect-NaController             Connect-NcController
Get-NaSystemInfo                   Get-NcNodeInfo
Get-NaAggr                              Get-NcAggr
Get-NaVol                                Get-NcVol
Get-NaLun                                Get-NcLun
Get-NaQtree                            Get-NcQtree
Get-NaIgroup                           Get-NcIgroup
New-NaVol                               New-NcVol
New-NaQtree                           New-NcQtree
New-NaLun                               New-NcLun
Set-NaVolOption                      Set-NcVolOption
Set-NaSnapshotReserve          Set-NcSnapshotReserve
Set-NaVolAutosize                   Set-NcVolAutosize
Set-NaSnapshotAutodelete     Set-NcSnapshotAutodelete
Set-NaLunComment                 Set-NcLunComment
Set-NaVol                                 Set-NcVol

 

 

Thanks in advance.

 

 

gmf

Re: CDOT PowerShell toolkit 3.2.1 cmdlets

You'll need to add the -vserver parameter for each CDOT command.  There may be other differences between each individual command.  If you don't have access to a CDOT cluster for testing, you may want to look into setting up the CDOT simulator for testing:

 

http://mysupport.netapp.com/NOW/cgi-bin/simulator

 

 

Re: CDOT PowerShell toolkit 3.2.1 cmdlets

 

We now have a cluster simulator so I can play with it. I'm not the one who created our scripts for 7mode and I don't have advance knowledge regarding NetApp but my PowerShell skills is advance so I can understand what the 7mode scripts are trying to do. With regards to vserver I only find about it when reading the PowerShell toolkit release notes, can you point me to a documentation regarding vserver to be able to find out what it's all about?

Thanks billy.

 

 

Regards,

gmf

Re: CDOT PowerShell toolkit 3.2.1 cmdlets

Some of the parameters have been renamed like for example in New-NaLun -Type parameter, in CDOT this parameter has been renamed to -OsType. I'm reviewing each 7mode cmdlets including their parameters when replacing it with the CDOT cmdlets counterpart. 

Re: CDOT PowerShell toolkit 3.2.1 cmdlets

The cmdlets I need to replace is Set-NaSnapshotSchedule which is shown below:

# Snapshot schedule (space delimited cron format, <WeekliesToRetain> <DailiesToRetain> <HourliesToRetain>@<Which,Hours>)
# Assumes all schedule components are specified
$SchduleRetainWeeks = $SnapshotSchedule.split(" ")[0]
$SchduleRetainDays = $SnapshotSchedule.split(" ")[1]
$SchduleRetainHours = $SnapshotSchedule.split(" ")[2].split("@")[0]
$SchduleHourlyTimes = $SnapshotSchedule.split("@")[1]
Set-NaSnapshotSchedule -TargetName $VolumeName -Hours $SchduleRetainHours -Days $SchduleRetainDays -Weeks $SchduleRetainWeeks -WhichHours $SchduleHourlyTimes | Out-Null

 

On you sample solution, I cannot see where to define the schedule for hours, days and weeks. How can I define that using update-NcVol?

 

From our CDOT simulator I can query the volume and get the VolumeSnapshotAttributes, but how can I set the SnapshotPolicy property on this and what is the value that the cmdlet is expecting?

5/7/2015 1:58:55 PM [6] Monad P:\> Get-NcVol | select -ExpandProperty VolumeSnapshotAttributes


AutoSnapshotsEnabled :
NcController : 10.127.135.70
SnapdirAccessEnabled : True
SnapshotCloneDependencyEnabled : False
SnapshotCount :
SnapshotPolicy :
AutoSnapshotsEnabledSpecified : False
SnapdirAccessEnabledSpecified : True
SnapshotCloneDependencyEnabledSpecified : True
SnapshotCountSpecified : False

 

 

Thanks in advance.

 

gmf