I have come across something interesting when creating FlexGroup volumes. When I create the FlexGroup volume using the New-NcVol command, I get errors when trying to set particulars on the volume. I error I get is "Modification not permitted. Volime is mixed.
However, when I use Invoke-NcSsh to create the FlexGroup volume I can set particulars on the volume without any errors. Examples of the code are below:
If I execute the code below I get the following erros when using the "Set" commandlets.
Set-NcVolOption : Modification not permitted. Volume is mixed.
Set-NcSnapshotReserve : Modification not permitted. Volume is mixed
Write-Host (Get-Date).ToLongTimeString() "...Attempting to create " -NoNewline; Write-Host $x.dataSet1 -ForegroundColor 'Yellow' -NoNewline; Write-Host " Volume: " -NoNewline; Write-Host $newVol -ForegroundColor Green
#Invoke-NcSsh "volume create -vserver $nfsvserver -volume $newvol -aggr-list $aggr1name,$aggr2name -aggr-list-multiplier 2 -size "$x.volumesize" -junction-path $jpath" -ErrorVariable volError
New-NcVol -Name $newvol -FlexGroupVolume -AggregateList $aggr1name,$aggr2name -VserverContext $nfsVserver -AggregateMultiplier 2 -JunctionPath $jpath -Size $x.volumeSize -ErrorVariable volError -ErrorAction stop
Invoke-NcSsh volume modify -vserver $nfsVserver -volume $newvol -snapshot-policy none
Invoke-NcSsh snapshot delete -vserver $nfsVserver -volume $newvol -snapshot *
Invoke-NcSSH volume efficiency on -vserver $nfsVserver -volume $newvol
Set-NcVolOption $newVol -VserverContext $nfsVserver fractional_reserve 0 -ErrorVariable +nDeployError #sets volume fractional reserve
Set-NcSnapshotReserve $newvol -VserverContext $nfsvserver 0
Set-NcVolOption $newvol guarantee none -VserverContext $nfsvserver -ErrorVariable +nDeployError
If I comment out the "New-NcVol" line and execute the script with the "Invoke-NcSsh" line above, there are no issues.
I found this behavior odd, and perhaps I missed something in the commandlet's abilities.