Array Setup and Networking
1752701 Members
5896 Online
108789 Solutions
New Discussion

Re: Viewing volume encryption status for array

 
SOLVED
Go to solution
geoffh58
New Member

Viewing volume encryption status for array

A unusual request I suspect, Is there a way to generate a results output to display confirmation that every volume has encryption enabled. 


I know this is unavailable from the volumes page but is available if you ‘drill’ into the details of each individual volume.  Don’t particularly wish to do this for over 1000 volumes!


Via the cli vol –list does not provide it however vol –info <vol name> does – Is there a way you can perform this across every volume?

 

3 REPLIES 3
rshekar42
Advisor
Solution

Re: Viewing volume encryption status for array

You could take a look at REST APIs that are available in 2.3.


More details in this post: Nimble OS 2.3 – REST API


By updating the query to include a filter for volumes with encryption_cipher=none, you can make a list of any volumes that dont have encryption enabled. Here's the full script:





###########################


# Enable HTTPS


###########################



[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}



###########################


# Get Token


###########################



$array = "<ARRAY>"


$username = "admin"


$password = "<PASSWORD>"




$data = @{


      username = $username


      password = $password


}



$body = convertto-json (@{ data = $data })



$uri = "https://" + $array + ":5392/v1/tokens"


$token = Invoke-RestMethod -Uri $uri -Method Post -Body $body


$token = $token.data.session_token



###########################


# Get Volume List


###########################



$header = @{ "X-Auth-Token" = $token }


$uri = "https://" + $array + ":5392/v1/volumes?encryption_cipher=none"


$volume_list = Invoke-RestMethod -Uri $uri -Method Get -Header $header


$vol_array = @();



foreach ($volume_id in $volume_list.data.id){



      $uri = "https://" + $array + ":5392/v1/volumes/" + $volume_id


      $volume = Invoke-RestMethod  -Uri $uri -Method Get -Header $header


      $vol_array += $volume.data



}



###########################


# Print Results


###########################



$vol_array | sort-object name | select name,size,encryption_cipher | format-table -autosize


geoffh58
New Member

Re: Viewing volume encryption status for array

That's excellent - Totally forgot about the ability to perform this in the API

s-sakthivel
Occasional Visitor

Re: Viewing volume encryption status for array

I used the below today

(1) Download and install Powershell modules for Nimble
https://infosight.hpe.com/InfoSight/media/software/active/15/205/HPENimblePowerShellToolkit.210.zip

(2) Then

 

Connect-NSGroup -group <my-nimble-ip>  -credential admin -IgnoreServerCertificate
Get-NSVolume   |select Name, Vol_state, encryption_cipher

 



This looks far simpler