<?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; vmx</title>
	<atom:link href="http://www.hypervisor.fr/?feed=rss2&#038;tag=vmx" rel="self" type="application/rss+xml" />
	<link>http://www.hypervisor.fr</link>
	<description>French Bare-Metal weblog</description>
	<lastBuildDate>Wed, 26 Jun 2024 22:42:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[PSH] 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>Unable to access file  since it is locked</title>
		<link>http://www.hypervisor.fr/?p=2900</link>
		<comments>http://www.hypervisor.fr/?p=2900#comments</comments>
		<pubDate>Mon, 25 Apr 2011 23:03:10 +0000</pubDate>
		<dc:creator>NiTRo</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[SAN]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[vmdk]]></category>
		<category><![CDATA[VMFS]]></category>
		<category><![CDATA[vmx]]></category>

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



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

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

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