Microsoft Virtualization Discussions

Volume encryption details in PowerShell Toolkit

ibkl4
3,428 Views

Hi everybody

I try to create a script that shows all volumes and the encryption details. Currently I'm using the following command:

 

get-NcVol | select vserver, name, aggregate, encrypt

 

I couldn't figure out how to display the "encryption-state" (something like:  vol show -volume * -fields encrypt, encryption-state). Does anybody have an idea how to get this data?

I'm using Ontap 9.5 and PowerShell Toolkit 9.6.

 

 

1 ACCEPTED SOLUTION

donny_lang
3,396 Views

Looks like the "volume-encryption-get-iter" API was removed in newer versions of the ONTAPI for some reason, which I believe is the reason that error is generated.

 

Here is ONTAPI v1.130 (an older version):

 

1.13.png

And here is ONTAPI v.1.160 (a newer version - notice how the API doesn't exist. I checked the cluster-level API too, not there either):

 

1.16.png

 

I haven't been able to find an alternative way to get the data other than using the "Invoke-NcSsh" command to run the ONTAP CLI commands manually. Hopefully it can be fixed in future versions.

View solution in original post

3 REPLIES 3

donny_lang
3,398 Views

The "Status" property from the "Get-NcVolumeEncryption" cmdlet looks like what you are looking for; unfortunately, I'm not able to confirm that 100% because the couple machines running the PSTK 9.6 that I've tried to run the command on complain that they aren't able to find the necessary API to run the command, but hopefully you'll have better luck than I did. 🙂 

donny_lang
3,397 Views

Looks like the "volume-encryption-get-iter" API was removed in newer versions of the ONTAPI for some reason, which I believe is the reason that error is generated.

 

Here is ONTAPI v1.130 (an older version):

 

1.13.png

And here is ONTAPI v.1.160 (a newer version - notice how the API doesn't exist. I checked the cluster-level API too, not there either):

 

1.16.png

 

I haven't been able to find an alternative way to get the data other than using the "Invoke-NcSsh" command to run the ONTAP CLI commands manually. Hopefully it can be fixed in future versions.

ibkl4
3,330 Views

I found a solution:

Get-NcVol | Select-Object -Property vserver,name,aggregate,state,@{Label = "Node"; expression = {$_.VolumeIdAttributes.Node}},encrypt,@{Label = "encryption-state"; expression = {(Get-NcVolumeEncryptionConversion -Vserver $_.vserver -Volume $_.name).status}}

Public