<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hypervisor.fr &#187; VMFS</title>
	<atom:link href="http://www.hypervisor.fr/?feed=rss2&#038;tag=vmfs" rel="self" type="application/rss+xml" />
	<link>http://www.hypervisor.fr</link>
	<description>French Bare-Metal weblog</description>
	<lastBuildDate>Wed, 26 Jun 2024 22:42:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[PSH] Les alarmes de datastore qui manquent à vCenter (par cluster)</title>
		<link>http://www.hypervisor.fr/?p=4039</link>
		<comments>http://www.hypervisor.fr/?p=4039#comments</comments>
		<pubDate>Fri, 10 Aug 2012 07:09:04 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[SAN]]></category>
		<category><![CDATA[SIOC]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VMFS]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=4039</guid>
		<description><![CDATA[Suite à notre post sur la création d&#8217;alarmes de latence pour les datastore, nous nous sommes aperçu que sur des environnements relativement important cela pouvait générer une quantité importante d&#8217;events inutiles. En effet, les alarmes étant créées à la &#8220;racine&#8221; du vCenter et propagées sur tous les hosts par héritage, il est fréquent de voir des events liés à [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Suite à <a href="http://www.hypervisor.fr/?p=3683" target="_blank">notre post sur la création d&#8217;alarmes de latence pour les datastore</a>, nous nous sommes aperçu que sur des environnements relativement important cela pouvait <strong>générer une quantité importante d&#8217;events inutiles</strong>. En effet, les alarmes étant créées à la <strong>&#8220;racine&#8221; du vCenter</strong> et propagées sur tous les hosts par héritage, il est fréquent de voir des events liés à une alarme (green&gt;gray et gray&gt;green lors d&#8217;un reboot par exemple) d&#8217;un datastore n’existant pas sur l&#8217;ESX en question. Nous avons donc modifiés nos onliner pour que les alarmes soient créées à la <strong>&#8220;racine&#8221; des cluster</strong> et comme le nom d&#8217;une alarme doit être unique, nous y avons rajouté le nom du cluster :</p>
<p>Alarme de <strong>latence Read ou Write pour datastore partagé NFS par cluster</strong>, yellow 300ms/5min et red 500ms/3min (mailto:admin@vmware.local) :</p>
<pre class="brush: powershell; title: ; notranslate">foreach ($vicluster in Get-View -ViewType ClusterComputeResource) {foreach ($dsname in ($vicluster.Datastore|%{Get-View $_}|?{$_.summary.Accessible -and $_.summary.MultipleHostAccess -and $_.info.nas})){if (!((Get-View AlarmManager).GetAlarm($vicluster.moref)|?{(get-view $_).info.name -match &quot;Datastore $($dsname.name) datastore RW latency&quot;})){(Get-View AlarmManager).CreateAlarm($vicluster.moref,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;Datastore $($dsname.name) datastore RW latency in $($vicluster.name)&quot;;Description = &quot;Custom alarm to monitor NFS $($dsname.name) ($($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)) read or write latency in $($vicluster.name)&quot;;Enabled = $true;expression = (New-Object VMware.Vim.OrAlarmExpression -Property @{expression = @((New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;datastore&quot;}|?{$_.nameinfo.key -match &quot;totalReadLatency&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = ($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)});Operator = &quot;isAbove&quot;;Yellow = &quot;300&quot;;YellowInterval = &quot;300&quot;;Red = &quot;500&quot;;RedInterval = &quot;180&quot;;Type = &quot;HostSystem&quot;});(New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;datastore&quot;}|?{$_.nameinfo.key -match &quot;totalWriteLatency&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = ($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)});Operator = &quot;isAbove&quot;;Yellow = &quot;300&quot;;YellowInterval = &quot;300&quot;;Red = &quot;500&quot;;RedInterval = &quot;180&quot;;Type = &quot;HostSystem&quot;}))});Action=(New-Object VMware.Vim.GroupAlarmAction -Property @{Action= (New-Object VMware.Vim.AlarmTriggeringAction -Property @{Action = (New-Object VMware.Vim.SendEmailAction -Property @{ToList = &quot;admin@vmware.local&quot;;Subject = &quot;[vAlarm] $($dsname.name) RW latency on {targetName}&quot;;CcList = &quot;&quot;;Body = &quot;&quot;});TransitionSpecs = @((New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;green&quot;;FinalState = &quot;yellow&quot;;Repeats = $false});(New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;yellow&quot;;FinalState = &quot;red&quot;;Repeats = $false}))})});ActionFrequency = &quot;1800&quot;}))}}}</pre>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/oneliner/alarm_nfs_latency_cluster.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/oneliner/alarm_nfs_latency_cluster.png" alt="" width="540" height="59" /></a></p>
<p>Alarme de <strong>latence Read ou Write pour datastore partagé VMFS par cluster</strong>, yellow 30ms/5min et red 40ms/3min (mailto:admin@vmware.local) :</p>
<pre class="brush: powershell; title: ; notranslate">foreach ($vicluster in Get-View -ViewType ClusterComputeResource) {foreach ($dsname in ($vicluster.Datastore|%{Get-View $_}|?{$_.summary.Accessible -and $_.summary.MultipleHostAccess -and $_.info.vmfs})){if (!((Get-View AlarmManager).GetAlarm($vicluster.moref)|?{(get-view $_).info.name -match &quot;Datastore $($dsname.name) RW latency in $($vicluster.name)&quot;})){(Get-View AlarmManager).CreateAlarm($vicluster.moref,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;Datastore $($dsname.name) RW latency in $($vicluster.name)&quot;;Description = &quot;Custom alarm to monitor VMFS $($dsname.name) ($($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)) read or write latency in $($vicluster.name)&quot;;Enabled = $true;expression = (New-Object VMware.Vim.OrAlarmExpression -Property @{expression = @((New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;datastore&quot;}|?{$_.nameinfo.key -match &quot;totalReadLatency&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = ($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)});Operator = &quot;isAbove&quot;;Yellow = &quot;30&quot;;YellowInterval = &quot;300&quot;;Red = &quot;40&quot;;RedInterval = &quot;180&quot;;Type = &quot;HostSystem&quot;});(New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;datastore&quot;}|?{$_.nameinfo.key -match &quot;totalWriteLatency&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = ($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)});Operator = &quot;isAbove&quot;;Yellow = &quot;30&quot;;YellowInterval = &quot;300&quot;;Red = &quot;40&quot;;RedInterval = &quot;180&quot;;Type = &quot;HostSystem&quot;}))});Action=(New-Object VMware.Vim.GroupAlarmAction -Property @{Action= (New-Object VMware.Vim.AlarmTriggeringAction -Property @{Action = (New-Object VMware.Vim.SendEmailAction -Property @{ToList = &quot;admin@vmware.local&quot;;Subject = &quot;[vAlarm] $($dsname.name) RW latency on {targetName}&quot;;CcList = &quot;&quot;;Body = &quot;&quot;});TransitionSpecs = @((New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;green&quot;;FinalState = &quot;yellow&quot;;Repeats = $false});(New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;yellow&quot;;FinalState = &quot;red&quot;;Repeats = $false}))})});ActionFrequency = &quot;1800&quot;}))}}}</pre>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/oneliner/alarm_vmfs_latency_cluster.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/oneliner/alarm_vmfs_latency_cluster.png" alt="" width="518" height="83" /></a></p>
<p>Alarme de <strong>latence SIOC Normalized Latency pour datastore partagé par cluster</strong>, yellow 30ms/5min et red 40ms/3min (mailto:admin@vmware.local) :</p>
<pre class="brush: powershell; title: ; notranslate">foreach ($vicluster in Get-View -ViewType ClusterComputeResource) {foreach ($dsname in ($vicluster.Datastore|%{Get-View $_}|?{$_.summary.Accessible -and $_.summary.MultipleHostAccess -and $_.IormConfiguration.Enabled})){if (!((Get-View AlarmManager).GetAlarm($vicluster.moref)|?{(get-view $_).info.name -match &quot;Datastore $($dsname.name) SIOC Normalized Latency in $($vicluster.name)&quot;})){(Get-View AlarmManager).CreateAlarm($vicluster.moref,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;Datastore $($dsname.name) SIOC Normalized Latency in $($vicluster.name)&quot;;Description = &quot;Custom alarm to monitor $($dsname.name) ($($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)) datastore SIOC Normalized Latency in $($vicluster.name)&quot;;Enabled = $true;expression = (New-Object VMware.Vim.OrAlarmExpression -Property @{expression = @((New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;datastore&quot;}|?{$_.nameinfo.key -match &quot;sizeNormalizedDatastoreLatency&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = ($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)});Operator = &quot;isAbove&quot;;Yellow = &quot;30000&quot;;YellowInterval = &quot;300&quot;;Red = &quot;40000&quot;;RedInterval = &quot;180&quot;;Type = &quot;HostSystem&quot;}))});Action=(New-Object VMware.Vim.GroupAlarmAction -Property @{Action= (New-Object VMware.Vim.AlarmTriggeringAction -Property @{Action = (New-Object VMware.Vim.SendEmailAction -Property @{ToList = &quot;admin@vmware.local&quot;;Subject = &quot;[vAlarm] $($dsname.name) SIOC Normalized Latency on {targetName}&quot;;CcList = &quot;&quot;;Body = &quot;&quot;});TransitionSpecs = @((New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;green&quot;;FinalState = &quot;yellow&quot;;Repeats = $false});(New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;yellow&quot;;FinalState = &quot;red&quot;;Repeats = $false}))})});ActionFrequency = &quot;1800&quot;}))}}}</pre>
<p>Alarme de <strong>Disk Command aborts pour datastore VMFS partagé par cluster</strong>, en cas de défaillance/saturation DAS/SAN/iSCSI (mailto:admin@vmware.local) :</p>
<pre class="brush: powershell; title: ; notranslate">foreach ($vicluster in Get-View -ViewType ClusterComputeResource) {foreach ($diskname in ($vicluster.Datastore|%{Get-View $_}|?{$_.info.vmfs -and $_.summary.Accessible -and $_.summary.MultipleHostAccess}|%{$_.info.vmfs.extent}|%{$_.diskname})){if (!((Get-View AlarmManager).GetAlarm($vicluster.moref)|?{(get-view $_).info.name -match &quot;Disk $diskname command aborts&quot;})){(Get-View AlarmManager).CreateAlarm($vicluster.moref,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;Disk $diskname command aborts in $($vicluster.name)&quot;;Description = &quot;Custom alarm to monitor $diskname disk command aborts in $($vicluster.name)&quot;;Enabled = $true;expression = (New-Object VMware.Vim.OrAlarmExpression -Property @{expression = (New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;disk&quot;}|?{$_.nameinfo.key -match &quot;commandsAborted&quot;}|?{$_.GroupInfo.Key -ne &quot;virtualDisk&quot;}|?{$_.RollupType -match &quot;summation&quot;}).key;Instance = $diskname});Operator = &quot;isAbove&quot;;Yellow = &quot;1&quot;;Red = &quot;2&quot;;Type = &quot;HostSystem&quot;})});Action=(New-Object VMware.Vim.GroupAlarmAction -Property @{Action= (New-Object VMware.Vim.AlarmTriggeringAction -Property @{Action = (New-Object VMware.Vim.SendEmailAction -Property @{ToList = &quot;admin@vmware.local&quot;;Subject = &quot;[vAlarm] command aborts on disk $diskname on {targetName}&quot;;CcList = &quot;&quot;;Body = &quot;&quot;});TransitionSpecs = @((New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;green&quot;;FinalState = &quot;yellow&quot;;Repeats = $false});(New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;yellow&quot;;FinalState = &quot;red&quot;;Repeats = $true}))})});ActionFrequency = &quot;1800&quot;}))}}}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=4039</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[PSH] Les alarmes de datastore qui manquent à vCenter</title>
		<link>http://www.hypervisor.fr/?p=3683</link>
		<comments>http://www.hypervisor.fr/?p=3683#comments</comments>
		<pubDate>Mon, 05 Mar 2012 07:12:47 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[SAN]]></category>
		<category><![CDATA[SIOC]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VMFS]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3683</guid>
		<description><![CDATA[/!\ Attention /!\ : Ce post comporte des oneliner de plusieurs milliers de caractères qui pourraient heurter la sensibilité des jeunes scripteurs.
Ceux qui, comme nous, espéraient la voir arriver avec vSphere 5 ont été déçu. L&#8217;alarme de latence de datastore n’existe pas encore, pas en GUI du moins. Et pour cause, les compteurs de latence ne sont disponibles qu&#8217;au travers [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><strong>/!\ Attention /!\ : Ce post comporte des oneliner de <strong><span style="color: #ff0000;">plusieurs milliers de caractères</span></strong> qui pourraient heurter la sensibilité des jeunes scripteurs.</strong></p>
<p style="text-align: justify;">Ceux qui, comme nous, espéraient la voir arriver avec vSphere 5 ont été déçu. <strong>L&#8217;alarme de latence de datastore n’existe pas encore</strong>, pas en GUI du moins. Et pour cause, <a href="http://pubs.vmware.com/vsphere-50/index.jsp?topic=/com.vmware.wssdk.apiref.doc_50/datastore_counters.html" target="_blank">les compteurs de latence ne sont disponibles qu&#8217;au travers des objets VirtualMachine ou HostSystem (et HostSystem uniquement pour les compteurs SIOC)</a>. Nous vous avions proposé <a href="http://www.hypervisor.fr/?p=2468" target="_blank">une solution de contournement</a>, en PowerCLI évidement, grâce au compteur maxTotalLatency mais il restait encore à trouver quel datastore avait déclenché l&#8217;alarme.</p>
<p style="text-align: justify;">Aujourd&#8217;hui nous vous proposons une série de oneliner qui vont créer (si elles n’existent pas déjà, ce qui veut dire que vous pouvez les utiliser en tache planifiée) <strong>des alarmes pour chaque datastore </strong><strong>(instance = UUID)</strong><strong> qui se déclencheront si les seuils de latence fixés sont atteint sur un ESX</strong>. Attention ça pique.</p>
<p>Alarme de <strong>latence Read ou Write pour datastore partagé NFS</strong>, yellow 300ms/5min et red 500ms/3min (mailto:admin@vmware.local) :</p>
<pre class="brush: powershell; title: ; notranslate">foreach ($dsname in (Get-View -ViewType datastore|?{$_.summary.Accessible -and $_.summary.MultipleHostAccess -and $_.info.nas})){if (!((Get-View AlarmManager).GetAlarm((Get-Folder -NoRecursion |Get-View).moref)|?{(get-view $_).info.name -match &quot;$($dsname.name) datastore RW latency&quot;})){(Get-View AlarmManager).CreateAlarm((Get-Folder -NoRecursion |Get-View).MoRef,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;$($dsname.name) datastore RW latency&quot;;Description = &quot;Custom alarm to monitor NFS $($dsname.name) ($($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)) read or write latency&quot;;Enabled = $true;expression = (New-Object VMware.Vim.OrAlarmExpression -Property @{expression = @((New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;datastore&quot;}|?{$_.nameinfo.key -match &quot;totalReadLatency&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = ($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)});Operator = &quot;isAbove&quot;;Yellow = &quot;300&quot;;YellowInterval = &quot;300&quot;;Red = &quot;500&quot;;RedInterval = &quot;180&quot;;Type = &quot;HostSystem&quot;});(New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;datastore&quot;}|?{$_.nameinfo.key -match &quot;totalWriteLatency&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = ($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)});Operator = &quot;isAbove&quot;;Yellow = &quot;300&quot;;YellowInterval = &quot;300&quot;;Red = &quot;500&quot;;RedInterval = &quot;180&quot;;Type = &quot;HostSystem&quot;}))});Action=(New-Object VMware.Vim.GroupAlarmAction -Property @{Action= (New-Object VMware.Vim.AlarmTriggeringAction -Property @{Action = (New-Object VMware.Vim.SendEmailAction -Property @{ToList = &quot;admin@vmware.local&quot;;Subject = &quot;$($dsname.name) RW latency&quot;;CcList = &quot;&quot;;Body = &quot;&quot;});TransitionSpecs = @((New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;green&quot;;FinalState = &quot;yellow&quot;;Repeats = $false});(New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;yellow&quot;;FinalState = &quot;red&quot;;Repeats = $false}))})});ActionFrequency = &quot;1800&quot;}))}}</pre>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/oneliner/alarm_nfs_latency.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/oneliner/alarm_nfs_latency.png" alt="" width="462" height="90" /></a></p>
<p>Alarme de <strong>latence Read ou Write pour datastore partagé VMFS</strong>, yellow 30ms/5min et red 40ms/3min (mailto:admin@vmware.local) :</p>
<pre class="brush: powershell; title: ; notranslate">foreach ($dsname in (Get-View -ViewType datastore|?{$_.summary.Accessible -and $_.summary.MultipleHostAccess -and $_.info.vmfs})){if (!((Get-View AlarmManager).GetAlarm((Get-Folder -NoRecursion |Get-View).moref)|?{(get-view $_).info.name -match &quot;$($dsname.name) datastore RW latency&quot;})){(Get-View AlarmManager).CreateAlarm((Get-Folder -NoRecursion |Get-View).MoRef,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;$($dsname.name) datastore RW latency&quot;;Description = &quot;Custom alarm to monitor VMFS $($dsname.name) ($($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)) read or write latency&quot;;Enabled = $true;expression = (New-Object VMware.Vim.OrAlarmExpression -Property @{expression = @((New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;datastore&quot;}|?{$_.nameinfo.key -match &quot;totalReadLatency&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = ($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)});Operator = &quot;isAbove&quot;;Yellow = &quot;30&quot;;YellowInterval = &quot;300&quot;;Red = &quot;40&quot;;RedInterval = &quot;180&quot;;Type = &quot;HostSystem&quot;});(New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;datastore&quot;}|?{$_.nameinfo.key -match &quot;totalWriteLatency&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = ($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)});Operator = &quot;isAbove&quot;;Yellow = &quot;30&quot;;YellowInterval = &quot;300&quot;;Red = &quot;40&quot;;RedInterval = &quot;180&quot;;Type = &quot;HostSystem&quot;}))});Action=(New-Object VMware.Vim.GroupAlarmAction -Property @{Action= (New-Object VMware.Vim.AlarmTriggeringAction -Property @{Action = (New-Object VMware.Vim.SendEmailAction -Property @{ToList = &quot;admin@vmware.local&quot;;Subject = &quot;$($dsname.name) RW latency&quot;;CcList = &quot;&quot;;Body = &quot;&quot;});TransitionSpecs = @((New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;green&quot;;FinalState = &quot;yellow&quot;;Repeats = $false});(New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;yellow&quot;;FinalState = &quot;red&quot;;Repeats = $false}))})});ActionFrequency = &quot;1800&quot;}))}}</pre>
<p>Alarme de <strong>latence SIOC Normalized Latency pour datastore partagé</strong>, yellow 30ms/5min et red 40ms/3min (mailto:admin@vmware.local) :</p>
<pre class="brush: powershell; title: ; notranslate">foreach ($dsname in (Get-View -ViewType datastore|?{$_.summary.Accessible -and $_.summary.MultipleHostAccess -and $_.IormConfiguration.Enabled})){if (!((Get-View AlarmManager).GetAlarm((Get-Folder -NoRecursion |Get-View).moref)|?{(get-view $_).info.name -match &quot;$($dsname.name) datastore SIOC Normalized Latency&quot;})){(Get-View AlarmManager).CreateAlarm((Get-Folder -NoRecursion |Get-View).MoRef,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;$($dsname.name) datastore SIOC Normalized Latency&quot;;Description = &quot;Custom alarm to monitor $($dsname.name) ($($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)) datastore SIOC Normalized Latency&quot;;Enabled = $true;expression = (New-Object VMware.Vim.OrAlarmExpression -Property @{expression = @((New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;datastore&quot;}|?{$_.nameinfo.key -match &quot;sizeNormalizedDatastoreLatency&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = ($dsname|%{$_.Host}|%{$_.MountInfo.Path.split(&quot;/&quot;)[-1]}|sort -unique)});Operator = &quot;isAbove&quot;;Yellow = &quot;30000&quot;;YellowInterval = &quot;300&quot;;Red = &quot;40000&quot;;RedInterval = &quot;180&quot;;Type = &quot;HostSystem&quot;}))});Action=(New-Object VMware.Vim.GroupAlarmAction -Property @{Action= (New-Object VMware.Vim.AlarmTriggeringAction -Property @{Action = (New-Object VMware.Vim.SendEmailAction -Property @{ToList = &quot;admin@vmware.local&quot;;Subject = &quot;$($dsname.name) SIOC Normalized Latency&quot;;CcList = &quot;&quot;;Body = &quot;&quot;});TransitionSpecs = @((New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;green&quot;;FinalState = &quot;yellow&quot;;Repeats = $false});(New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;yellow&quot;;FinalState = &quot;red&quot;;Repeats = $false}))})});ActionFrequency = &quot;1800&quot;}))}}</pre>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/oneliner/alarm_SIOC_latency.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/oneliner/alarm_SIOC_latency.png" alt="" width="514" height="194" /></a></p>
<p>Bonus : Alarme de <strong>Disk Command aborts pour datastore VMFS partagé</strong>, en cas de défaillance/saturation DAS/SAN/iSCSI (mailto:admin@vmware.local) :</p>
<pre class="brush: powershell; title: ; notranslate">foreach ($diskname in (Get-View -ViewType datastore|?{$_.info.vmfs -and $_.summary.Accessible -and $_.summary.MultipleHostAccess}|%{$_.info.vmfs.extent}|%{$_.diskname})){if (!((Get-View AlarmManager).GetAlarm((Get-Folder -NoRecursion |Get-View).moref)|?{(get-view $_).info.name -match &quot;$diskname Disk Command aborts&quot;})){(Get-View AlarmManager).CreateAlarm((Get-Folder -NoRecursion |Get-View).MoRef,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;$diskname Disk Command aborts&quot;;Description = &quot;Custom alarm to monitor $diskname Disk Command aborts&quot;;Enabled = $true;expression = (New-Object VMware.Vim.OrAlarmExpression -Property @{expression = (New-Object VMware.Vim.MetricAlarmExpression -Property @{Metric = (New-Object VMware.Vim.PerfMetricId -Property @{CounterId = ((Get-View (Get-View ServiceINstance).Content.PerfManager).PerfCounter|?{$_.groupinfo.key -match &quot;disk&quot;}|?{$_.nameinfo.key -match &quot;commandsAborted&quot;}|?{$_.GroupInfo.Key -ne &quot;virtualDisk&quot;}|?{$_.RollupType -match &quot;summation&quot;}).key;Instance = $diskname});Operator = &quot;isAbove&quot;;Yellow = &quot;1&quot;;Red = &quot;2&quot;;Type = &quot;HostSystem&quot;})});Action=(New-Object VMware.Vim.GroupAlarmAction -Property @{Action= (New-Object VMware.Vim.AlarmTriggeringAction -Property @{Action = (New-Object VMware.Vim.SendEmailAction -Property @{ToList = &quot;admin@vmware.local&quot;;Subject = &quot;$diskname Disk Command aborts&quot;;CcList = &quot;&quot;;Body = &quot;&quot;});TransitionSpecs = @((New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;green&quot;;FinalState = &quot;yellow&quot;;Repeats = $false});(New-Object VMware.Vim.AlarmTriggeringActionTransitionSpec -Property @{StartState = &quot;yellow&quot;;FinalState = &quot;red&quot;;Repeats = $true}))})});ActionFrequency = &quot;1800&quot;}))}}</pre>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/oneliner/alarm_command_abort.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/oneliner/alarm_command_abort.png" alt="" width="482" height="246" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3683</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>[PSH] Raiders of the Lost VM files &#8211; MAJ</title>
		<link>http://www.hypervisor.fr/?p=3612</link>
		<comments>http://www.hypervisor.fr/?p=3612#comments</comments>
		<pubDate>Fri, 24 Feb 2012 08:47:20 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[ZFS]]></category>
		<category><![CDATA[CBT]]></category>
		<category><![CDATA[oneliner]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[vmdk]]></category>
		<category><![CDATA[VMFS]]></category>
		<category><![CDATA[vmx]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3612</guid>
		<description><![CDATA[MAJ 23/05/2015 : Mise à jours des scripts pour exclure que les fichiers &#8220;.lck&#8221; (VSAN).
MAJ 30/10/2012 : Mise à jours des scripts pour n&#8217;exclure que les vm &#8220;invalid&#8221; ou &#8220;orphaned&#8221;.
MAJ 06/07/2012 : Mise à jour des scripts pour exclure &#8220;*/hostCache/*&#8221; pour ne pas remonter les fichiers vswp de la fonction Host Cache d&#8217;ESXi 5.
MAJ 05/07/2012 [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 23/05/2015</span> : Mise à jours des scripts pour exclure que les fichiers &#8220;.lck&#8221; (VSAN).</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 30/10/2012</span> : Mise à jours des scripts pour n&#8217;exclure que les vm &#8220;invalid&#8221; ou &#8220;orphaned&#8221;.</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 06/07/2012</span> : Mise à jour des scripts pour exclure &#8220;*/hostCache/*&#8221; pour ne pas remonter <a href="http://www.yellow-bricks.com/2011/08/18/swap-to-host-cache-aka-swap-to-ssd/" target="_blank">les fichiers vswp de la fonction Host Cache d&#8217;ESXi 5</a>.</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 05/07/2012</span> : Mise à jour des scripts pour intégrer les fichiers vswp.xxxxxx, <a href="http://vmice.wordpress.com/2012/07/04/vm-swapfiles-leftover-swapfiles/" target="_blank">merci à Larus Hjartarson pour l&#8217;idée</a>.</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 21/03/2012</span> : Mise à jour des scripts pour exclure &#8220;var/tmp/cache&#8221; dans le cas d&#8217;une redirection de la partition scratch sur un datastore.</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 06/03/2012</span> : Mise à jour des scripts pour le support des <strong>multi-datacenter/multi-vcenter</strong>, des snapshot NetApp et des fichiers zdump qui trainent.</em></p>
<p style="text-align: center;"><em><a href="http://files.hypervisor.fr/img/lostvmfilemulti.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/lostvmfilemulti.png" alt="" width="521" height="379" /></a><br />
</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 28/02/2012</span><em> :</em></em><em> Mise à jour des scripts suite à une erreur dans le &#8220;SideIndicator&#8221;</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 24/02/2012</span><em> : </em></em><em>Et pour ceux qui ont <strong>*<span style="color: #ff0000;">VRAIMENT</span>*</strong> confiance, voici le script pour supprimer les fichiers vswp orphelins (et si vraiment vous en avez, vous pouvez changer le filtrage au niveau du </em><strong>|?{$_.lostfile -match &#8220;vswp&#8221;}</strong>)<em> :</em></p>
<pre class="brush: powershell; title: ; notranslate">foreach ($lost in (compare -passthru -property path $(foreach ($ds in ((get-view -ViewType datastore|sort name -unique|?{$_.summary.accessible}|%{(get-view $_.browser).SearchDatastoreSubFolders($(&quot;[&quot; + $_.Name + &quot;]&quot;),(New-Object VMware.Vim.HostDatastoreBrowserSearchSpec -property @{matchPattern=(&quot;*zdump*&quot;,&quot;*.xml&quot;,&quot;*.vmsn&quot;,&quot;*.vmsd&quot;,&quot;*.vswp*&quot;, &quot;*.vmx&quot;,&quot;*.vmdk&quot;,&quot;*.vmss&quot;,&quot;*.nvram&quot;,&quot;*.vmxf&quot;); details=(New-Object VMware.Vim.FileQueryFlags -property @{filesize=$true;modification=$true})}))})|?{$_.file})){foreach ($files in $ds.file){$files|?{$_.Path -notmatch &quot;-ctk.vmdk|esxconsole.vmdk|esxconsole-flat.vmdk&quot;}|select @{n=&quot;path&quot;;e={$ds.FolderPath + $files.path|%{$_ -replace &quot; &quot;,&quot;&quot;}}},FileSize,Modification|?{$_.path -notmatch &quot;.zfs|.snapshot|var/tmp/cache|/hostCache/|.lck&quot;}}}) $(get-view -ViewType virtualmachine|?{$_.Runtime.ConnectionState -notmatch &quot;invalid|orphaned&quot;}|%{$_.layoutex.file}|?{$_.type -ne &quot;log&quot;}|%{$_.name}|%{$_ -replace &quot; &quot;,&quot;&quot;}|sort -unique|select @{n=&quot;path&quot;;e={$_}})|?{$_.SideIndicator -eq &quot;&lt;=&quot;}|select @{n=&quot;LostFile&quot;;e={$_.Path -replace &quot;]&quot;,&quot;] &quot;}}, @{n=&quot;FileSize&quot;;e={&quot;{0:N0}&quot; -f ($_.FileSize/1MB)}}, Modification|?{$_.lostfile -match &quot;vswp&quot;})){(get-view (Get-View ServiceInstance|select -first 1).content.filemanager|select -first 1).DeleteDatastoreFile($lost.LostFile,(Get-View -ViewType datacenter|?{$_.Datastore -match (get-datastore $lost.LostFile.split(&quot;[]&quot;)[1]|get-view).moref}|select -first 1).moref)}</pre>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 24/02/2012</span> : Mise à jour du script pour afficher la taille en <strong>MegaBytes</strong> et la date de modification des fichiers.</em></p>
<p style="text-align: justify;">Très fortement inspiré du célèbre <a href="http://www.lucd.info/2011/08/11/vmx-raiders-revisited/" target="_blank">Raiders of the Lost VMX</a> (mais aussi du post <a href="http://www.lucd.info/2011/04/25/orphaned-files-and-folders-spring-cleaning/" target="_blank">Orphaned files and folders – Spring cleaning</a>) de LucD, nous avons enfin fini de finioler un oneliner PowerCLI qui va vous <strong>lister les fichiers .xml, .vmsn, .vmsd, .vswp, .vmx, .vmdk, .vmss, .nvram et .vmxf qui traînent sur vos datastores</strong> et qui ne sont pas rattachés à une quelconque vm du vcenter depuis lequel vous avez exécuté le script.</p>
<pre class="brush: powershell; title: ; notranslate">compare -passthru -property path $(foreach ($ds in ((get-view -ViewType datastore|sort name -unique|?{$_.summary.accessible}|%{(get-view $_.browser).SearchDatastoreSubFolders($(&quot;[&quot; + $_.Name + &quot;]&quot;),(New-Object VMware.Vim.HostDatastoreBrowserSearchSpec -property @{matchPattern=(&quot;*zdump*&quot;,&quot;*.xml&quot;,&quot;*.vmsn&quot;,&quot;*.vmsd&quot;,&quot;*.vswp*&quot;, &quot;*.vmx&quot;,&quot;*.vmdk&quot;,&quot;*.vmss&quot;,&quot;*.nvram&quot;,&quot;*.vmxf&quot;); details=(New-Object VMware.Vim.FileQueryFlags -property @{filesize=$true;modification=$true})}))})|?{$_.file})){foreach ($files in $ds.file){$files|?{$_.Path -notmatch &quot;-ctk.vmdk|esxconsole.vmdk|esxconsole-flat.vmdk&quot;}|select @{n=&quot;path&quot;;e={$ds.FolderPath + $files.path|%{$_ -replace &quot; &quot;,&quot;&quot;}}},FileSize,Modification|?{$_.path -notmatch &quot;.zfs|.snapshot|var/tmp/cache|/hostCache/|.lck&quot;}}}) $(get-view -ViewType virtualmachine|?{$_.Runtime.ConnectionState -notmatch &quot;invalid|orphaned&quot;}|%{$_.layoutex.file}|?{$_.type -ne &quot;log&quot;}|%{$_.name}|%{$_ -replace &quot; &quot;,&quot;&quot;}|sort -unique|select @{n=&quot;path&quot;;e={$_}})|?{$_.SideIndicator -eq &quot;&lt;=&quot;}|select @{n=&quot;LostFile&quot;;e={$_.Path -replace &quot;]&quot;,&quot;] &quot;}}, @{n=&quot;FileSize&quot;;e={&quot;{0:N0}&quot; -f ($_.FileSize/1MB)}}, Modification|ft -autosize</pre>
<p style="text-align: justify;">Les snapshots ZFS (.zfs/snapshot), les fichiers -ctk.vmdk (fichiers CBT) et les vmdk des COS d&#8217;ESX classic (esxconsole-) sont filtrés, n&#8217;hésitez pas à nous remonter d&#8217;autres faux positifs que vous pourriez rencontrer. <span style="text-decoration: line-through;">Prochaine étape : ménage automatique&#8230;</span></p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/lostvmfile_full.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/lostvmfiles.png" alt="" width="521" height="287" /></a></p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/lostvmfilesize.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/lostvmfilesize.png" alt="" width="504" height="125" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3612</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>[PSH] Rescan &amp; Refresh en one-liner</title>
		<link>http://www.hypervisor.fr/?p=3407</link>
		<comments>http://www.hypervisor.fr/?p=3407#comments</comments>
		<pubDate>Tue, 18 Oct 2011 18:37:52 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[iSCSI]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[VMFS]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3407</guid>
		<description><![CDATA[Il est parfois nécessaire de faire un rescan/refresh de la partie stockage de plusieurs ESX au delà d&#8217;un seul cluster. Depuis vSphere 4, la fonction &#8220;Rescan for Datastores&#8230;&#8221; disponible au niveau du cluster améliore grandement l&#8217;administration quotidienne mais la fonction &#8220;Refresh host storage system&#8220;, qui permet par exemple de rafraichir l&#8217;espace disponible sur les partages NFS, n&#8217;est disponible qu&#8217;individuellement sur chaque [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Il est parfois nécessaire de faire un rescan/refresh de la partie stockage de plusieurs ESX au delà d&#8217;un seul cluster. Depuis vSphere 4, la fonction &#8220;Rescan for Datastores&#8230;&#8221; disponible au niveau du cluster améliore grandement l&#8217;administration quotidienne mais la fonction &#8220;<strong>Refresh host storage system</strong>&#8220;, qui permet par exemple de rafraichir l&#8217;espace disponible sur les partages NFS, n&#8217;est disponible qu&#8217;individuellement sur chaque host.</p>
<p style="text-align: justify;">Voici donc un petit one-liner qui permet de combiner les actions de rescan et refresh :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>View <span style="color: pink;">-</span>ViewType HostSystem <span style="color: #008080; font-style: italic;">-Property</span> ConfigManager.StorageSystem <span style="color: pink;">-</span><span style="color: #0000FF;">Filter</span> <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span><span style="color: #800000;">&quot;Name&quot;</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;^vmvisor&quot;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span>Get<span style="color: pink;">-</span>View <span style="color: #000080;">$_</span>.ConfigManager.StorageSystem<span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.RescanAllHba<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<span style="color: #000080;">$_</span>.RefreshStorageSystem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p style="text-align: justify;">L&#8217;équivalent en <span style="text-decoration: underline;">moins rapide</span> mais en plus simple :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>VMHost vmvisor<span style="color: pink;">*|</span>Get<span style="color: pink;">-</span>VMHostStorage <span style="color: pink;">-</span>RescanAllHba <span style="color: pink;">-</span>Refresh</pre></div></div>

<p style="text-align: justify;">Vous aurez remarqué que nous n&#8217;avons <strong>pas inclus de RescanVmfs</strong> car selon le <a href="http://pubs.vmware.com/vsphere-50/topic/com.vmware.wssdk.apiref.doc_50/vim.host.StorageSystem.html#refresh" target="_blank">vSphere API Reference</a>, la méthode RefreshStorageSystem l’intègre :</p>
<blockquote>
<p style="text-align: justify;">The RefreshStorageSystem method obtains information from the host platform <strong>and it performs a rescan of VMFS volumes</strong>. It does not look for new devices.</p>
</blockquote>
<p style="text-align: justify;"><strong><span style="color: #ff0000;">Bonus </span></strong>: la même commande pour la partie réseau, dont le refresh n&#8217;est aussi disponible qu&#8217;individuellement sur chaque host :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>View <span style="color: pink;">-</span>ViewType HostSystem <span style="color: #008080; font-style: italic;">-Property</span> ConfigManager.NetworkSystem <span style="color: pink;">-</span><span style="color: #0000FF;">Filter</span> <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span><span style="color: #800000;">&quot;Name&quot;</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;^vmvisor&quot;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span>Get<span style="color: pink;">-</span>View <span style="color: #000080;">$_</span>.ConfigManager.NetworkSystem<span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.RefreshNetworkSystem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p>Inutile de vous rappeler qu&#8217;<strong>il vous faudra ajuster le filtrage de la commande Get-View à votre nomenclature</strong>.</p>
<p><a href="http://www.vmware.com/support/pubs/sdk_pubs.html"><img class="aligncenter" src="http://www.vmware.com/support/pubs/doccenter.png" alt="" width="55" height="74" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3407</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to access file  since it is locked</title>
		<link>http://www.hypervisor.fr/?p=2900</link>
		<comments>http://www.hypervisor.fr/?p=2900#comments</comments>
		<pubDate>Mon, 25 Apr 2011 23:03:10 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[SAN]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[vmdk]]></category>
		<category><![CDATA[VMFS]]></category>
		<category><![CDATA[vmx]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=2900</guid>
		<description><![CDATA[Suite a une grosse coupure de SAN, nous avons du faire face à des &#8220;power on&#8221; récalcitrants avec lesquels nous avions déjà eu affaires lors de coupures réseaux sur du stockage NFS ou iSCSI :



N&#8217;importe lequel de ces messages vous mènera aux forums VMware, sur des blogs ou même à cette kb qui précise justement ce que nous allons [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Suite a une grosse coupure de SAN, nous avons du faire face à des &#8220;power on&#8221; récalcitrants avec lesquels nous avions déjà eu affaires lors de coupures réseaux sur du stockage NFS ou iSCSI :</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2901" title="SS-2011-04-25_23.19.25" src="http://www.hypervisor.fr/wp-content/uploads/2011/04/SS-2011-04-25_23.19.25.png" alt="" width="526" height="38" /></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2905" title="SS-2011-04-25_23.13.41" src="http://www.hypervisor.fr/wp-content/uploads/2011/04/SS-2011-04-25_23.13.41.png" alt="" width="572" height="74" /></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2904" title="SS-2011-04-25_23.19.13" src="http://www.hypervisor.fr/wp-content/uploads/2011/04/SS-2011-04-25_23.19.13.png" alt="" width="571" height="72" /></p>
<p style="text-align: justify;">N&#8217;importe lequel de ces messages vous mènera aux <a href="http://communities.vmware.com/message/909582" target="_blank">forums VMware</a>, sur <a href="http://www.zealkabi.com/2008/10/unable-to-start-vm-unable-to-access.html" target="_blank">des blogs</a> ou même à <a href="http://kb.vmware.com/kb/10051" target="_blank">cette kb</a> qui précise justement ce que nous allons prendre à contre pied :</p>
<blockquote><p>Because a virtual machine can be moved between hosts, the host where the virtual machine is currently registered may not be the host maintaining the file lock. The lock must be released by the ESX host that owns the lock</p></blockquote>
<p style="text-align: justify;">Le point commun de ces troubleshooting est l&#8217;objectif de <strong>faire sauter le lock</strong> du ou des fichiers, ce qui parait tout à fait censé et que nous avons d&#8217;ailleurs déjà suivi par le passé en essayant aussi de redémarrer le service hostd en masse grâce à <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank">plink</a> (ou esxi.txt est la liste des fqdn) avant de redémarrer l&#8217;ESX en dernier recours :</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #33cc33;">@</span><span style="color: #b1b100; font-weight: bold;">echo</span> off
<span style="color: #00b100; font-weight: bold;">FOR</span> /F <span style="color: #33cc33;">%%</span><span style="color: #448888;">i</span> <span style="color: #00b100; font-weight: bold;">in</span> <span style="color: #33cc33;">(</span>esxi.txt<span style="color: #33cc33;">)</span> <span style="color: #00b100; font-weight: bold;">do</span> <span style="color: #00b100; font-weight: bold;">call</span> :<span style="color: #b100b1; font-weight: bold;">plink</span> <span style="color: #33cc33;">%%</span><span style="color: #448888;">i</span>
:<span style="color: #b100b1; font-weight: bold;">plink</span>
&quot;C:\Program Files <span style="color: #33cc33;">(</span>x86<span style="color: #33cc33;">)</span>\PuTTY\plink.exe&quot; -pw &quot;password&quot; root<span style="color: #33cc33;">@%</span><span style="color: #448888;">1</span> &quot;/sbin/services.sh restart&quot;
<span style="color: #00b100; font-weight: bold;">GOTO</span> End
:<span style="color: #b100b1; font-weight: bold;">Last</span>
:<span style="color: #b100b1; font-weight: bold;">End</span></pre></div></div>

<p style="text-align: justify;">Cette dernière étape est particulièrement longue et fastidieuse alors que, sauf cas exceptionnel, <strong>la solution &#8220;idéale&#8221; est de trouver le dernier ESX ayant fait tourné la vm</strong> (via le vmware.log ou grâce à <a href="http://www.hypervisor.fr/?p=1738" target="_blank">export régulier</a> des infos du vCenter), de passer DRS en manuel pour être prompté au démarrage de la VM et de selectionner le bon ESX :</p>
<p style="text-align: justify;"><a href="http://www.hypervisor.fr/wp-content/uploads/2011/04/SS-2011-04-25_23.14.03.png" title="SS-2011-04-25_23.14.03" rel="lightbox[2900]"><img class="aligncenter size-medium wp-image-2906" title="SS-2011-04-25_23.14.03" src="http://www.hypervisor.fr/wp-content/uploads/2011/04/SS-2011-04-25_23.14.03-300x123.png" alt="" width="300" height="123" /></a></p>
<p style="text-align: justify;">C&#8217;est tout simple mais ça marche très bien <img src='http://www.hypervisor.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=2900</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Utiliser dd sur ESXi 4.0</title>
		<link>http://www.hypervisor.fr/?p=1969</link>
		<comments>http://www.hypervisor.fr/?p=1969#comments</comments>
		<pubDate>Wed, 07 Apr 2010 17:48:12 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[VMFS]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=1969</guid>
		<description><![CDATA[Comme expliqué il y a longtemps par Mike La Spina sur son blog et lors d&#8217;une session dédiée au VMFS au VMworld 2007, il est possible de sauvegarder les &#8220;Metadata blocks&#8221; d&#8217;un volume VMFS vers un fichier à l&#8217;aide de l&#8217;outil dd. En cas de suppression accidentel du volume, il &#8220;suffit&#8221; de restaurer les blocks [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Comme expliqué il y a longtemps par <a href="http://blog.laspina.ca/ubiquitous/understanding-vmfs-volumes" target="_blank">Mike La Spina sur son blog</a> et lors <a href="http://communities.vmware.com/servlet/JiveServlet/download/781793-3097/PS_TA48_288131_166-1_FIN_v2.pdf" target="_blank">d&#8217;une session dédiée au VMFS au VMworld 2007</a>, il est possible de sauvegarder les &#8220;Metadata blocks&#8221; d&#8217;un volume VMFS vers un fichier à l&#8217;aide de l&#8217;outil dd. En cas de suppression accidentel du volume, il &#8220;suffit&#8221; de restaurer les blocks à partir du fichier de sauvegarde produit par dd. Sur ESX/ESXi 3.5 et ESX 4.0 la manipulation (restore) se passe sans problème mais sous ESXi 4.0 la commande produit un message d&#8217;erreur obscure :</p>
<blockquote><p>Function not implemented</p></blockquote>
<p>La solution était caché dans une <a href="http://kb.vmware.com/kb/1008886" target="_blank">kb VMware</a> sur le troubleshooting d&#8217;erreur lors de la creation d&#8217;un datastore :</p>
<blockquote><p>Note: If you are using VMware ESXi or the &lt;identifier&gt; you are specifying is located within the /vmfs/ directory, you may need to append the <strong>conv=notrunc</strong> parameter to the dd command. Not doing so may result in a Function not implemented error.</p></blockquote>
<p>Alleluia !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=1969</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vmfs-undelete : l&#8217;outil de VMFS recovery enfin disponible</title>
		<link>http://www.hypervisor.fr/?p=322</link>
		<comments>http://www.hypervisor.fr/?p=322#comments</comments>
		<pubDate>Fri, 07 Nov 2008 13:55:59 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[VMFS]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=322</guid>
		<description><![CDATA[ESX 3.5 update 3 est sorti hier, le ChangeLog est disponible ici
Cette update apporte majoritairement du support matériel supplémentaire mais 2 nouveautés intéressantes font leur apparition :

La limite de vCPU par core passe de 8 (ou 11 pour du VDI) à 20
vmfs-undelete, un outil de restauration de fichiers supprimés pour VMFS

Bien que vmfs-undelete ne soit [...]]]></description>
			<content:encoded><![CDATA[<p>ESX 3.5 update 3 est sorti hier, le ChangeLog est disponible <a href="http://www.vmware.com/support/vi3/doc/vi3_esx35u3_rel_notes.html">ici</a></p>
<p>Cette update apporte majoritairement du support matériel supplémentaire mais 2 nouveautés intéressantes font leur apparition :</p>
<ul>
<li>La limite de vCPU par core passe de 8 (ou 11 pour du VDI) à 20</li>
<li><a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&#038;cmd=displayKC&#038;externalId=1007243">vmfs-undelete</a>, un outil de restauration de fichiers supprimés pour VMFS</li>
</ul>
<p>Bien que vmfs-undelete ne soit encore qu&#8217;experimental et non disponible sur ESXi, il sera très probablement plus que bien accueilli par la communauté VMware <img src='http://www.hypervisor.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=322</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
