{"id":915,"date":"2015-05-27T16:38:49","date_gmt":"2015-05-27T21:38:49","guid":{"rendered":"http:\/\/www.gamescheat.ca\/?p=915"},"modified":"2019-09-04T19:57:39","modified_gmt":"2019-09-05T00:57:39","slug":"915","status":"publish","type":"post","link":"http:\/\/www.gamescheat.ca\/?p=915","title":{"rendered":"Configure VMware Datastore Multipath Policy by Disk Type"},"content":{"rendered":"<p>Here is a VMware vSphere PowerClI script that will find all datastores that are of the model Hitachi \u2013 Open-V, set the multipath policy to RoundRobin if it is anything else.<\/p>\n<blockquote><div style=\"float: right;\"><div style=\"margin: 15px 15px 15px 15px\";><script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"pub-3319935785736004\";\ngoogle_alternate_color = \"FFFFFF\";\ngoogle_ad_width = 200;\ngoogle_ad_height = 200;\ngoogle_ad_format = \"200x200_as\";\ngoogle_ad_type = \"text_image\";\ngoogle_ad_channel =\"\";\ngoogle_color_border = \"cccccc\";\ngoogle_color_link = \"cc0000\";\ngoogle_color_bg = \"ffffff\";\ngoogle_color_text = \"000000\";\ngoogle_color_url = \"008000\";\n\/\/--><\/script>\n<script type=\"text\/javascript\"\n  src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><\/div><\/div><p>$clustername = \u2018clustersomething\u2019<br \/>\n$datastore = get-datastore<\/p>\n<p># Find datastores by HITACHI, model OPEN-V and multipath not RoundRobin and Change to RoundRobin<br \/>\n$disks = get-cluster $clustername | get-vmhost | get-scsilun -luntype disk | where {$_.Vendor -eq \u201cHITACHI\u201d -And $_.Model -eq \u201cOPEN-V\u201d -And $_.MultipathPolicy -ne \u201cRoundRobin\u201d} | Set-ScsiLun -MultipathPolicy \u201cRoundRobin\u201d<\/p>\n<p>#Test the policy for one ESX host<br \/>\n#$disks = get-vmhost esx-host-name | get-scsilun -luntype disk | where {$_.Vendor -eq \u201cHITACHI\u201d -And $_.Model -eq \u201cOPEN-V\u201d -And $_.MultipathPolicy -ne \u201cRoundRobin\u201d} | Set-ScsiLun -MultipathPolicy \u201cRoundRobin\u201d<\/p>\n<p>$entry = @()<br \/>\n$output = @()<br \/>\nForEach ($disk in $disks){<\/p>\n<p>$disk | Export-Csv .\\disk.txt<\/p>\n<p>  $entry = \u201c\u201d | Select DataStorename, HostName, Canonicalname, Multipathing<br \/>\n  $entry.datastorename= $datastore | Where-Object {($_.extensiondata.info.vmfs.extent | %{$_.diskname}) -contains $disk.canonicalname}|select -expand name<br \/>\n  $entry.HostName = $disk.VMHost.Name<br \/>\n  $entry.canonicalname=$disk.canonicalname<br \/>\n  $entry.multipathing=$disk.multipathpolicy<br \/>\n  $output += $entry<br \/>\n}<br \/>\n$output | Export-csv \u2018c:\\apply-multipath-result.csv\u2019<\/p>\n<p>#Write result to screen<br \/>\n#write-output $output<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Here is a VMware vSphere PowerClI script that will find all datastores that are of the model Hitachi \u2013 Open-V, set the multipath policy to RoundRobin if it is anything else. $clustername = \u2018clustersomething\u2019 $datastore = get-datastore # Find datastores&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/www.gamescheat.ca\/?p=915\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[83],"_links":{"self":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/915"}],"collection":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=915"}],"version-history":[{"count":6,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/915\/revisions"}],"predecessor-version":[{"id":935,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/915\/revisions\/935"}],"wp:attachment":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=915"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}