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!