{"id":755,"date":"2022-05-08T19:42:03","date_gmt":"2022-05-08T18:42:03","guid":{"rendered":"http:\/\/192.168.8.14\/?p=755"},"modified":"2022-05-08T19:42:46","modified_gmt":"2022-05-08T18:42:46","slug":"netapp-disk-model-and-firmware-reporting","status":"publish","type":"post","link":"https:\/\/www.jasonstreet.com\/?p=755","title":{"rendered":"NetApp disk model and firmware reporting"},"content":{"rendered":"\n<p>Some times you want a quick report of the disk types and firmware versions with the number of disks on each version. <\/p>\n\n\n\n<p>Recently NetApp put out a billiton about older disk firmware failing more often that they should. I was given the task of making sure all our disks where OK. To archive that I had to update a lot of disks. The process is straight forward and I may do a post about that. But once you have uploaded the necessary firmwares you may need to keep track of the progress.  <\/p>\n\n\n\n<p>So here is a quick script i made in to a function<\/p>\n\n\n\n<p>It basically gets an array of all the disks<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>gets all the disks in to an array<\/li><li>creates a array of all unique disk models<\/li><li>loops through the disk model array and gets firmware versions in to another array<\/li><li>now loops through the firmware array getting the number of disks at that version<\/li><\/ul>\n\n\n\n<p>so you end up with something this<\/p>\n\n\n\n<p>Disk model 100, firmware 100, disks 5<br>Disk model 100, firmware 101, disks 2<br>Disk model 103, firmware 105, disks 10<br>Disk model 103, firmware 106, disks 50<\/p>\n\n\n\n<p>Using this I can quickly see what model disks are on what version of firmware. I run it after the I uploaded the firmware to track the upgrade process.<\/p>\n\n\n\n<p>So here is the script<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nimport-module posh-ssh\n\n$cred = Get-Credential\n$AFF = &quot;MyFAS.lab.local&quot;\n\n$Connection = Connect-NcController $AFF -Cred $Cred\n\n\nfunction Get-NCdiskFirmwares\n{\n    $Disks = get-ncdisk\n\n    # get a n array of unique disk models\n    $diskMods = $Disks.model | sort -Unique\n\n    # loop through each disk model\n    foreach ($diskMod in $diskMods)\n    {\n        # get an array of disk of the current model\n        $FWversionDisks = $Disks | where{$_.model -eq $diskMod}\n\n        # get an array of all the unique firmware versions\n        $FWVersions = $FWversionDisks.FW | sort -Unique\n\n        # loop though each firmware version\n        foreach ($FWVersion in $FWVersions)\n        {\n            # get an array of the current model and current firmware version and count the number of disks, print it to the screen\n            $NumDisks = ($Disks | where{$*.model -eq $diskMod -and $*.FW -eq $FWVersion}).count\n            &quot;disks, model &quot; + $diskMod + &quot; , FW  &quot; + $FWVersion + &quot; , number &quot; + $NumDisks\n        }\n    }\n}\n<\/pre><\/div>\n\n\n<p>now run the function and you will get a list of the number of disks at a specific model and firmware version.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nGet-NCdiskFirmwares\n\ndisks, model X4002S172A3T8NTE , FW NA02 , number 22\ndisks, model X4002S172A3T8NTE , FW NA03 , number 14\ndisks, model X4011S172B3T8NTE , FW NA54 , number 24\ndisks, model X4011S17333T8NTE , FW NA50 , number 47\ndisks, model X4011S17333T8NTE , FW NA51 , number 15\ndisks, model X4016S172B3T8NTE , FW NA54 , number 12\n<\/pre><\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some times you want a quick report of the disk types and firmware versions with the number of disks on each version. Recently NetApp put out a billiton about older disk firmware failing more often that they should. I was given the task of making sure all our disks where OK. To archive that I&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[58,59,4],"tags":[94,159,17,160,60,13],"class_list":["post-755","post","type-post","status-publish","format-standard","hentry","category-netapp","category-ontap","category-powershell","tag-disks","tag-firmware","tag-function","tag-model","tag-netapp","tag-powershell"],"_links":{"self":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts\/755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=755"}],"version-history":[{"count":6,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts\/755\/revisions"}],"predecessor-version":[{"id":761,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts\/755\/revisions\/761"}],"wp:attachment":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}