Active IQ Unified Manager Discussions

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

stephzylstra
3,456 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
3,435 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
3,436 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
3,399 Views

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

Public