<?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; scripting</title>
	<atom:link href="http://www.hypervisor.fr/?feed=rss2&#038;tag=scripting" 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>FC to iSCSI failover : MRU ranking</title>
		<link>http://www.hypervisor.fr/?p=4389</link>
		<comments>http://www.hypervisor.fr/?p=4389#comments</comments>
		<pubDate>Mon, 12 Nov 2012 22:27:37 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[ZFS]]></category>
		<category><![CDATA[ALUA]]></category>
		<category><![CDATA[NMP]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[PSA]]></category>
		<category><![CDATA[PSP]]></category>
		<category><![CDATA[SATP]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[VMW_PSP_MRU]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=4389</guid>
		<description><![CDATA[Au détour de l’excellent Storage Implementation in vSphere 5.0 de Mostafa &#8220;VCDX #2&#8243; Khalil,  nous avons découvert le Path Ranking. Détaillé dans une kb vmware (et dans un post de Cormac Hogan), le path raking permet de pondérer un ou plusieurs chemins lorsque le plugin VMW_PSP_MRU est utilisé.

In ESXi 5.0, VMW_PSP_MRU has path ranking capabilities that allows you [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Au détour de l’excellent <a href="http://www.amazon.com/dp/0321799933" target="_blank">Storage Implementation in vSphere 5.0</a> de <a href="https://twitter.com/MostafaVMW" target="_blank">Mostafa &#8220;VCDX #2&#8243; Khalil</a>,  nous avons découvert le <strong>Path Ranking</strong>. <a href="http://kb.vmware.com/kb/2003468" target="_blank">Détaillé dans une kb vmware</a> (et dans <a href="http://blogs.vmware.com/vsphere/2012/04/prioritizing-io-paths-in-the-event-of-a-failover.html" target="_blank">un post de Cormac Hogan</a>), le path raking permet de pondérer un ou plusieurs chemins lorsque le plugin VMW_PSP_MRU est utilisé.</p>
<blockquote>
<p style="text-align: justify;">In ESXi 5.0, VMW_PSP_MRU has path ranking capabilities that allows you to assign ranks to individual paths. VMW_PSP_MRU goes through the path group states in the following order: Active, Active_UO and Standby, and <strong>picks a path that has the highest rank for I/O</strong>.</p>
</blockquote>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/05fig08_alt.jpg" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/05fig08_alt.jpg" alt="" width="418" height="250" /></a></p>
<p style="text-align: justify;">Evidemment, le scénario dans le quel le path ranking nous intéresse le plus est le fameux <a href="http://www.hypervisor.fr/?p=3164" target="_blank">FC to iSCSI failover</a> dans le quel nous étions particulièrement gêné par le fait que les chemins en FC n&#8217;étaient pas prioritaires sur les chemins iSCSI et pouvant mener à des situations où un chemin iSCSI serait utilisé alors qu&#8217;un chemin FC serait disponible :</p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/pathranking/fc-iscsi-fixed.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/pathranking/fc-iscsi-fixed.png" alt="" width="441" height="322" /></a></p>
<p style="text-align: justify;">On passe le PSP du datastore en MRU et un coup de PowerCLI pour monter le ranking des chemins FC :</p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/pathranking/fc-iscsi-get-esxcli.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/pathranking/fc-iscsi-get-esxcli.png" alt="" width="442" height="234" /></a></p>
<pre class="brush: powershell; title: ; notranslate">(Get-VMHost esx.vmware.com|Get-EsxCli).storage.nmp.path.list(&quot;naa.0123456789&quot;)|sort RuntimeName|select RuntimeName, @{n=&quot;rank&quot;;e={(Get-VMHost esx.vmware.com|Get-EsxCli).storage.nmp.psp.generic.pathconfig.get($_.RuntimeName)}}|ft -AutoSize</pre>
<pre class="brush: powershell; title: ; notranslate">(Get-VMHost vmvisor01.vmwa.re|Get-EsxCli).storage.nmp.psp.generic.pathconfig.set(&quot;rank=1&quot;,&quot;vmhba0:C0:T0:L0&quot;)</pre>
<p style="text-align: left;">Le (bon) résultat est immédiat :</p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/pathranking/fc-iscsi-mru-ranked.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/pathranking/fc-iscsi-mru-ranked.png" alt="" width="441" height="322" /></a></p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=4389</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Get-EsxCli de PowerCLI v5 supporte le &#8220;SSO&#8221;</title>
		<link>http://www.hypervisor.fr/?p=3947</link>
		<comments>http://www.hypervisor.fr/?p=3947#comments</comments>
		<pubDate>Mon, 16 Jul 2012 00:08:28 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[esxcli]]></category>
		<category><![CDATA[Get-EsxCli]]></category>
		<category><![CDATA[oneliner]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sso]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3947</guid>
		<description><![CDATA[Alors que nous scriptions le check du paramètre UNMAP des primitives VAAI avec la cmdlet Get-EsxCli, nous nous sommes aperçu par hasard que contrairement à celle de la v4 de PowerCLI cette cmdlet avait un paramètre &#8221;VMHost&#8221; en plus du paramètre &#8221;Server&#8221; déjà présente dans la v4. Sachant que cette cmdlet ne pouvait être exécutée que lors d&#8217;une session direct avec un (ou plusieurs) ESX lors son [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Alors que nous scriptions le check du paramètre <a href="http://kb.vmware.com/kb/2007427" target="_blank">UNMAP des primitives VAAI</a> avec <a href="http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-EsxCli.html" target="_blank">la cmdlet Get-EsxCli</a>, nous nous sommes aperçu par hasard que contrairement à celle de la v4 de PowerCLI cette cmdlet avait un paramètre &#8221;VMHost&#8221; en plus du paramètre &#8221;Server&#8221; déjà présente dans la v4. Sachant que cette cmdlet ne pouvait être exécutée que lors d&#8217;une session direct avec un (ou plusieurs) ESX <a href="http://www.hypervisor.fr/?p=2507" target="_blank">lors son apparition dans le PowerCLI 4.1 U1</a>, la présence du paramètre &#8221;VMHost&#8221; nous a paru plus que suspect.</p>
<p style="text-align: justify;">Et bien nous en a pris car cet indice nous a permis de découvrir (1 an plus tard&#8230;) que <strong>la cmdlet Get-EsxCli de PowerCLI 5+ ne nécessite pas de connections direct aux ESX</strong> (mais <a href="http://www.vmware.com/support/developer/PowerCLI/changelog.html#PowerCLI50" target="_blank">uniquement avec un vCenter 5+ comme en témoigne le changelog</a>) :</p>
<blockquote>
<p style="text-align: justify;">Added vCenter Server support for Get-EsxCli. (requires vCenter Server 5.0 or later)</p>
</blockquote>
<p style="text-align: justify;">Vous pouvez donc facilement vérifier l&#8217;état du paramètre UNMAP&#8230;</p>
<p style="text-align: justify;"><img class="aligncenter" src="http://files.hypervisor.fr/img/get-esxcli_v5/get-esxcli_sso_unmap.png" alt="" width="518" height="136" /></p>
<pre class="brush: powershell; title: ; notranslate">Get-VMHost|select Name, @{n=&quot;UNMAP&quot;;e={$(($_|Get-EsxCli).system.settings.advanced.list(&quot;/VMFS3/EnableBlockDelete&quot;)).IntValue}}</pre>
<p style="text-align: justify;">&#8230; Ou afficher la liste des claimrule (<a href="http://kb.vmware.com/kb/1009449" target="_blank">pratique pour masquer un path</a>)&#8230;</p>
<p style="text-align: justify;"><img class="aligncenter" src="http://files.hypervisor.fr/img/get-esxcli_v5/get-esxcli_sso_claimrules.png" alt="" width="518" height="398" /></p>
<pre class="brush: powershell; title: ; notranslate">Get-VMHost|%{&quot; &quot;;write-host -background white -foreground red $_.Name;($_|Get-EsxCli).storage.core.claimrule.list()|ft *}</pre>
<p style="text-align: justify;">&#8230; Ou encore modifier le paramètre &#8220;<a href="http://jpaul.me/?p=2492" target="_blank">IOOperationLimit</a>&#8221; des LUN configurées en roundrobin :</p>
<p style="text-align: justify;"><img class="aligncenter" src="http://files.hypervisor.fr/img/get-esxcli_v5/get-esxcli_sso_iops.png" alt="" width="518" height="1094" /></p>
<pre class="brush: powershell; title: ; notranslate">ForEach ($VMHost in Get-VMHost){&quot; &quot;;write-host -background white -foreground red $VMHost.Name;($VMHost|Get-EsxCli).storage.nmp.device.list()|?{$_.PathSelectionPolicy -match &quot;VMW_PSP_RR&quot;}|%{($VMHost|Get-EsxCli).storage.nmp.psp.roundrobin.deviceconfig.get($_.device)}}</pre>
<pre class="brush: powershell; title: ; notranslate">ForEach ($VMHost in Get-VMHost){&quot; &quot;;write-host -background white -foreground red $VMHost.Name;($VMHost|Get-EsxCli).storage.nmp.device.list()|?{$_.PathSelectionPolicy -match &quot;VMW_PSP_RR&quot;}|%{($VMHost|Get-EsxCli).storage.nmp.psp.roundrobin.deviceconfig.get($_.device)}|?{$_.IOOperationLimit -ne 1 -and $_.LimitType -ne &quot;iops&quot;}|%{($VMHost|Get-EsxCli).storage.nmp.psp.roundrobin.deviceconfig.set($null,$_.device,&quot;1&quot;,&quot;iops&quot;,$null)}}</pre>
<p>Moralité : RTFChangelog <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=3947</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alarmes vCenter pour les network packets dropped &#8211; MAJ</title>
		<link>http://www.hypervisor.fr/?p=3877</link>
		<comments>http://www.hypervisor.fr/?p=3877#comments</comments>
		<pubDate>Thu, 31 May 2012 10:47:26 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[alarm]]></category>
		<category><![CDATA[droppedRX]]></category>
		<category><![CDATA[droppedTX]]></category>
		<category><![CDATA[e1000]]></category>
		<category><![CDATA[packets dropped]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[vmxnet3]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3877</guid>
		<description><![CDATA[MAJ 06/06/2012 : Nous avions oublié de préciser que pour des tests de pourrissage de réseau nous avions utilisé WANem (Wide Area Network Emulator) qui permet toutes sortent de simulation visant à détériorer ou ralentir le trafic réseau (liveCD et Open Source).
MAJ 31/05/2012 : Les stats de dropped packets n&#8217;étant pas dispo pour les VM sur vCenter 4.x, nous [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 06/06/2012</span> : Nous avions oublié de préciser que pour des tests de pourrissage de réseau nous avions utilisé WANem (Wide Area Network Emulator) qui permet toutes sortent de simulation visant à détériorer ou ralentir le trafic réseau (liveCD et Open Source).</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 31/05/2012</span> : Les stats de dropped packets n&#8217;étant pas dispo pour les VM sur vCenter 4.x, nous avons ajouté un script pour créer des alarmes sur les vmnic, pour les vswitch des ESX donc. <a href="http://www.hypervisor.fr/?p=3877#comment-2320" target="_blank">Merci à puchy pour son feedback</a>.</em></p>
<p style="text-align: justify;">Si, comme nous, vous vous êtes rendu compte un peu tard que de <strong>nombreux packets réseau étaient droppés sur des VM Windows 2008 R2 avec l&#8217;adapteur e1000</strong>, vous serez intéressé par notre petit oneliner (what else ?) qui vous permettra de créer des alarmes dans votre vCenter pour vous en avertir. Mieux vaut un mail de votre vcenter (5.0+) que d&#8217;un user en colère, non ?</p>
<p style="text-align: justify;">Voici une illustration de notre cas :</p>
<p style="text-align: justify;"><a href="http://files.hypervisor.fr/img/DroppedRX/e1000_vs_VMXNET3.png" title="e1000_vs_VMXNET3" rel="lightbox[3877]"><img class="aligncenter size-medium wp-image-3878" title="e1000_vs_VMXNET3" src="http://www.hypervisor.fr/wp-content/uploads/2012/05/e1000_vs_VMXNET3-300x245.png" alt="" width="300" height="245" /></a></p>
<p style="text-align: justify;">Et voici le oneliner qui va créer une alarme pour <a href="http://www.lucd.info/2012/04/21/vnic-transmit-and-receive-rates/" target="_blank">chaque &#8220;instance&#8221; de carte réseau</a> existante de votre vCenter (yellow &gt;1 ; red &gt; 5 ; mailto:admin@vmware.local) :</p>
<pre class="brush: powershell; title: ; notranslate">foreach ($vnic in (Get-View -ViewType VirtualMachine|%{$_.Config.Hardware.Device|?{$_.DeviceInfo.label -match &quot;Network adapter&quot;}}|select Key -Unique|%{$_.Key})){if (!((Get-View AlarmManager).GetAlarm((Get-Folder -NoRecursion |Get-View).MoRef)|?{(get-view $_).info.name -like &quot;Virtual Machine dropped network packets (instance $vnic)&quot;})){(Get-View AlarmManager).CreateAlarm((Get-Folder -NoRecursion |Get-View).MoRef,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;Virtual Machine dropped network packets (instance $vnic)&quot;;Description = &quot;Custom alarm to monitor dropped network packets (instance $vnic)&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;net&quot;}|?{$_.RollupType -match &quot;summation&quot;}|?{$_.NameInfo.key -match &quot;droppedTx&quot;}).key;Instance = $vnic});Operator = &quot;isAbove&quot;;Yellow = &quot;1&quot;;YellowInterval = &quot;300&quot;;Red = &quot;5&quot;;RedInterval = &quot;180&quot;;Type = &quot;VirtualMachine&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;net&quot;}|?{$_.RollupType -match &quot;summation&quot;}|?{$_.NameInfo.key -match &quot;droppedRx&quot;}).key;Instance = $vnic});Operator = &quot;isAbove&quot;;Yellow = &quot;1&quot;;YellowInterval = &quot;300&quot;;Red = &quot;5&quot;;RedInterval = &quot;180&quot;;Type = &quot;VirtualMachine&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] {targetName} has dropped network packets ({newStatus} state)&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: justify;">Vous devez réexecuter ce script si vous créez une nouvelle vm dans votre vCenter (5.0+) qui possède plus de cartes réseau virtuelles que celle qui en possédait le plus lors de la précédente exécution. Chaque alarme sera identifiée par l&#8217;instance qui lui est affectée :</p>
<p><a href="http://files.hypervisor.fr/img/DroppedRX/vc_alarms.png" title="vc_alarms" rel="lightbox[3877]"><img class="aligncenter size-medium wp-image-3880" title="vc_alarms" src="http://www.hypervisor.fr/wp-content/uploads/2012/05/vc_alarms-300x92.png" alt="" width="300" height="92" /></a></p>
<p>Pour vCenter 4.x+, voici le même script pour les vmnics des ESX :</p>
<pre class="brush: powershell; title: ; notranslate">foreach ($vmnic in (Get-View -ViewType HostSystem|%{$_.Config.Network.Pnic|%{$_.Device}}|Select-Object -Unique)){if (!((Get-View AlarmManager).GetAlarm((Get-Folder -NoRecursion |Get-View).MoRef)|?{(get-view $_).info.name -like &quot;Host dropped network packets (instance $vmnic)&quot;})){(Get-View AlarmManager).CreateAlarm((Get-Folder -NoRecursion |Get-View).MoRef,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;Host dropped network packets (instance $vmnic)&quot;;Description = &quot;Custom alarm to monitor Host dropped network packets (instance $vmnic)&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;net&quot;}|?{$_.RollupType -match &quot;summation&quot;}|?{$_.NameInfo.key -match &quot;droppedTx&quot;}).key;Instance = $vmnic});Operator = &quot;isAbove&quot;;Yellow = &quot;1&quot;;YellowInterval = &quot;300&quot;;Red = &quot;5&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;net&quot;}|?{$_.RollupType -match &quot;summation&quot;}|?{$_.NameInfo.key -match &quot;droppedRx&quot;}).key;Instance = $vmnic});Operator = &quot;isAbove&quot;;Yellow = &quot;1&quot;;YellowInterval = &quot;300&quot;;Red = &quot;5&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] {targetName} has dropped network packets ({newStatus} state)&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><a href="http://files.hypervisor.fr/img/DroppedRX/vmnic_alarms.png" title="vmnic_alarms" rel="lightbox[3877]"><img class="aligncenter size-medium wp-image-3885" title="vmnic_alarms" src="http://www.hypervisor.fr/wp-content/uploads/2012/05/vmnic_alarms-300x102.png" alt="" width="300" height="102" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3877</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[PSH] state memory counter : créez une vraie alarme d&#8217;overcommit pour ESX</title>
		<link>http://www.hypervisor.fr/?p=3845</link>
		<comments>http://www.hypervisor.fr/?p=3845#comments</comments>
		<pubDate>Fri, 20 Apr 2012 07:39:46 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[alarm]]></category>
		<category><![CDATA[memory overcommit]]></category>
		<category><![CDATA[memory state]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3845</guid>
		<description><![CDATA[L&#8217;un des compteurs les plus connus en matière d&#8217;overcommit sur ESX est le memory state. Pour ceux qui ne le connaissent pas, sachez qu&#8217;il permet de savoir rapidement dans quel état d&#8217;overcommitment (de 0 à 4, high&#62;soft&#62;hard&#62;low) se trouve votre ESX. A 0 tout va bien, au dessus ca commence à devenir short donc le [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">L&#8217;un des compteurs les plus connus en matière d&#8217;overcommit sur ESX est le <a href="http://pubs.vmware.com/vsphere-50/index.jsp?topic=/com.vmware.wssdk.apiref.doc_50/memory_counters.html" target="_blank"><strong>memory state</strong></a>. Pour ceux qui ne le connaissent pas, sachez qu&#8217;il permet de savoir rapidement dans quel état d&#8217;overcommitment (de 0 à 4, high&gt;soft&gt;hard&gt;low) se trouve votre ESX. A 0 tout va bien, au dessus ca commence à devenir short donc le vmkernel va chercher à récupérer de la ram avec les différents moyens qu&#8217;il à dispo (un petit tour sur <a href="http://kb.vmware.com/kb/2017642" target="_blank">le diagramme Memory Management and Monitoring diagram d&#8217;Hany Michael</a> tout juste mis à jour pour se rafraichir la mémoire -haha).</p>
<p style="text-align: justify;">Sachez aussi qu&#8217;historiquement statiques, <a href="http://frankdenneman.nl/2011/07/mem-minfreepct-sliding-scale-function/" target="_blank">les pourcentages équivalent aux différents states sont &#8220;dynamique&#8221; depuis ESX 5</a> et <a href="http://kb.vmware.com/kb/1033687" target="_blank">VMware recommande de tuner le paramètre minFreePct sur ESX 4.1 au dessus de 64Go de ram</a> (nous, on vous recommande 3% à partir de 32Go).</p>
<p style="text-align: justify;">Le compteur n&#8217;est pas accessible pour faire une alarme dans le vcenter donc nous avons fait chauffer le PowerCLI pour vous en faire une belle qui brille dans la nuit et qui vous alerte dès que le compteur passe à 1 (=1 : warning, &gt;1 : alert) :</p>
<pre class="brush: powershell; title: ; notranslate">(Get-View AlarmManager).CreateAlarm((Get-Folder -NoRecursion |Get-View).MoRef,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;Host memory state&quot;;Description = &quot;Custom alarm to monitor Host memory state high-soft-hard-low&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;mem&quot;}|?{$_.nameinfo.key -match &quot;state&quot;}|?{$_.RollupType -match &quot;latest&quot;}).key;Instance = &quot;&quot;});Operator = &quot;isAbove&quot;;Yellow = &quot;1&quot;;YellowInterval = &quot;20&quot;;Red = &quot;2&quot;;RedInterval = &quot;20&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] {targetName} memory state is {newStatus}&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><img class="aligncenter" src="http://files.hypervisor.fr/img/vAlarm_memory_state.png" alt="" width="387" height="64" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3845</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[ACPI] cpu usage vs core utilization &#8211; MAJ</title>
		<link>http://www.hypervisor.fr/?p=3806</link>
		<comments>http://www.hypervisor.fr/?p=3806#comments</comments>
		<pubDate>Fri, 30 Mar 2012 08:04:18 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[alarm]]></category>
		<category><![CDATA[esxtop]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3806</guid>
		<description><![CDATA[MAJ 13/07/2012 : VMware vient de nous confirmer que sur des processeurs avec l&#8217;Hyper-Threading activé, la valeur remonté est la somme des % d&#8217;utilisation de chaque core logique divisée par le nombre de core physique ce qui peut conduire (injustement selon nous) à des valeurs supérieures à 100%. Pour faire simple, avec l&#8217;HT d&#8217;activé ce compteur est complètement faussé [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><em><span style="color: #ff0000;"><strong>MAJ 13/07/2012</strong></span> : VMware vient de nous confirmer que sur des processeurs avec l&#8217;<strong>Hyper-Threading</strong> activé, la valeur remonté est la somme des % d&#8217;utilisation de chaque core <strong>logique </strong>divisée par le nombre de core <strong>physique </strong>ce qui peut conduire (injustement selon nous) à des valeurs supérieures à 100%. Pour faire simple, avec l&#8217;HT d&#8217;activé ce compteur est complètement faussé et donc l&#8217;alarme inutile.</em></p>
<p style="text-align: justify;"><a href="http://files.hypervisor.fr/img/cpu_core_usage/core_usage_HT.png"><img class="aligncenter" src="http://files.hypervisor.fr/img/cpu_core_usage/core_usage_HT_s.png" alt="" width="401" height="278" /></a></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;"><strong>MAJ 19/04/2012</strong></span> : Modification du script pour afficher nom du server et le status dans l&#8217;objet du mail</em></p>
<p style="text-align: justify;">Le coup du PCPU Used vs PCPU Util c&#8217;est un classique de Krishna Raj (grand maître d&#8217;esxtop) aux <a href="http://mylearn.vmware.com/courseware/83922/TA6720%20_FORMATTED.pdf" target="_blank">VMworld pendant la session &#8220;esxtop for advanced users&#8221;</a>. Il s&#8217;agit d&#8217;<strong>une situation où la consommation cpu &#8220;théorique&#8221; (basé sur la fréquence de base du cpu) est différente de la consommation &#8221;réelle&#8221; (basée sur la fréquence courante du cpu)</strong>. Les exemples de troubleshooting des sessions de Krishna sont lié à l&#8217;Hyperthreading et aux mécanismes qui permettent aux cpu de baisser leur fréquence pour économiser de l’énergie.</p>
<p style="text-align: justify;">En fervents adeptes d&#8217;esxtop, nous avons tout de suite remarqué l&#8217;anomalie décrite par Krishna lors d&#8217;une séance de troubleshooting :</p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/cpu_core_usage/core_cpu_esxtop.png"><img class="aligncenter" src="http://files.hypervisor.fr/img/cpu_core_usage/core_cpu_esxtop.png" alt="" width="480" height="163" /></a></p>
<p style="text-align: justify;">Le problème c&#8217;est que nous n&#8217;étions pas dans esxtop pour ça et, pire, aucune alarme ne nous était parvenue. Et pour cause, c&#8217;est le compteur &#8220;usage&#8221; qui est utilisé par vCenter et non pas &#8220;coreUtilization&#8221; :</p>
<p style="text-align: left;"><img class="aligncenter" src="http://files.hypervisor.fr/img/cpu_core_usage/core_cpu_fake_bargraph.png" alt="" width="355" height="122" /></p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/cpu_core_usage/core_cpu_graph.png"><img class="aligncenter" src="http://files.hypervisor.fr/img/cpu_core_usage/core_cpu_graph.png" alt="" width="494" height="279" /></a></p>
<p style="text-align: justify;">Après investigation, il s&#8217;agissait d&#8217;une mauvaise configuration ACPI/C-State dans le BIOS et comme nous ne sommes pas infaillibles, nous nous avons pondu un petit oneliner PowerCLI pour créer une alarme qui se base sur le compteur <strong>coreUtilization</strong> :</p>
<pre class="brush: powershell; title: ; notranslate">(Get-View AlarmManager).CreateAlarm((Get-Folder -NoRecursion |Get-View).MoRef,(New-Object VMware.Vim.AlarmSpec -Property @{Name = &quot;Host core usage&quot;;Description = &quot;Custom alarm to monitor core Utilization&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;cpu&quot;}|?{$_.nameinfo.key -match &quot;coreUtilization&quot;}|?{$_.RollupType -match &quot;average&quot;}).key;Instance = &quot;&quot;});Operator = &quot;isAbove&quot;;Yellow = &quot;7500&quot;;YellowInterval = &quot;300&quot;;Red = &quot;9000&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] {targetName} core usage is {newStatus}&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: justify;">Les seuils sont les mêmes que pour l&#8217;alarme &#8220;Host CPU Usage&#8221;, à savoir 75/90, mais nous avons réduit le temps pour l&#8217;alerte (red) à 3min au lieu de 5.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3806</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Les scripts Powershell indispensables à votre veeam backup</title>
		<link>http://www.hypervisor.fr/?p=3749</link>
		<comments>http://www.hypervisor.fr/?p=3749#comments</comments>
		<pubDate>Thu, 22 Mar 2012 08:19:52 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[veeam]]></category>
		<category><![CDATA[oneliner]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3749</guid>
		<description><![CDATA[MAJ 13/07/2012 : Mise à jour du script de récupération des fichiers de backup orphelins pour la v6, merci à Thierry pour le feedback.
Nous vous proposions il y a quelques temps un script qui stop les jobs en cours sur un serveur veeam backup, aujourd&#8217;hui nous allons plus loin dans la démarche avec 2 fichiers [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">MAJ 13/07/2012 : Mise à jour du script de récupération des fichiers de backup orphelins pour la v6, merci à <a href="http://www.hypervisor.fr/?p=3749&amp;cpage=1#comment-2352" target="_self">Thierry pour le feedback</a>.</p>
<p style="text-align: justify;">Nous vous proposions il y a quelques temps <a href="http://www.hypervisor.fr/?p=3442" target="_blank">un script qui stop les jobs en cours sur un serveur veeam backup</a>, aujourd&#8217;hui nous allons plus loin dans la démarche avec 2 fichiers xml correspondant à 2 export de tache planifiée pour Windows 2008 R2 contenant les commandes. <a href="http://files.hypervisor.fr/scripts/StopActiveVBRJobs.xml" target="_blank">Le fichier StopActiveVBRJobs.xml</a> va vous permettre de créer une tache planifiée qui arrêtera les jobs veeam en cours à 7h du matin, les jours de semaine, et <a href="http://files.hypervisor.fr/scripts/RetryFailedVBRJobs.xml" target="_blank">le fichier RetryFailedVBRJobs.xml</a> automatisera le retry des jobs arrêtés &#8221;manuellement&#8221; à 21h, les mêmes jours.</p>
<p style="text-align: justify;">Nous vous proposons également une <a href="http://files.hypervisor.fr/scripts/ExportVBRJobs.xml" target="_blank">tache planifiée qui automatise l&#8217;export des jobs veeam backup sur un partage CIFS</a> (\\server\share\ à ajuster) et un autre qui permet <a href="http://files.hypervisor.fr/scripts/ExportVBRRestorePoint.xml" target="_blank">d&#8217;exporter régulièrement (en xml) la liste des points de restauration possibles pour chaque vm de chaque job</a>.</p>
<p><img class="aligncenter" src="http://files.hypervisor.fr/img/veeam_rpoint_export.png" alt="" width="308" height="359" /></p>
<p style="text-align: justify;">Voici maintenant un oneliner pour un usage très particulier, celui de trouver (replacez le get-item par remove-item pour supprimer) les fichiers veeam backup orphelins dans les répertoires cibles des jobs (cela peut arriver en cas de reboot violent du serveur veeam ou indisponibilité du repository pendant un backup).</p>
<p>v5 :
<pre class="brush: powershell; title: ; notranslate">Compare-Object (Get-VBRJob|%{$_.Info.TargetDir|%{Get-ChildItem $_|%{$_.FullName}}}) (Get-VBRBackup|%{$_.GetStorages()|%{$_.FilePath}})|%{Get-Item $_.InputObject}</pre>
<p>v6 :
<pre class="brush: powershell; title: ; notranslate">Compare-Object (Get-VBRJob|%{$_.Info|%{Get-ChildItem &quot;$($_.TargetDir)\$($_.Path)&quot;|%{$_.FullName|?{$_ -match &quot;.vrb|.vbk|.vib&quot;}}}}) (Get-VBRBackup|%{$_.GetStorages()|%{$_.FilePath}})|%{Get-Item $_.InputObject}</pre>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/veeam_lostfiles/veeam_backup_files.png" title="veeam_backup_files" rel="lightbox[3749]"><img class="alignnone size-thumbnail wp-image-3768" title="veeam_backup_files" src="http://www.hypervisor.fr/wp-content/uploads/2012/03/veeam_backup_files-150x150.png" alt="" width="150" height="150" /></a> <a href="http://files.hypervisor.fr/img/veeam_lostfiles/veeam_lost_files.png" title="veeam_lost_files" rel="lightbox[3749]"><img class="alignnone size-thumbnail wp-image-3769" title="veeam_lost_files" src="http://www.hypervisor.fr/wp-content/uploads/2012/03/veeam_lost_files-150x150.png" alt="" width="150" height="150" /></a> <a href="http://files.hypervisor.fr/img/veeam_lostfiles/veeam_lost_files_list.png" title="veeam_lost_files_list" rel="lightbox[3749]"><img class="alignnone size-thumbnail wp-image-3770" title="veeam_lost_files_list" src="http://www.hypervisor.fr/wp-content/uploads/2012/03/veeam_lost_files_list-150x150.png" alt="" width="150" height="150" /></a></p>
<p style="text-align: justify;">On continue avec un autre oneliner qui permet d&#8217;afficher la liste des vm dont la date du dernier backup veeam (si vous avez activé <a href="http://www.veeam.com/blog/using-vm-attributes-to-quickly-determine-status-of-vm-backups.html" target="_blank">la fonction qui rempli l&#8217;un des custom fields</a>, &#8220;veeam&#8221; dans notre exemple) est supérieure à 21 jours, que vous pouvez utiliser dans un script pour vous envoyez un mail périodiquement par exemple.</p>
<pre class="brush: powershell; title: ; notranslate">Get-View -Viewtype virtualmachine|select name,@{n=&quot;backup&quot;;e={[Regex]::Match(($_.value|?{$_.key -eq ((get-view (Get-View ServiceINstance).content.CustomFieldsManager).field|?{$_.name -match &quot;veeam&quot;}).key}).value, &quot;([0-9]{1,2}/){2,2}201[0-9]{1,1}[ ]*([0-9]{1,2}:?){3,3}&quot;).Value}},@{n=&quot;pool&quot;;e={(get-view $_.ResourcePool).name}}|?{$_.backup}|?{([datetime]::ParseExact(($_.backup), &quot;dd/MM/yyyy HH:mm:ss&quot;, (New-Object System.Globalization.CultureInfo(&quot;fr-FR&quot;)))) -le (get-date).AddDays(-21)}</pre>
<p><a href="http://files.hypervisor.fr/img/veeam_lostfiles/veeam_lastbackup.png" title="veeam_lastbackup" rel="lightbox[3749]"><img class="aligncenter size-full wp-image-3771" title="veeam_lastbackup" src="http://www.hypervisor.fr/wp-content/uploads/2012/03/veeam_lastbackup.png" alt="" width="401" height="301" /></a></p>
<p style="text-align: justify;">Et pour finir, un oneliner qui nous a prit un peu de temps (à cause du comportement bizarre du -ExpandProperty de la cmdlet Select-Object) qui vous permet de lister les vm présentent dans plusieurs jobs de backup.</p>
<pre class="brush: powershell; title: ; notranslate">Get-VBRBackup|select jobname,@{n=&quot;vm&quot;;e={$_.GetObjectOibsAll()|%{@($_.name,&quot;&quot;)}}}|select jobname -ExpandProperty vm|select @{n=&quot;vmname&quot;;e={$_}}, @{n=&quot;jobname&quot;;e={$_.jobname}}|?{$_.vmname}|Group-Object -Property vmname|?{$_.Count -gt 1}|select name, @{n=&quot;jobs&quot;;e={$_.group|%{$_.JobName}}}</pre>
<p><a href="http://files.hypervisor.fr/img/veeam_lostfiles/veeam_multi_job.png" title="veeam_multi_job" rel="lightbox[3749]"><img class="aligncenter size-medium wp-image-3772" title="veeam_multi_job" src="http://www.hypervisor.fr/wp-content/uploads/2012/03/veeam_multi_job-300x148.png" alt="" width="300" height="148" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3749</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Resource Pool starter kit</title>
		<link>http://www.hypervisor.fr/?p=3752</link>
		<comments>http://www.hypervisor.fr/?p=3752#comments</comments>
		<pubDate>Wed, 21 Mar 2012 07:23:40 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[ResourcePool]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shares]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3752</guid>
		<description><![CDATA[Pour une petite infra ou lorsqu&#8217;on veut monter un vcenter vite fait tout en gardant une hiérarchisation des ressources, la solution de facilité est d&#8217;utiliser les paramètres Low, Normal et High des resource pool. Si vous n&#8217;avez pas 3 resource pool (Low, Normal et High) avec le même nombre de vm démarrées, vous risquez d&#8217;avoir [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Pour une petite infra ou lorsqu&#8217;on veut monter un vcenter vite fait tout en gardant <strong>une hiérarchisation des ressources</strong>, la solution de facilité est d&#8217;utiliser les paramètres <strong>Low</strong>, <strong>Normal </strong>et <strong>High </strong>des resource pool. Si vous n&#8217;avez pas 3 resource pool (Low, Normal et High) avec le même nombre de vm démarrées, vous risquez d&#8217;avoir de très mauvaises surprises&#8230;</p>
<p style="text-align: justify;">Le mécanisme de shares, parfois mal connu <strong>malgré son apparition dans VI3</strong> (<a href="http://www.vmware.com/support/vi3/doc/whatsnew_esx301_vc201.html" target="_blank">oui oui, en 2006</a>), est très bien expliqué <a href="http://www.yellow-bricks.com/2010/12/14/shares-set-on-resource-pools/" target="_blank">sur le blog de Duncan</a> ou par <a href="http://frankdenneman.nl/2011/07/vmware-vsphere-5-clustering-technical-deepdive/" target="_blank">Frank dans l’excellent  VMware vSphere 5 Clustering Technical Deepdive.</a></p>
<p style="text-align: center;"><a href="http://farm6.static.flickr.com/5120/5911879103_e46b825106.jpg" target="_blank"><img class="aligncenter" src="http://farm6.static.flickr.com/5120/5911879103_e46b825106.jpg" alt="" width="295" height="300" /></a></p>
<p style="text-align: justify;">Pour faire simple, si on veut toujours garder un bon ratio entres les pool, <strong>il faut recalculer les shares <strong>à</strong></strong><strong> chaque fois qu&#8217;une vm voit sa configuration cpu/mémoire changer ou qu&#8217;une vm est démarrée/arrêtée dans un des pool</strong>. L&#8217;idéal étant de le scripter, nous vous proposons un joli petit script PowerCLI (dérivé de celui <a href="http://www.yellow-bricks.com/2010/02/24/custom-shares-on-a-resource-pools-scripted/" target="_blank">posté par Andrew Mitchell sur le blog de Duncan</a>) qui fera tout cela pour vous sur <strong>un model standardisé</strong>.</p>
<p style="text-align: justify;">L&#8217;idée est d&#8217;avoir <strong>4 resource pool </strong>toujours équilibrés (<strong>GOLD</strong>, <strong>SILVER</strong>, <strong>BRONZE </strong>et <strong>COPPER</strong>) qui représentent l&#8217;usage &#8220;classique&#8221; d&#8217;un cluster VMware, à savoir prod, pré-prod, qualif et dev. La seule chose que vous devez fournir au script est le nom du cluster et (en option) les pourcentages respectifs que vous jugez idéal pour votre environnement (<strong>45%</strong>, <strong>30%</strong>, <strong>15% </strong>et <strong>10% </strong>par défaut).</p>
<p style="text-align: center;"><img class="aligncenter" style="text-align: left;" src="http://files.hypervisor.fr/img/standardized_cluster.png" alt="" width="176" height="310" /></p>
<p style="text-align: left;">Une fois les resource pool ajustés (si besoin), le script va créer <strong>pour le cluster un petit rapport html à la racine du site web du vcenter</strong> :</p>
<p style="text-align: left;"><a href="http://files.hypervisor.fr/img/standardized_cluster_report.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/standardized_cluster_report.png" alt="" width="487" height="127" /></a></p>
<p style="text-align: left;">Vous l&#8217;aurez compris, <strong>ce script est fait pour tourner sur le vcenter</strong> à l&#8217;aide d&#8217;une tache planifiée (<a href="http://files.hypervisor.fr/scripts/Set-ZResPoolShares.xml" target="_blank">modèle pour Windows 2008 R2</a>).</p>
<div class="wp-caption aligncenter" style="width: 110px"><a href="http://files.hypervisor.fr/scripts/Set-ZResPoolShares.ps1"><img class="            " title="Set-ZResPoolShares.ps1" src="http://files.hypervisor.fr/img/super_mario_piranha_plant.png" alt="" width="100" height="100" /></a><p class="wp-caption-text">Set-ZResPoolShares</p></div>
<p style="text-align: left;">Nous vous rappelons que <strong>ce script se base sur le mécanisme de shares </strong>(QOS)<strong> et non sur celui de reservation/limit</strong> et qu&#8217;il est donc indispensable de monitorer les pools pour éviter toute <strong>contention qui dépasserait vos prévisions</strong>. Pour les petites infra, le vcenter reste l&#8217;outil idéal à nos yeux :</p>
<p style="text-align: left;"><img class="aligncenter" src="http://files.hypervisor.fr/img/standardized_cluster_monitor.png" alt="" width="383" height="352" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3752</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>http://vcheck.vmwa.re</title>
		<link>http://www.hypervisor.fr/?p=3738</link>
		<comments>http://www.hypervisor.fr/?p=3738#comments</comments>
		<pubDate>Tue, 06 Mar 2012 14:12:14 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[vCheck]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3738</guid>
		<description><![CDATA[ Derrière cette url, qui se passe d&#8217;explications, se cache la version 6 de vcheck, le fameux script d&#8217;Alan Renouf auquel nous avons activement participé. Plutôt que de refaire un listing, on vous laisse aller voir chez vmdude.fr pour avoir la liste des nouveautés. Evidemment nous ne manquerons pas d&#8217;alimenter le repository (une des nouveautés) avec nos scripts  

]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"> Derrière cette url, qui se passe d&#8217;explications, se cache <a href="http://vcheck.vmwa.re" target="_blank">la version 6 de vcheck</a>, le fameux script d&#8217;Alan Renouf auquel <a href="http://www.hypervisor.fr/vcheck" target="_blank">nous avons activement participé</a>. Plutôt que de refaire un listing, on vous laisse aller <a href="http://www.vmdude.fr/tag/vcheck/" target="_blank">voir chez vmdude.fr pour avoir la liste des nouveautés</a>. Evidemment nous ne manquerons pas d&#8217;alimenter le repository (une des nouveautés) avec nos scripts <img src='http://www.hypervisor.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: center;"><a href="https://twitter.com/#!/PowerCLIMan"><img class="aligncenter" src="http://www.chrisschofield.me/wp-content/uploads/2011/08/PowerCLIman.jpg" alt="" width="307" height="230" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3738</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PowerCLI OneLiner repository</title>
		<link>http://www.hypervisor.fr/?p=3675</link>
		<comments>http://www.hypervisor.fr/?p=3675#comments</comments>
		<pubDate>Thu, 01 Mar 2012 08:14:23 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[oneliner]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3675</guid>
		<description><![CDATA[Plutôt que de les laisser moisir dans un coin, nous partageons nos perles de PowerCLI avec les amateurs de oneliner via notre nouvelle rubrique &#8220;One&#124;Liner&#8220;.

]]></description>
			<content:encoded><![CDATA[<p>Plutôt que de les laisser moisir dans un coin, nous partageons nos perles de PowerCLI avec les amateurs de oneliner via notre nouvelle rubrique &#8220;<a href="http://www.hypervisor.fr/?page_id=3637" target="_blank">One|Liner</a>&#8220;.</p>
<p><a href="http://kimjongillookingatthings.tumblr.com/"><img class="aligncenter" src="http://files.hypervisor.fr/img/oneliner/kimjongiloneliner.png" alt="" width="550" height="349" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3675</wfw:commentRss>
		<slash:comments>0</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>Snap Me If You Can</title>
		<link>http://www.hypervisor.fr/?p=3588</link>
		<comments>http://www.hypervisor.fr/?p=3588#comments</comments>
		<pubDate>Sun, 05 Feb 2012 23:44:30 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[ZFS]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[VAAI]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3588</guid>
		<description><![CDATA[En cherchant un paramètre dans la hidden_vmx_params liste extraite par William Lam, nous sommes tombé sur une option bien sympathique pour ceux qui aiment contrôler la situation ou qui détestent les mauvaises surprises en matière de snapshot : snapshot.minFreeSpace
Disons que vous souhaitez limiter la possibilité de faire un snapshot sur vos vm uniquement s&#8217;il y a suffisamment d&#8217;espace sur les datastore, vous utiliseriez notre beau [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">En cherchant un paramètre dans <a href="http://download.virtuallyghetto.com/hidden_vmx_params.html" target="_blank">la hidden_vmx_params liste extraite par William Lam</a>, nous sommes tombé sur une option bien sympathique pour ceux qui aiment contrôler la situation ou qui détestent les mauvaises surprises en matière de snapshot : <strong><a href="http://faq.sanbarrow.com/index.php?solution_id=1060" target="_blank">snapshot.minFreeSpace</a></strong></p>
<p style="text-align: justify;">Disons que vous souhaitez <strong>limiter la possibilité de faire un snapshot sur vos vm uniquement s&#8217;il y a suffisamment d&#8217;espace sur les datastore</strong>, vous utiliseriez notre beau petit one-liner fait main :</p>
<pre class="brush: powershell; title: ; notranslate">Get-View -ViewType virtualmachine|?{-not $_.Config.Template -and $_.Runtime.ConnectionState -eq &quot;connected&quot;}|?{($_.Config.Hardware.Device|?{$_.GetType().Name -eq&quot;VirtualDisk&quot;}|%{$_.Backing.FileName.split(&quot;[]&quot;)[1]}|sort -Unique|measure-object).count -eq 1}|%{$_.ReconfigVM((New-Object VMware.Vim.VirtualMachineConfigSpec -Property @{extraconfig=@((New-Object VMware.Vim.optionvalue -Property @{Key=&quot;snapshot.minFreeSpace&quot;; Value=&quot;$($($_.Config.Hardware.Device|?{$_.GetType().Name -eq&quot;VirtualDisk&quot;}|%{$_.CapacityInKB*1KB}|measure-object -sum).sum)&quot;}))}))}</pre>
<p style="text-align: justify;">Ce script fixe le snapshot.minFreeSpace à <strong>la somme de la taille des vmdk</strong> (taille max d&#8217;un snapshot) et se limite aux vm dont les <strong>vmdk</strong> résident sur <strong>un seul et unique datastore</strong>.</p>
<p style="text-align: justify;">Mais avant de passer ce script, peut être voudriez vous vérifier que vous n&#8217;avez pas des vm déjà dans cette situation ? Cet autre petit one-liner vous donnera la liste de chaque vm dont la taille totale est supérieure à l&#8217;espace libre du datastore où elle réside :</p>
<pre class="brush: powershell; title: ; notranslate">Get-View -ViewType virtualmachine|?{-not $_.Config.Template}|?{($_.Config.Hardware.Device|?{$_.GetType().Name -eq&quot;VirtualDisk&quot;}|%{$_.Backing.FileName.split(&quot;[]&quot;)[1]}|sort -Unique|measure-object).count -eq 1}|?{($_.Config.Hardware.Device|?{$_.GetType().Name -eq&quot;VirtualDisk&quot;}|%{$_.CapacityInKB*1KB}|measure-object -sum).sum -gt ((get-view -viewtype datastore -property name,summary -filter @{&quot;name&quot; = ($_.Config.Hardware.Device|?{$_.GetType().Name -eq&quot;VirtualDisk&quot;}|%{$_.Backing.FileName.split(&quot;[]&quot;)[1]}|sort -Unique)}).Summary.FreeSpace)}|select name</pre>
<p><img class="aligncenter" src="http://files.hypervisor.fr/img/snapshot.minFreeSpace.png" alt="" width="311" height="39" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3588</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[PSH] Egalisez vos datastores &#8211; MAJ</title>
		<link>http://www.hypervisor.fr/?p=3524</link>
		<comments>http://www.hypervisor.fr/?p=3524#comments</comments>
		<pubDate>Mon, 19 Dec 2011 09:26:28 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[dmotion]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[SDRS]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3524</guid>
		<description><![CDATA[MAJ 06/07/2015 : mise à jour du script (version 3.9) qui corrige le problème de retry loop et marque l&#8217;arrivée du script sur GitHub (thanks vmdude.fr)
MAJ 04/10/2013 : mise à jour du script (version 3.8) Filtrage des datastore en mode maintenance, affichage des vm &#8220;skippées&#8221; ou incompatibles et correction d&#8217;un bug lors de l&#8217;utilisation de [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><em><em><em><span style="color: #ff0000;">MAJ 06/07/2015</span> : mise à jour du script (version 3.9) qui corrige le problème de retry loop et marque <a href="https://github.com/v-team/powercli-toolbox/blob/master/Datastore-Equalizer.ps1" target="_blank">l&#8217;arrivée du script sur GitHub</a> (thanks <a href="http://www.vmdude.fr/" target="_blank">vmdude.fr</a>)</em></em></em></p>
<p style="text-align: justify;"><em><em><em><span style="color: #ff0000;">MAJ 04/10/2013</span> : mise à jour du script (version 3.8) Filtrage des datastore en mode maintenance, affichage des vm &#8220;skippées&#8221; ou incompatibles et correction d&#8217;un bug lors de l&#8217;utilisation de -vDiskFormat (thanks <a href="http://www.vmdude.fr/" target="_blank">vmdude.fr</a>) </em></em></em></p>
<p style="text-align: justify;"><em><em><span style="color: #ff0000;">MAJ 27/09/2013</span> : mise à jour du script (version 3.7) Renforcement des filtres.</em></em></p>
<p style="text-align: justify;"><em><em><span style="color: #ff0000;">MAJ 18/09/2013</span> : mise à jour du script (version 3.6) modification de l&#8217;objet du mailcheck pour les Storage Pod.</em></em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 13/09/2013</span><span style="font-style: italic;"> : mise à jour du script (version 3.5) possibilité d&#8217;égaliser un &#8220;datastore cluster&#8221; (-StoragePod), possibilité de recevoir un rapport par mail pour le vidage des datastore (-drainreport) et skip automatique des migrations en échec.</span></em></p>
<p style="text-align: center;"><em><a href="http://files.hypervisor.fr/img/equalizer_drainreport35.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/equalizer_drainreport35.png" alt="" width="450" height="186" /></a></em></p>
<p style="text-align: center;"><em><a href="http://files.hypervisor.fr/img/equalizer_console35.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/equalizer_console35.png" alt="" width="455" height="148" /></a><br />
</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 09/05/2013</span> : mise à jour du script (version 2.5) filtrage des vm dont la method &#8220;RelocateVM_Task&#8221; est disabled et ajout du paramètre -vi5 pour déplacer les vm avec snapshot</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 26/10/2012</span> : mise à jour du script (version 2.3) filtrage des vm non &#8220;connected&#8221;</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 07/07/2012</span> : mise à jour du script (version 2.2) filtrage des vm avec contrôleur scsi en mode bus-sharing</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 25/06/2012</span> : mise à jour du script (version 2.1) correction de bug d&#8217;espace libre mal remonté</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 02/04/2012 </span>: mise à jour du script (version 2.0) ajout du paramètre &#8221;bypass&#8221; pour déplacer toutes les vm sans filtrage.</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 09/02/2012</span> : mise à jour du script (version 1.6) ajout du pourcentage de &#8220;déviation&#8221; dans l&#8217;objet du mail :</em></p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/equalizer_mail_report.png"><img class="aligncenter" src="http://files.hypervisor.fr/img/equalizer_mail_report.png" alt="" width="426" height="120" /></a></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 09/02/2012</span> : mise à jour du script (version 1.5) avec l&#8217;ajout de l&#8217;option &#8220;mailcheck&#8221; afin de pouvoir utiliser le script en tache planifié. Exemple de one-liner qui compare les datastores VMFS de tous les cluster (à filtrer selon vos besoins) :</em></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 clustercomputeresource<span style="color: pink;">|?</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#40;</span><span style="color: #000080;">$_</span>.Datastore<span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span>get<span style="color: pink;">-</span>view <span style="color: #000080;">$_</span><span style="color: #000000;">&#125;</span><span style="color: pink;">|?</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.Summary.Accessible <span style="color: #FF0000;">-and</span> <span style="color: #000080;">$_</span>.Summary.MultipleHostAccess <span style="color: #FF0000;">-and</span> <span style="color: #000080;">$_</span>.Summary.<span style="color: #008080; font-weight: bold;">Type</span> <span style="color: #FF0000;">-match</span> <span style="color: #800000;">&quot;VMFS&quot;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.name<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>.count <span style="color: #FF0000;">-gt</span> <span style="color: #804000;">1</span><span style="color: #000000;">&#125;</span><span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span> .\Datastore<span style="color: pink;">-</span>Equalizer.ps1 <span style="color: #000000;">&#40;</span><span style="color: #000080;">$_</span>.Datastore<span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span>get<span style="color: pink;">-</span>view <span style="color: #000080;">$_</span><span style="color: #000000;">&#125;</span><span style="color: pink;">|?</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.Summary.Accessible <span style="color: #FF0000;">-and</span> <span style="color: #000080;">$_</span>.Summary.MultipleHostAccess <span style="color: #FF0000;">-and</span> <span style="color: #000080;">$_</span>.Summary.<span style="color: #008080; font-weight: bold;">Type</span> <span style="color: #FF0000;">-match</span> <span style="color: #800000;">&quot;VMFS&quot;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.name<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">-</span>mailcheck <span style="color: #804000;">1</span> <span style="color: pink;">-</span>clustername <span style="color: #000080;">$_</span>.name<span style="color: #000000;">&#125;</span></pre></div></div>

<p><em><span style="color: #ff0000;">MAJ 19/12/2011</span> : mise à jour du script (version 1.1) afin d&#8217;exclure les templates.</em></p>
<p><strong>Pour Noël, Hypervisor.fr vous offre une version &#8220;light&#8221; maison de Storage DRS</strong>. Si votre infra est encore en v4, ou que vous n&#8217;avez pas de licences enterprise++ pour votre infra v5 ou si vous ne voulez pas faire de <a href="http://pubs.vmware.com/vsphere-50/index.jsp?topic=/com.vmware.wssdk.apiref.doc_50/vim.StoragePod.html" target="_blank">Storage Pod</a> (aka <a href="http://www.vmware.com/fr/products/datacenter-virtualization/vsphere/vsphere-storage-drs/features.html">cluster de banques de données</a>) parce que ça fait trop cloud, notre script PowerCLI <strong><a href="https://github.com/v-team/powercli-toolbox/blob/master/Datastore-Equalizer.ps1">Datastore-Equalizer</a></strong> est fait pour vous.</p>
<p><img class="aligncenter" src="http://files.hypervisor.fr/img/equalizer.gif" alt="" width="96" height="96" /></p>
<p>Comme son nom le laisse deviner, ce script va vous permette <strong>d&#8217;égaliser l&#8217;espace libre d&#8217;un groupe de datastores</strong> (fonction &#8220;<span style="color: #800080;"><strong><span style="color: #ff00ff;">equalize</span></strong></span>&#8220;) ou de <strong>vider un datastore vers d&#8217;autres </strong><strong>(fonction &#8220;<span style="color: #33cccc;"><strong>drain</strong></span>&#8220;)</strong>. L&#8217;action à mener sera automatiquement déduite de la liste des datastores source/destination.</p>
<p><strong>Le principe de base est de déplacer la vm la plus petite du datastore le plus rempli vers le datastore le plus vide</strong>, en boucle jusqu&#8217;à ce que l&#8217;écart entre le pourcentage de remplissage du datastore le plus rempli et du plus vide soit inférieur ou égal à la variable $FreeSpaceDeviation (10% par défaut). Ce script étant clairement pensé pour les cluster, il ne vérifie pas que les datastores sont bien tous connectés aux même ESX. Par contre, les espaces restant sont vérifiés avant tout mouvement mais <strong>les VM avec snapshot, RDM ou ayant de multiple datastores ne seront pas déplacées</strong>. En option il est possible de forcer un autre format de vmdk (thin ou thick).</p>
<p>Voici la liste des paramètres (mandatory en <span style="color: #ff0000;">rouge</span>) :</p>
<ul>
<li><span style="color: #ff0000;">SrcDatastores (ex : DS1,DS2,DS3)</span></li>
<li>DstDatastores (=SrcDatastores par défaut)</li>
<li>vDiskFormat (as-source par défaut, thick ou thin en option)</li>
<li>FreeSpaceDeviation (10 par défaut, &lt;5 à éviter)</li>
<li>Force (0 par défaut, 1 pour éviter la confirmation ou pour une tache planifiée)</li>
<li>DatastoreFreeLimit (pourcentage disponible limite, 10 par défaut)</li>
</ul>
<p>Pour que ce soit vraiment la classe, le script vous affiche un petit récap du remplissage des datastores concernés avant d&#8217;agir :</p>
<p><a href="http://files.hypervisor.fr/img/equalizer_demo.png"><img class="aligncenter" src="http://files.hypervisor.fr/img/equalizer_demo.png" alt="" width="521" height="213" /></a></p>
<p><a href="http://files.hypervisor.fr/img/equalizer_drain_demo.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/equalizer_drain_demo.png" alt="" width="521" height="213" /></a></p>
<p>Pour <span style="text-decoration: line-through;">les fous</span> ceux qui ont déjà migré leur prod en vSphere 5, nous ferons bientot une version qui permet de bouger les vm avec snapshot&#8230;</p>
<div class="wp-caption aligncenter" style="width: 110px"><a href="https://github.com/v-team/powercli-toolbox/blob/master/Datastore-Equalizer.ps1"><img class="          " title="Datastore-Equalizer" src="http://files.hypervisor.fr/img/super_mario_piranha_plant.png" alt="" width="100" height="100" /></a><p class="wp-caption-text">Datastore-Equalizer</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3524</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>[PSH] Renommez vos ESXi à chaud</title>
		<link>http://www.hypervisor.fr/?p=3508</link>
		<comments>http://www.hypervisor.fr/?p=3508#comments</comments>
		<pubDate>Mon, 12 Dec 2011 17:48:09 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[vCenter]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3508</guid>
		<description><![CDATA[MAJ 06/01/2012 : Mise à jour des scripts pour conserver la configuration DNS
MAJ 12/12/2011 : Mise à jour des scripts pour assurer la cohérence hostname/HA
MAJ 15/12/2011 : Sur un cluster en v4 il nous a fallu désinstaller les agents aam manuellement et redémarrer le service hostd
Si vous avez besoin de changer le nom d&#8217;un ESXi connecté à [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 06/01/2012 </span>: Mise à jour des scripts pour conserver la configuration DNS</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 12/12/2011</span> : Mise à jour des scripts pour assurer la cohérence hostname/HA</em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 15/12/2011</span> : Sur un cluster en v4 il nous a fallu désinstaller les agents aam manuellement et redémarrer le service hostd</em></p>
<p style="text-align: justify;">Si vous avez besoin de changer le nom d&#8217;un ESXi connecté à un vCenter, <a href="http://http://kb.vmware.com/kb/1010821" target="_blank">la méthode officielle</a> consiste à détacher le server du vcenter, le renommer et le rattacher au vcenter. En plus d’être fastidieuse, cette action occasionnera la perte de certaines informations telles que les  statistiques ou le Swapfile Location. Pas cool.</p>
<p style="text-align: justify;">Heureusement pour nous, il existe une solution de contournement qui va encore nous faire tâter du PowerCLI : la méthode <a href="http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.HostSystem.html#reconnect" target="_blank">ReconnectHost</a> à laquelle on peut passer un certain nombre d&#8217;arguments comme le hostname ou plutôt un FQDN valide car ce paramètre n&#8217;à pas à correspondre obligatoirement au hostname de l&#8217;ESXi.</p>
<p style="text-align: justify;">vSphere/PowerCLI 4 :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>VMHost oldhostname.olddomain.com<span style="color: pink;">|</span>Get<span style="color: pink;">-</span>View<span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>View <span style="color: #000080;">$_</span>.ConfigManager.NetworkSystem<span style="color: #000000;">&#41;</span>.UpdateDnsConfig<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">New-Object</span> VMware.Vim.HostDnsConfig <span style="color: #008080; font-style: italic;">-property</span> <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Hostname <span style="color: pink;">=</span> <span style="color: #800000;">&quot;newhostname&quot;</span>;domainName <span style="color: pink;">=</span> <span style="color: #800000;">&quot;newdomain.com&quot;</span>;dhcp <span style="color: pink;">=</span> <span style="color: #000080;">$_</span>.Config.Network.DnsConfig.Dhcp;address <span style="color: pink;">=</span> <span style="color: #000080;">$_</span>.Config.Network.DnsConfig.Address;searchDomain <span style="color: pink;">=</span> <span style="color: #000080;">$_</span>.Config.Network.DnsConfig.SearchDomain<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<span style="color: #000080;">$_</span>.DisconnectHost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<span style="color: #000080;">$_</span>.ReconnectHost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">New-Object</span> VMware.Vim.HostConnectSpec <span style="color: #008080; font-style: italic;">-property</span> <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>HostName <span style="color: pink;">=</span> <span style="color: #800000;">&quot;newhostname.newdomain.com&quot;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p>vSphere/PowerCLI 5 :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>VMHost oldhostname.olddomain.com<span style="color: pink;">|</span>Get<span style="color: pink;">-</span>View<span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>View <span style="color: #000080;">$_</span>.ConfigManager.NetworkSystem<span style="color: #000000;">&#41;</span>.UpdateDnsConfig<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">New-Object</span> VMware.Vim.HostDnsConfig <span style="color: #008080; font-style: italic;">-property</span> <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Hostname <span style="color: pink;">=</span> <span style="color: #800000;">&quot;newhostname&quot;</span>;domainName <span style="color: pink;">=</span> <span style="color: #800000;">&quot;newdomain.com&quot;</span>;dhcp <span style="color: pink;">=</span> <span style="color: #000080;">$_</span>.Config.Network.DnsConfig.Dhcp;address <span style="color: pink;">=</span> <span style="color: #000080;">$_</span>.Config.Network.DnsConfig.Address;searchDomain <span style="color: pink;">=</span> <span style="color: #000080;">$_</span>.Config.Network.DnsConfig.SearchDomain<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<span style="color: #000080;">$_</span>.DisconnectHost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<span style="color: #000080;">$_</span>.ReconnectHost<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">New-Object</span> VMware.Vim.HostConnectSpec <span style="color: #008080; font-style: italic;">-property</span> <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>HostName <span style="color: pink;">=</span> <span style="color: #800000;">&quot;newhostname.newdomain.com&quot;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span><span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p style="text-align: justify;">Le one-liner ci-dessus (attention à la version) effectue les actions suivantes :</p>
<ul>
<li>déconnexion de oldhostname.olddomain.com du vcenter (et dé-configuration d&#8217;HA le cas échéant)</li>
<li>reconnexion de l&#8217;ESXi au vcenter avec le nouveau nom (si newhostname.newdomain.com est valide)</li>
<li>change le hostname newhostname et newdomain.com de l&#8217;ESXi (ne nécessite pas de reboot depuis la v4)</li>
</ul>
<p><strong><span style="color: #ff0000;">/!\ Ce script ne met pas à jour les IQN et ne régénère pas les certificats des ESXi /!\</span></strong></p>
<p style="text-align: center;">
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3508</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[PSH] Maîtrisez les versions des BIOS de vos cluster</title>
		<link>http://www.hypervisor.fr/?p=3485</link>
		<comments>http://www.hypervisor.fr/?p=3485#comments</comments>
		<pubDate>Sat, 10 Dec 2011 17:36:43 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[BIOS]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[x86]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3485</guid>
		<description><![CDATA[Au sein d&#8217;un même cluster , il a toujours été fortement recommandé d&#8217;uniformiser au maximum le hardware ainsi que le software. Cette règle s’appliquant évidement pour les versions de BIOS et firmware, nous étions parti sur un petit one-liner tout simple pour afficher la propriété HostBIOSInfo des ESX connectés à un vCenter mais nous avons très vite été surpris de constater [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Au sein d&#8217;un même cluster , il a toujours été fortement recommandé d&#8217;uniformiser au maximum le hardware ainsi que le software. Cette règle s’appliquant évidement pour les versions de BIOS et firmware, nous étions parti sur un petit one-liner tout simple pour afficher la propriété <a href="http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.host.BIOSInfo.html" target="_blank">HostBIOSInfo</a> des ESX connectés à un vCenter mais nous avons très vite été surpris de constater que cette propriété n&#8217;est pas toujours peuplée :</p>
<p><img class="aligncenter" src="http://files.hypervisor.fr/img/bios_ver_full.png" alt="" width="494" height="146" /></p>
<p><img class="aligncenter" src="http://files.hypervisor.fr/img/bios_ver_null.png" alt="" width="501" height="124" /></p>
<p>Nous nous sommes donc rabattu sur les informations remonté via <a href="http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.host.HealthStatusSystem.html#field_detail" target="_blank">les API CIM</a> :</p>
<p style="text-align: center;"><img class="aligncenter" src="http://files.hypervisor.fr/img/bios_ver_cim.png" alt="" width="479" height="49" /></p>
<p style="text-align: justify;">Tant qu&#8217;on y était, on a fignolé le truc pour que ça ne remonte que les cluster non uniformes :</p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/bios_check.png" target="_blank"><img class="aligncenter" src="http://files.hypervisor.fr/img/bios_check.png" alt="" width="521" height="537" /></a></p>
<div class="wp-caption aligncenter" style="width: 110px"><a href="http://files.hypervisor.fr/scripts/Get-BIOSMismatchVersion.ps1"><img class="         " title="Get-BIOSMismatchVersion" src="http://files.hypervisor.fr/img/super_mario_piranha_plant.png" alt="" width="100" height="100" /></a><p class="wp-caption-text">Get-BIOSMismatch</p></div>
<p style="text-align: justify;">Si vous préférez un bon vieux one-liner qui vous affiche les version des BIOS de tous vos ESX, c&#8217;est par ici :</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: pink;">|?</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.Runtime.ConnectionState <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">&quot;connected&quot;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">|</span>sort name<span style="color: pink;">|</span>select name<span style="color: pink;">,@</span><span style="color: #000000;">&#123;</span>n<span style="color: pink;">=</span><span style="color: #800000;">&quot;BiosVersion&quot;</span>;e<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">Regex</span><span style="color: #000000;">&#93;</span>::Match<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000080;">$_</span>.Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo<span style="color: pink;">|?</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.name <span style="color: #FF0000;">-match</span> <span style="color: #800000;">&quot;bios&quot;</span> <span style="color: #FF0000;">-and</span> <span style="color: #000080;">$_</span>.SensorType <span style="color: #FF0000;">-match</span> <span style="color: #800000;">&quot;Software Components&quot;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>.name<span style="color: pink;">,</span><span style="color: #800000;">&quot;BIOS (.*) (20[0-9]{2,2}-[0-9]{2,2}-[0-9]{2,2})&quot;</span><span style="color: #000000;">&#41;</span>.groups<span style="color: #000000;">&#91;</span><span style="color: #804000;">1</span><span style="color: #000000;">&#93;</span>.value<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">,@</span><span style="color: #000000;">&#123;</span>n<span style="color: pink;">=</span><span style="color: #800000;">&quot;ReleaseDate&quot;</span>;e<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">Regex</span><span style="color: #000000;">&#93;</span>::Match<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000080;">$_</span>.Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo<span style="color: pink;">|?</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.name <span style="color: #FF0000;">-match</span> <span style="color: #800000;">&quot;bios&quot;</span> <span style="color: #FF0000;">-and</span> <span style="color: #000080;">$_</span>.SensorType <span style="color: #FF0000;">-match</span> <span style="color: #800000;">&quot;Software Components&quot;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>.name<span style="color: pink;">,</span><span style="color: #800000;">&quot;BIOS (.*) (20[0-9]{2,2}-[0-9]{2,2}-[0-9]{2,2})&quot;</span><span style="color: #000000;">&#41;</span>.groups<span style="color: #000000;">&#91;</span><span style="color: #804000;">2</span><span style="color: #000000;">&#93;</span>.value<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p><em>PS : Il se peut que les infos visibles dans l&#8217;onglet &#8220;Hardware Status&#8221; du vSphere client ne correspondent pas à celle remonté en powershell, dans ce cas suivez les instructions de la <a href="http://kb.vmware.com/kb/1037330" target="_blank">kb 1037330</a>, si cela ne suffit pas il faudra rebooter l&#8217;ESX.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3485</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PSH] Cluster Profiles &#8211; MAJ</title>
		<link>http://www.hypervisor.fr/?p=3458</link>
		<comments>http://www.hypervisor.fr/?p=3458#comments</comments>
		<pubDate>Thu, 17 Nov 2011 08:33:26 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3458</guid>
		<description><![CDATA[MAJ 09/05/2013 : Mise à jour du script (1.5) pour supporter les changements de &#8220;definition&#8221; de powershell v3 et ajout du paramètre -NoOld pour ne pas générer un fichier .old.
MAJ 11/05/2012 : Script utilisé pour checker automatiquement vos clusters via une tache planifiée : ClusterProfileCheck.ps1
Thanks to Didier Pironet, our english followers can read this post without google translate  [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 09/05/2013</span><em> : Mise à jour du script (1.5) pour supporter <a href="http://files.hypervisor.fr/img/psh3_definition.png" target="_blank">les changements de &#8220;definition&#8221; de powershell v3</a> et ajout du paramètre -NoOld pour ne pas générer un fichier .old.</em></em></p>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 11/05/2012</span> : Script utilisé pour checker automatiquement vos clusters via une tache planifiée : <a href="http://files.hypervisor.fr/scripts/ClusterProfileCheck.ps1" target="_blank">ClusterProfileCheck.ps1</a></em></p>
<p style="text-align: justify;"><strong>Thanks to Didier Pironet, our english followers can <a href="http://deinoscloud.wordpress.com/2011/11/28/cluster-profiles/" target="_blank">read this post without google translate</a> <img src='http://www.hypervisor.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<p style="text-align: justify;">Inutile de vous rappeler l’intérêt des <a href="http://www.vmware.com/files/pdf/techpaper/VMW-Host-Profiles-Tech-Overview.pdf">Host Profiles</a> sur le plan déploiement et encore plus sur le plan suivi des ESX. Avec un bon <a href="http://www.hypervisor.fr/?p=2887" target="_blank">PXE Manager</a> et du powerCLI, on pourrait s&#8217;affranchir de la partie déploiement mais pour la partie suivit des modifications c&#8217;est devenu clairement incontournable (et c&#8217;est d&#8217;autant plus vrai en v5).</p>
<p style="text-align: justify;">Pour les Cluster, la gestion se fait toujours à l&#8217;ancienne : on configure bien comme il faut au début, on laisse passer 6 mois, une poignée de modifications et quelques plages de maintenance où on a désactivé l&#8217;Admission Control et passé DRS en Partially Automated, et on se retrouve avec une lame crashé et des VM qui n&#8217;ont pas redémarré parce qu&#8217;on avait oublié de réactivé HA. Evidemment c&#8217;est du vécu mais notre tout nouveau script PowerCLI va vous faire oublier toutes ces vilaines méthodes médiévales : Meet Manage-ClusterProfile.</p>
<p style="text-align: justify;">Manage-ClusterProfile à été conçu pour 3 taches très simples :</p>
<ul>
<li><strong>exporter </strong>la configuration d&#8217;un cluster vers un fichier profile</li>
<li><strong>comparer </strong>la configuration d&#8217;un cluster avec un profile</li>
<li><strong>importer </strong>un profile sur un cluster existant</li>
</ul>
<p style="text-align: justify;">Le fichier xml qui fait office de profile contient <strong>l&#8217;intégralité de la configuration du cluster</strong> (HA, DRS, DPM, rules, swapfile, etc&#8230;) et permet donc une comparaison détaillée (avec envoi de mail en option) :</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/ClusterProfile_check.png"><img class="aligncenter" src="http://files.hypervisor.fr/img/ClusterProfile_check.png" alt="" width="511" height="283" /></a></p>
<p style="text-align: left;"><a href="http://files.hypervisor.fr/img/ClusterProfile_mail.png"><img class="aligncenter" src="http://files.hypervisor.fr/img/ClusterProfile_mail.png" alt="" width="509" height="282" /></a></p>
<p style="text-align: justify;"><strong>La fonction d&#8217;import ne va utiliser que les paramètres propres aux cluster</strong>, les règles d&#8217;affinités et autres paramètres concernant les vm (customization HA/DRS/DPM) ne sont pas pris en compte.</p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/ClusterProfiles.png"><img class="aligncenter" src="http://files.hypervisor.fr/img/ClusterProfiles.png" alt="" width="487" height="163" /></a></p>
<p style="text-align: left;">Les différents input du script sont :</p>
<ul>
<li>ManagedCluster [nom du cluster]</li>
<li>Action [import|export|check]</li>
<li>ProfilePath [répertoire pour l'export|fichier xml pour l'import  et le check]</li>
<li>SendMail [1]</li>
<li>ForceImport [1]</li>
</ul>
<p style="text-align: justify;">En résumé ce script vous permettra de créer de nouveau cluster en important un profile template correspondant à vos critères (préalablement exporté d&#8217;un cluster vide par exemple) et de tracker tout changement de configuration indésirable. Si vous utilisez ce script en tache planifiée, il faudra évidement refaire un export de profile à chaque modification du cluster.</p>
<p style="text-align: justify;">Comme d&#8217;habitude, n’hésitez pas à nous faire partager votre feedback et vos suggestions dans les commentaires du post <img src='http://www.hypervisor.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Enjoy !</p>
<div class="wp-caption aligncenter" style="width: 110px"><a href="http://files.hypervisor.fr/scripts/Manage-ClusterProfile.ps1"><img class="       " title="Manage-ClusterProfile" src="http://files.hypervisor.fr/img/super_mario_piranha_plant.png" alt="" width="100" height="100" /></a><p class="wp-caption-text">Manage-ClusterProfile</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3458</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>[PSH] listing récursif des propriétés d&#8217;un objet</title>
		<link>http://www.hypervisor.fr/?p=3448</link>
		<comments>http://www.hypervisor.fr/?p=3448#comments</comments>
		<pubDate>Sat, 12 Nov 2011 01:33:41 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3448</guid>
		<description><![CDATA[MAJ 09/05/2013 : Mise à jour du script pour supporter les changements de &#8220;definition&#8221; de powershell v3.
MAJ 17/11/2011 : Modification du script pour une meilleure gestion des &#8220;VMware.Vim.OptionValue&#8221;, ClusterDasVmConfigInfo, ClusterDpmHostConfigInfo, ClusterDrsVmConfigInfo, ClusterGroupInfo, ClusterRuleInfo
MAJ 15/11/2011 : Modification du script pour une meilleure gestion des &#8220;scriptproperty&#8221;
MAJ 14/11/2011 : Modification du script pour la gestion des propriétés &#8220;value__&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><em><span style="color: #ff0000;">MAJ 09/05/2013</span><em> : Mise à jour du script pour supporter <a href="http://files.hypervisor.fr/img/psh3_definition.png" target="_blank">les changements de &#8220;definition&#8221; de powershell v3</a>.</em></em><br />
<em><span style="color: #ff0000;">MAJ 17/11/2011</span> : Modification du script pour une meilleure gestion des &#8220;VMware.Vim.OptionValue&#8221;, ClusterDasVmConfigInfo, ClusterDpmHostConfigInfo, ClusterDrsVmConfigInfo, ClusterGroupInfo, ClusterRuleInfo</em><br />
<em><span style="color: #ff0000;">MAJ 15/11/2011</span> : Modification du script pour une meilleure gestion des &#8220;scriptproperty&#8221;</em><br />
<em><span style="color: #ff0000;">MAJ 14/11/2011</span> : Modification du script pour la gestion des propriétés &#8220;value__&#8221; deserialized</em></p>
<p style="text-align: justify;">Pour les besoins d&#8217;un script en préparation, qui en ravira plus d&#8217;un (imaginez l&#8217;équivalent des Host Profiles pour les clusters&#8230;), nous avons eu besoin de <strong>lister récursivement les propriétés d&#8217;un objet Powershell</strong>. Nous avons donc pris comme base <a href="http://www.peetersonline.nl/index.php/powershell/list-all-properties-and-subproperties-of-a-variable-in-powershell/" target="_blank">le fameux script Get-ALLPropertyNames d&#8217;Hugo Peeters</a> et l&#8217;avons modifié pour qu&#8217;il supporte les &#8220;array&#8221; ainsi que les &#8220;<a href="http://en.wikipedia.org/wiki/Serialization#Windows_PowerShell" target="_blank">deserialized object</a>&#8220;. Nous l&#8217;avons aussi rebaptisé &#8220;Get-ALLProperties&#8221; par soucis de clarté à propos de sa fonction.</p>
<div class="wp-caption aligncenter" style="width: 110px"><a href="http://files.hypervisor.fr/scripts/Get-ALLProperties.ps1"><img class="      " title="Get-ALLProperties" src="http://files.hypervisor.fr/img/super_mario_piranha_plant.png" alt="" width="100" height="100" /></a><p class="wp-caption-text">Get-ALLProperties</p></div>
<p>Par curiosité, nous l&#8217;avons utilisé pour mesurer le nombre de propriétés d&#8217;un ESXi 5.0 de lab. Jugez vous même :</p>
<p><img class="aligncenter" src="http://files.hypervisor.fr/img/ESX5i_ALLproperties.png" alt="" width="460" height="85" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3448</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[VeeaM] Stopper les jobs VBR actifs &#8211; MAJ</title>
		<link>http://www.hypervisor.fr/?p=3442</link>
		<comments>http://www.hypervisor.fr/?p=3442#comments</comments>
		<pubDate>Mon, 07 Nov 2011 13:12:29 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[veeam]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3442</guid>
		<description><![CDATA[MAJ 15/10/2012 : En complément, voici un autre oneliner qui vous permettra de faire un &#8220;resume&#8221; des jobs volontairement arrêtés (v5/v6) :
Add-PSSnapin VeeamPSSnapIn ; Get-VBRJob&#124;?{$_.GetLastResult() -eq 'Failed'}&#124;?{($_&#124;%{$_.FindLastSession()}&#124;%{$_.info}).Description -match 'Job has been terminated'}&#124;%{Start-VBRJob $_ -RetryBackup -RunAsync}
Add-PSSnapin VeeamPSSnapIn ; Get-VBRJob&#124;?{$_.GetLastResult() -eq 'Failed'}&#124;?{($_.FindLastSession()&#124;%{$_.GetDetails()}) -match 'Job has been terminated'}&#124;%{Start-VBRJob $_ -RetryBackup -RunAsync}
MAJ 07/11/2011 : Apparemment ce sera possible dans la v6.
L&#8217;une des [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 15/10/2012</span> : En complément, voici un autre oneliner qui vous permettra de faire un &#8220;resume&#8221; des jobs <strong>volontairement arrêtés</strong> (v5/v6) :</em></p>
<pre class="brush: powershell; title: ; notranslate">Add-PSSnapin VeeamPSSnapIn ; Get-VBRJob|?{$_.GetLastResult() -eq 'Failed'}|?{($_|%{$_.FindLastSession()}|%{$_.info}).Description -match 'Job has been terminated'}|%{Start-VBRJob $_ -RetryBackup -RunAsync}</pre>
<pre class="brush: powershell; title: ; notranslate">Add-PSSnapin VeeamPSSnapIn ; Get-VBRJob|?{$_.GetLastResult() -eq 'Failed'}|?{($_.FindLastSession()|%{$_.GetDetails()}) -match 'Job has been terminated'}|%{Start-VBRJob $_ -RetryBackup -RunAsync}</pre>
<p style="text-align: justify;"><em><span style="color: #ff0000;">MAJ 07/11/2011</span> : <a href="https://twitter.com/#!/veeam/status/133534635983507456" target="_blank">Apparemment ce sera possible dans la v6</a>.</em></p>
<p style="text-align: justify;">L&#8217;une des petites options pratiques qui rapprocherai veeam backup de la perfection serai de pouvoir <strong>définir une heure limite d’exécution par job</strong>. Par exemple, vous ne voulez peut être pas qu&#8217;un job continue après 7h du matin. Pour ça il vous suffit de coller ce petit one-liner en tache planifiée sur votre serveur veeam et tous les jobs au statut &#8221;Working&#8221; serons stoppés :</p>
<pre class="brush: powershell; title: ; notranslate">Add-PSSnapin VeeamPSSnapIn ; Get-VBRJob|?{$_.GetLastState() -eq &quot;Working&quot;}|%{Stop-VBRJob $_ -RunAsync}</pre>
<p><img class="aligncenter" src="http://files.hypervisor.fr/img/powershell_logo_veeam.gif" alt="" width="200" height="200" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3442</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[PSH] One-Liner pour la Power Management Policy (C-States/P-States)</title>
		<link>http://www.hypervisor.fr/?p=3422</link>
		<comments>http://www.hypervisor.fr/?p=3422#comments</comments>
		<pubDate>Tue, 01 Nov 2011 11:12:41 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[DPM]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3422</guid>
		<description><![CDATA[Lorsque le matériel le permet et qu&#8217;il est configuré pour cela, ESX peut lui même (comme Hyper-V !) ajuster les différents C-States (modes d&#8217;économie d’énergie du CPU) afin d’être plus ou moins agressif en terme de consommation électrique. Les différents réglages et leurs comportement sont détaillés dans le Resource Management Guide mais il s&#8217;agit d&#8217;un réglage par host, à l&#8217;inverse de DPM qui agit au niveau d&#8217;un cluster. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Lorsque le matériel le permet et qu&#8217;il est configuré pour cela, ESX peut lui même (<a href="http://www.hypervisor.fr/?p=3037" target="_blank">comme Hyper-V !</a>) ajuster les différents <a href="http://www.hardwaresecrets.com/article/611" target="_blank">C-States</a> (modes d&#8217;économie d’énergie du CPU) afin d’être plus ou moins agressif en terme de consommation électrique. <strong>Les différents réglages et leurs comportement sont détaillés dans le <a href="http://pubs.vmware.com/vsphere-50/topic/com.vmware.vsphere.resmgmt.doc_50/GUID-4D1A6F4A-8C99-47C1-A8E6-EF3865603F5B.html?resultof=%22%70%6f%77%65%72%22%20%22%6d%61%6e%61%67%65%6d%65%6e%74%22%20%22%6d%61%6e%61%67%22%20" target="_blank">Resource Management Guide</a></strong> mais il s&#8217;agit d&#8217;un réglage par host, à l&#8217;inverse de DPM qui agit au niveau d&#8217;un cluster. Ce qui signifie qu&#8217;il vous faudra scripter tout réglage post déploiement mais ça tombe bien, on est la pour ça !</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.PowerSystem <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;^esxsrv$&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.PowerSystem<span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.ConfigurePowerPolicy<span style="color: #000000;">&#40;</span><span style="color: #804000;">2</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;">Avec ce petit one-liner, vous pourrez changer de <strong>1 (low power) à 3 (high performance)</strong> la stratégie de gestion d’énergie des ESX correspondant au filtre de la cmdlet Get-View.</p>
<p style="text-align: justify;"><strong>Nous rappelons que sur ESX 4, la stratégie par défaut est &#8220;High Performance&#8221; alors que sur ESX 5 la stratégie par défaut est &#8221;Balanced&#8221;</strong> malgré son comportement :</p>
<blockquote>
<p style="text-align: justify;">The VMkernel uses the available power management features conservatively to reduce host energy consumption with minimal compromise to performance.</p>
</blockquote>
<p style="text-align: left;">Voici un exemple des gains potentiels sur ESXi 5 :</p>
<p style="text-align: center;"><a href="http://files.hypervisor.fr/img/C-States.png"><img class="aligncenter" src="http://files.hypervisor.fr/img/C-States.png" alt="" width="479" height="258" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3422</wfw:commentRss>
		<slash:comments>0</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>[PSH] DasConfigInfo.HostMonitoring en OneLiner</title>
		<link>http://www.hypervisor.fr/?p=3328</link>
		<comments>http://www.hypervisor.fr/?p=3328#comments</comments>
		<pubDate>Tue, 27 Sep 2011 15:19:09 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[HA]]></category>
		<category><![CDATA[oneliner]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.hypervisor.fr/?p=3328</guid>
		<description><![CDATA[En vue d&#8217;une maintenance réseau, vous pourrez être amené à désactiver la fonction HostMonitoring d&#8217;HA comme le recommande VMware :
When making changes to the networks that your clustered ESX/ESXi hosts are on, VMware recommends that you suspend the Host Monitoring feature.
Nous vous recommandons pour cela notre petit OneLiner PowerCLI maison :

Get-View -ViewType ClusterComputeResource&#124;%&#123;$_.ReconfigureComputeResource_Task&#40;&#40;New-Object VMware.Vim.ClusterConfigSpecEx -Property @&#123;DasConfig=&#40;New-Object VMware.Vim.ClusterDasConfigInfo -Property @&#123;HostMonitoring=&#34;disabled&#34;&#125;&#41;&#125;&#41;, $true&#41;&#125;

Vous trouverez [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">En vue d&#8217;une maintenance réseau, vous pourrez être amené à désactiver la fonction HostMonitoring d&#8217;HA <a href="http://pubs.vmware.com/vsphere-esx-4-1/availability_guide/c_customha_bestprac_net.html" target="_blank">comme le recommande VMware</a> :</p>
<blockquote><p>When making changes to the networks that your clustered ESX/ESXi hosts are on, VMware recommends that you suspend the Host Monitoring feature.</p></blockquote>
<p style="text-align: justify;">Nous vous recommandons pour cela notre petit OneLiner PowerCLI maison :</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 ClusterComputeResource<span style="color: pink;">|%</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.ReconfigureComputeResource_Task<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">New-Object</span> VMware.Vim.ClusterConfigSpecEx <span style="color: #008080; font-style: italic;">-Property</span> <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>DasConfig<span style="color: pink;">=</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">New-Object</span> VMware.Vim.ClusterDasConfigInfo <span style="color: #008080; font-style: italic;">-Property</span> <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>HostMonitoring<span style="color: pink;">=</span><span style="color: #800000;">&quot;disabled&quot;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p>Vous trouverez facilement la commande inverse <img src='http://www.hypervisor.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypervisor.fr/?feed=rss2&amp;p=3328</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
