<?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; SAN</title>
	<atom:link href="http://www.hypervisor.fr/?feed=rss2&#038;tag=san" 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>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>
	</channel>
</rss>
