Microsoft Virtualization Discussions
Microsoft Virtualization Discussions
Want to create an automatic threshold based efficiency policy.
New-NcSisPolicy -VserverContext svm_renem1 -name automatic -PolicyType threshold -QosPolicy background
New-NcSisPolicy : Cannot bind argument to parameter 'Schedule' because it is an empty string.
New-NcSisPolicy -VserverContext svm_renem1 -name automatic -PolicyType threshold -QosPolicy background -Schedule 'daily'
New-NcSisPolicy : Parameter 'Schedule' is supported only for policy type 'scheduled'.
The option schedule is unfortunately mandatory.
Solved! See The Solution
Until this is fixed I use a workaround. Since the Invoke-NcSsh use plink.exe and have trouble with TLS only I don't like this cmdlet anymore. My solution is based on the cmdlet Invoke-NcSystemApi
$Vserver = "svm_renem1"
$PolicyName = "Test"
$PolicyType = "threshold"
$Percent = "45"
$Qos = "background"
$Enable = "true"
$Request = @"
<sis-policy-create>
<policy-name>$PolicyName</policy-name>
<policy-type>$PolicyType</policy-type>
<changelog-threshold-percent>$Percent</changelog-threshold-percent>
<qos-policy>$Qos</qos-policy>
<enabled>$Enable</enabled>
</sis-policy-create>
"@
Invoke-NcSystemApi -VserverContext $Vserver -Request $Request -ErrorAction Stop
- Rene
Until this is fixed I use a workaround. Since the Invoke-NcSsh use plink.exe and have trouble with TLS only I don't like this cmdlet anymore. My solution is based on the cmdlet Invoke-NcSystemApi
$Vserver = "svm_renem1"
$PolicyName = "Test"
$PolicyType = "threshold"
$Percent = "45"
$Qos = "background"
$Enable = "true"
$Request = @"
<sis-policy-create>
<policy-name>$PolicyName</policy-name>
<policy-type>$PolicyType</policy-type>
<changelog-threshold-percent>$Percent</changelog-threshold-percent>
<qos-policy>$Qos</qos-policy>
<enabled>$Enable</enabled>
</sis-policy-create>
"@
Invoke-NcSystemApi -VserverContext $Vserver -Request $Request -ErrorAction Stop
- Rene
<changelog-threshold-percent>$Percent</changelog-threshold-percent>
You call it out in your API, but see above post. I agree that the cmdlet should be a little more informative
In my point of view there is no reason why the ChangelogThresholdPercent should be a mandatory option.
ONTAP set this option by default to 20.
Also the API option <changelog-threshold-percent> is optional and not mandatory.
A redesign of this cmdlet should be necessary
^^
This is because you need to add
-ChangelogThresholdPercent
new-ncsispolicy -VserverContext testvserver -name automatic -QosPolicy background -PolicyType threshold -ChangelogThresholdPercent 20
-ChangelogThresholdPercent <Int32>
Percentage at which the changelog will be processed for a policy type 'threshold', tested once each hour. Range [1..100].
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false