Microsoft Virtualization Discussions

New-NcSisPolicy in Powershell Toolkit 4.6

renem
3,627 Views

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. 

 

1 ACCEPTED SOLUTION

renem
3,554 Views

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

View solution in original post

4 REPLIES 4

renem
3,555 Views

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

JGPSHNTAP
3,551 Views
<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

renem
3,538 Views

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

JGPSHNTAP
3,552 Views

^^

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

 

 

Public