Software Development Kit (SDK) and API Discussions

Modifying Volume Tiering Policy With Update-NcVol Failing

danflashes
1,179 Views

I've seen a few posts regarding the 'Update-NcVol' cmdlet and how it can be problematic. I've also attempted the multiple syntaxes that I've come across, however each attempt has resulted in failing to update the object.  I'm hoping someone might be able review the following snippet and let me know if there are any potential issues with it or another way to update the tiering policy (short of using  Invoke-SSH).  This syntax was taken directly from the Get-Help page for the cmdlet. Thanks!

 

Environment:

PSVersion: 5.1.14393.5127

CLRVersion: 4.0.30319.42000

DataonTap Version : 9.10.1.2111

 

$q = Get-NcVol -Template

Initialize-NcObjectProperty $q VolumeIdAttributes
$q.VolumeIdAttributes.Name = "vol1"
$q.VolumeIdAttributes.OwningVserverName = "svm_0"

$a = Get-NcVol -Template

Initialize-NcObjectProperty $a VolumeCompAggrAttributes
$a.VolumeCompAggrAttributes.TieringPolicy = "all"
Update-NcVol -Query $q -Attributes $a

 

Output :

SuccessCount : 0
FailureCount : 1
SuccessList  : {}
FailureList  : {vol1}

 

1 ACCEPTED SOLUTION

mbeattie
1,135 Views

Hi Dan,

 

That's odd, the code worked fine when testing it in my lab.

 

$Credential = Get-Credential -Credential admin
Connect-NcController -Name cluster1.testlab.local -HTTPS -Credential $Credential

$q = Get-NcVol -Template

Initialize-NcObjectProperty $q VolumeIdAttributes
$q.VolumeIdAttributes.Name = "cifs_data_001"
$q.VolumeIdAttributes.OwningVserverName = "vserver1"

$a = Get-NcVol -Template

Initialize-NcObjectProperty $a VolumeCompAggrAttributes
$a.VolumeCompAggrAttributes.TieringPolicy = "all"
Update-NcVol -Query $q -Attributes $a

Output:
Name                 Address           Vserver              Version                                                                                                                                                  
----                 -------           -------              -------                                                                                                                                                  
cluster1.testlab.... 192.168.100.2                          NetApp Release 9.10.1: Sat Jan 15 10:49:44 UTC 2022                                                                                                      

NcController : cluster1.testlab.local
SuccessCount : 1
FailureCount : 0
SuccessList  : {cifs_data_001}
FailureList  : {}

 

Have you tried the same operation using the REST API? Assuming it works fine using the CLI?

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

1 REPLY 1

mbeattie
1,136 Views

Hi Dan,

 

That's odd, the code worked fine when testing it in my lab.

 

$Credential = Get-Credential -Credential admin
Connect-NcController -Name cluster1.testlab.local -HTTPS -Credential $Credential

$q = Get-NcVol -Template

Initialize-NcObjectProperty $q VolumeIdAttributes
$q.VolumeIdAttributes.Name = "cifs_data_001"
$q.VolumeIdAttributes.OwningVserverName = "vserver1"

$a = Get-NcVol -Template

Initialize-NcObjectProperty $a VolumeCompAggrAttributes
$a.VolumeCompAggrAttributes.TieringPolicy = "all"
Update-NcVol -Query $q -Attributes $a

Output:
Name                 Address           Vserver              Version                                                                                                                                                  
----                 -------           -------              -------                                                                                                                                                  
cluster1.testlab.... 192.168.100.2                          NetApp Release 9.10.1: Sat Jan 15 10:49:44 UTC 2022                                                                                                      

NcController : cluster1.testlab.local
SuccessCount : 1
FailureCount : 0
SuccessList  : {cifs_data_001}
FailureList  : {}

 

Have you tried the same operation using the REST API? Assuming it works fine using the CLI?

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public