{"id":1110,"date":"2015-07-27T13:44:23","date_gmt":"2015-07-27T17:44:23","guid":{"rendered":"http:\/\/www.hoplawego.com\/blog\/?p=1110"},"modified":"2015-07-27T13:46:49","modified_gmt":"2015-07-27T17:46:49","slug":"qui-bouffe-mon-stockage","status":"publish","type":"post","link":"https:\/\/www.hoplawego.com\/blog\/qui-bouffe-mon-stockage\/","title":{"rendered":"Qui bouffe mon stockage?"},"content":{"rendered":"<p>Qui bouffe mon stockage?<\/p>\n<p>voici un petit script vraiment utile pour conna\u00eetre la consommation de bande passante stockage sur les VMs.<\/p>\n<p>J&rsquo;utilise des filtres (dossiers, datastores, etc) pour colliger les donn\u00e9es.<br \/>\nLes \u00ab\u00a0vm_data\u00a0\u00bb sont des filtres que j&rsquo;utilise pour aller chercher des endroits sp\u00e9cifiques, comme les dossiers Management, Direction, etc.<\/p>\n<h6>#Nombre de jour en arriere pour les stats<br \/>\n$daysback = -1<\/h6>\n<h6>#nom des filtres. il faut ajouter ou soustraire ensuite)<br \/>\n$vm_data = read-host \u00ab\u00a0Filter name 1\u00a0\u00bb<br \/>\n#$vm_data2 = read-host \u00ab\u00a0Filter name 2\u00a0\u00bb<br \/>\n#$vm_data3 = read-host \u00ab\u00a0Filter name 3\u00a0\u00bb<br \/>\n#$vm_data4 = read-host \u00ab\u00a0Filter name 4\u00a0\u00bb<br \/>\n#$vm_data5 = read-host \u00ab\u00a0Filter name 5\u00a0\u00bb<br \/>\n#$vm_data6 = read-host \u00ab\u00a0Filter name 6\u00a0\u00bb<br \/>\n#$vm_data7 = read-host \u00ab\u00a0Filter name 7\u00a0\u00bb<br \/>\n#$vm_data8 = read-host \u00ab\u00a0Filter name 8\u00a0\u00bb<br \/>\n#$vm_data9 = read-host \u00ab\u00a0Filter name 9\u00a0\u00bb<br \/>\n#$vm_data10 = read-host \u00ab\u00a0Filter name 10\u00a0\u00bb<\/h6>\n<h6>#D\u00e9cider comment on filtre les VMs&#8230;. par folder, datastore, etc<br \/>\n$vms = Get-Folder | where {($_.Name -like \u00ab\u00a0*$vm_data*\u00a0\u00bb )}| get-vm | where {$_.PowerState -eq \u00ab\u00a0PoweredOn\u00a0\u00bb }<br \/>\n#2 filtres<br \/>\n#$vms = Get-Folder | where {($_.Name -like \u00ab\u00a0*$vm_data*\u00a0\u00bb ) -or ($_.Name -like \u00ab\u00a0*$vm_data2*\u00a0\u00bb )}| get-vm | where {$_.PowerState -eq \u00ab\u00a0PoweredOn\u00a0\u00bb }<br \/>\n#10 filtres<br \/>\n#$vms = Get-Datastore | where {($_.Name -like \u00ab\u00a0*$vm_data*\u00a0\u00bb ) -or ($_.Name -like \u00ab\u00a0*$vm_data2*\u00a0\u00bb ) -or ($_.Name -like \u00ab\u00a0*$vm_data3*\u00a0\u00bb ) -or ($_.Name -like \u00ab\u00a0*$vm_data4*\u00a0\u00bb ) -or ($_.Name -like \u00ab\u00a0*$vm_data5*\u00a0\u00bb ) -or ($_.Name -like \u00ab\u00a0*$vm_data6*\u00a0\u00bb ) -or ($_.Name -like \u00ab\u00a0*$vm_data7*\u00a0\u00bb ) -or ($_.Name -like \u00ab\u00a0*$vm_data8*\u00a0\u00bb ) -or ($_.Name -like \u00ab\u00a0*$vm_data9*\u00a0\u00bb ) -or ($_.Name -like \u00ab\u00a0*$vm_data10*\u00a0\u00bb )}| get-vm | where {$_.PowerState -eq \u00ab\u00a0PoweredOn\u00a0\u00bb }<\/h6>\n<h6>write-host ( \u00ab\u00a0{0,-70}`t{1,8}`t{2,8}`t{3,8}`t{4,8}\u00a0\u00bb -f \u00ab\u00a0VM\u00a0\u00bb, \u00ab\u00a0WIOPSavg\u00a0\u00bb, \u00ab\u00a0RIOPSavg\u00a0\u00bb, \u00ab\u00a0WIOPSmax\u00a0\u00bb, \u00ab\u00a0RIOPSmax\u00a0\u00bb ) `<br \/>\n; $vms | sort | % {<br \/>\n$wval = (((Get-Stat $_ -stat \u00ab\u00a0datastore.numberWriteAveraged.average\u00a0\u00bb -Start (Get-Date).adddays($daysback) -Finish (Get-Date) ) | select -expandproperty Value) | measure -average -max);<br \/>\n$rval = (((Get-Stat $_ -stat \u00ab\u00a0datastore.numberReadAveraged.average\u00a0\u00bb -Start (Get-Date).adddays($daysback) -Finish (Get-Date) ) | select -expandproperty Value) | measure -average -max);<br \/>\nwrite-host ( \u00ab\u00a0{0,-70}`t{1,8:N2}`t{2,8:N2}`t{3,8:N2}`t{4,8:N2}\u00a0\u00bb -f $_.Name, $wval.average, $rval.average, $wval.maximum, $rval.maximum )<br \/>\n}<\/h6>\n","protected":false},"excerpt":{"rendered":"<p>Qui bouffe mon stockage? voici un petit script vraiment utile pour conna\u00eetre la consommation de bande passante stockage sur les VMs. J&rsquo;utilise des filtres (dossiers, datastores, etc) pour colliger les donn\u00e9es. Les \u00ab\u00a0vm_data\u00a0\u00bb sont des filtres que j&rsquo;utilise pour aller chercher des endroits sp\u00e9cifiques, comme les dossiers Management, Direction, etc. #Nombre de jour en arriere &hellip; <\/p>\n","protected":false},"author":1,"featured_media":1114,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,2,8],"tags":[],"class_list":["post-1110","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stockage","category-t-i","category-vmware","grid-sizer"],"_links":{"self":[{"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/posts\/1110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/comments?post=1110"}],"version-history":[{"count":4,"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/posts\/1110\/revisions"}],"predecessor-version":[{"id":1115,"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/posts\/1110\/revisions\/1115"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/media\/1114"}],"wp:attachment":[{"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/media?parent=1110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/categories?post=1110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hoplawego.com\/blog\/wp-json\/wp\/v2\/tags?post=1110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}