2 Replies Latest reply: Oct 13, 2015 9:07 AM by geoffh RSS

    Viewing volume encryption status for array

    geoffh Newbie

      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?

       

        • Re: Viewing volume encryption status for array
          Raja Shekar Chelur Adventurer

          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