<?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>Lostdomain.org &#187; vmware</title>
	<atom:link href="http://lostdomain.org/category/vmware/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostdomain.org</link>
	<description>To find yourself, think for yourself.</description>
	<lastBuildDate>Sat, 06 Mar 2010 02:24:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Snapshot hell: Recover a locked vmdk</title>
		<link>http://lostdomain.org/2009/05/14/recover-locked-vmdk/</link>
		<comments>http://lostdomain.org/2009/05/14/recover-locked-vmdk/#comments</comments>
		<pubDate>Thu, 14 May 2009 18:50:15 +0000</pubDate>
		<dc:creator>Martijn</dc:creator>
				<category><![CDATA[vmware]]></category>
		<category><![CDATA[snapshot]]></category>

		<guid isPermaLink="false">http://lostdomain.org/?p=87</guid>
		<description><![CDATA[I&#8217;ve had my share of battles with corrupt vmdk files, after the process of removing a snapshot crashed. Finally, I found a way to recover them through a VCB utility. Here&#8217;s the log that usually presents itself:
May 12 01:43:13.593: vmx&#124; DISKLIB-DSCPTR: Failed to open extents for descriptor file in normal mode
May 12 01:43:13.593: vmx&#124; DISKLIB-LINK [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had my share of battles with corrupt vmdk files, after the process of removing a snapshot crashed. Finally, I found a way to recover them through a VCB utility. Here&#8217;s the log that usually presents itself:</p>
<blockquote><p>May 12 01:43:13.593: vmx| DISKLIB-DSCPTR: Failed to open extents for descriptor file in normal mode<br />
May 12 01:43:13.593: vmx| DISKLIB-LINK  : &#8220;/vmfs/volumes/49dc603e-af139aaa-7131-002219b6f201/VM1/VM1.vmdk&#8221; : failed to open (Device or resource busy).<br />
May 12 01:43:13.593: vmx| DISKLIB-CHAIN : &#8220;/vmfs/volumes/49dc603e-af139aaa-7131-002219b6f201/VM1/VM1.vmdk&#8221; : failed to open (Device or resource busy).<br />
May 12 01:43:13.594: vmx| DISKLIB-LIB   : Failed to open &#8216;/vmfs/volumes/49dc603e-af139aaa-7131-002219b6f201/VM1/VM1.vmdk&#8217; with flags 0xa (Device or resource busy).<br />
May 12 01:43:13.594: vmx| DISK: Cannot open disk &#8220;/vmfs/volumes/49dc603e-af139aaa-7131-002219b6f201/VM1/VM1.vmdk&#8221;: Device or resource busy (1048585).<br />
May 12 01:43:13.594: vmx| Msg_Post: Error<br />
May 12 01:43:13.594: vmx| [msg.disk.noBackEnd] Cannot open the disk &#8216;/vmfs/volumes/49dc603e-af139aaa-7131-002219b6f201/VM1/VM1.vmdk&#8217; or one of the snapshot disks i<br />
t depends on.<br />
May 12 01:43:13.594: vmx| [msg.disk.configureDiskError] Reason: Device or resource busy.</p></blockquote>
<p>We will use the vcbExport utility to read the data from the old vmdk and create a new one. </p>
<p>First, unregister the VM from your ESX host (if not done already):</p>
<blockquote><p># cd /vmfs/volumes/49dc603e-af139aaa-7131-002219b6f201/<br />
# vmware-cmd -s unregister `pwd`/VM1/VM1.vmx<br />
unregister(/vmfs/volumes/49dc603e-af139aaa-7131-002219b6f201/VM1/VM1.vmx) = 1</p></blockquote>
<p>Then move the old VM directory and create a new one:</p>
<blockquote><p># mv VM1 VM1.old<br />
# mkdir VM1<br />
# cd VM1</p></blockquote>
<p>Then, convert the old vmdk to a new one:</p>
<blockquote><p># vcbExport -M 1 -F 1 -d VM1.vmdk -s ../VM1.old/VM1.vmdk</p></blockquote>
<p>This will take a while, depending on the size of your disks. After all, it is copying the entire data file. Do the same for the other vmdk&#8217;s, if you have more than one disk.</p>
<p>After you finish with vcbExport, we need to alter a few things to the .vmdk file(s); open it in your favorite editor.</p>
<p>Change:</p>
<blockquote><p>createType=&#8221;monolithicFlat&#8221;</p></blockquote>
<p>To:</p>
<blockquote><p>createType=&#8221;vmfs&#8221;</p></blockquote>
<p>Change: </p>
<blockquote><p>RW 56124534 FLAT &#8220;VM1-flat.vmdk&#8221; 0</p></blockquote>
<p>To:</p>
<blockquote><p>RW 56124534 VMFS &#8220;VM1-flat.vmdk&#8221;</p></blockquote>
<p>Copy .vmx and .vmxf file</p>
<blockquote><p># cp ../VM1.old/VM1.vmx* .</p></blockquote>
<p>After that, you can register and start the VM again:</p>
<blockquote><p># vmware-cmd -s register VM1.vmx<br />
register(/vmfs/volumes/49dc603e-af139aaa-7131-002219b6f201/VM1/VM1.vmx) = 1<br />
# vmware-cmd VM1.vmx start<br />
start() = 1</p></blockquote>
<p>The VM will require an answer on the UUID matter (choose &#8216;Keep&#8217;) before it actually boots:</p>
<blockquote><p># vmware-cmd VM1.vmx answer</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lostdomain.org/2009/05/14/recover-locked-vmdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
