NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Active IQ Unified Manager Discussions

Powershell Update-NcVol requests flexgroup volume despite volume attributes being supplied

stephzylstra
4,630 Views

Hi,

 

I am writing a script to automatically apply various snapshot policies to volumes. All is working fine until I try to actually apply the policy to the volume using Update-NcVol - at this point, it prompts me for a FlexGroupVolume, despite teh fact that volume attributes were passed to the query.

 

My script is like this currently:

 

$scheduleObjects = Get-Content -Raw -Path "schedules.json" | ConvertFrom-Json
Connect-NcController "x.x.x.x"

foreach($scheduledBackup in $scheduleObjects) {
    $volumeName = $scheduledBackup | Select -ExpandProperty Volume
$datastoreName = $scheduledBackup | Select -ExpandProperty Datastore
$vserverName = $scheduledBackup | Select -ExpandProperty Vserver ## Processing creation of policies and schedules snipped for brevity ##
## I end up with a policy being created in the NA which is named $datastoreName ##

$q = Get-NcVol -Template Initialize-NcObjectProperty -Object $q -Name VolumeIdAttributes $q.VolumeIdAttributes.Name = $volumeName $q.VolumeIdAttributes.OwningVserverName = $vserverName $q.Name = $volumeName $q.Vserver = $vserverName $a = Get-NcVol -Template Initialize-NcObjectProperty -Object $a -Name VolumeSnapshotAttributes $a.VolumeSnapshotAttributes.SnapshotPolicy = $datastoreName Update-NcVol -Query $q -Attributes $a }

 

However, instead of applying the policy, I get a prompt:

 

cmdlet Update-NcVol at command pipeline position 1
Supply values for the following parameters:
FlexGroupVolume: 

 

 

Any help would be appreciated!

 

Thanks!

1 ACCEPTED SOLUTION

stephzylstra
4,609 Views

The issue was worked around by adding the flex group volume parameter into the command as $false. This appears to be a bug with the current powershell release as per https://community.netapp.com/t5/Microsoft-Cloud-and-Virtualization-Discussions/NetApp-PowerShell-Toolkit-4-3-released/td-p/123976

View solution in original post

2 REPLIES 2

stephzylstra
4,610 Views

The issue was worked around by adding the flex group volume parameter into the command as $false. This appears to be a bug with the current powershell release as per https://community.netapp.com/t5/Microsoft-Cloud-and-Virtualization-Discussions/NetApp-PowerShell-Toolkit-4-3-released/td-p/123976

JGPSHNTAP
4,573 Views

Glad you found it.. I was going to reply as well :$false

Public