<?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>danejeffrey.com &#187; snapshots</title>
	<atom:link href="http://danejeffrey.com/blog/tag/snapshots/feed/" rel="self" type="application/rss+xml" />
	<link>http://danejeffrey.com/blog</link>
	<description>Good ways to break things.</description>
	<lastBuildDate>Tue, 06 Jul 2010 01:26:30 +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>My Favourite Topic (or Yet Another Lesson in Snapshot-ology)</title>
		<link>http://danejeffrey.com/blog/2010/04/29/my-favourite-topic-or-yet-another-lesson-in-snapshot-ology/</link>
		<comments>http://danejeffrey.com/blog/2010/04/29/my-favourite-topic-or-yet-another-lesson-in-snapshot-ology/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 07:18:17 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[snapshots]]></category>
		<category><![CDATA[vcb]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=307</guid>
		<description><![CDATA[Another snapshot post. Who new snapshots could be this awesome.
Again, the situation is VCB failing to remove the snapshot it took of a VM when the backup job that kicked it off failed (because of lack of disk space in this case).
First, vcbSnapshot was used to try and remove it via the VCB proxy manually. [...]]]></description>
			<content:encoded><![CDATA[<p>Another snapshot post. Who new snapshots could be this awesome.</p>
<p>Again, the situation is VCB failing to remove the snapshot it took of a VM when the backup job that kicked it off failed (because of lack of disk space in this case).</p>
<p>First, vcbSnapshot was used to try and remove it via the VCB proxy manually. For one reason or another, this failed and a Consolidate Helper- 0 snapshot is left behind. In the VI Client, it will show no snapshots in Snapshot Manager but a check of the VMDK targets show that the VM is indeed pointing to delta disks.</p>
<p>Tried taking a new snapshot manually to confirm the .vmsd file is not corrupt. The chain appeared good. Used:<br />
<code>vmare-cmd <vm_name>.vmx removesnapshots</code><br />
and received the error:<br />
<code>unable to access file <unknown> since it is locked</code></p>
<p>While looking into the problem, found these excellent resources for the undocumented vmkfstools -D switch which dumps file info to /var/log/vmkernel. It can be used to identify the owner of a file lock which could be causing the above error when trying to commit back the snapshot delta files:</p>
<p><a href="http://vi3.org/download/guides/english/vi3/StoppingaVMandReleasingFiles.pdf">http://vi3.org/download/guides/english/vi3/StoppingaVMandReleasingFiles.pdf</a><br />
<a href="http://blog.core-it.com.au/?p=477">http://blog.core-it.com.au/?p=477</a></p>
<p>In this case, however, I didn&#8217;t go through the process &#8211; instead took the coward&#8217;s way out and used: <code>service mgmt-vmware restart</code> on the host that the VM was running on and then used vmware-cmd to commit the snapshots &#8211; worked fine this time.</p>
<p>So, I would expect that if I had used the -D switch on the VMDK&#8217;s attached to the VM, the owner would have eventually been the ESX Host Agent which would be locking the file on behalf of the VCB request. Must remember to go through the process next time to find out for sure&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2010/04/29/my-favourite-topic-or-yet-another-lesson-in-snapshot-ology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMware ESX &#8211; Another Snapshot Fix</title>
		<link>http://danejeffrey.com/blog/2009/10/25/vmware-esx-another-snapshot-fix/</link>
		<comments>http://danejeffrey.com/blog/2009/10/25/vmware-esx-another-snapshot-fix/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 04:23:28 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[snapshots]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=201</guid>
		<description><![CDATA[As an update to this post, a snapshot chain could also become corrupt if for some reason the .vmsd file (snapshot definition file) does not get updated when a snapshot is taken. The result of this can be seen by running:
vmware-cmd &#60;vm-name&#62;.vmx hasnsapshot
and it returning blank, or by checking Snapshot Manager in Virtual Center and [...]]]></description>
			<content:encoded><![CDATA[<p>As an update to <a href="http://danejeffrey.com/blog/2009/09/17/vmware-esx-fixing-broken-corrupt-snapshot-chains/" target="_blank">this post</a>, a snapshot chain could also become corrupt if for some reason the .vmsd file (snapshot definition file) does not get updated when a snapshot is taken. The result of this can be seen by running:<br />
<code>vmware-cmd &lt;vm-name&gt;.vmx hasnsapshot</code><br />
and it returning blank, or by checking Snapshot Manager in Virtual Center and it being blank, however you know snapshots exist because when you check the VM&#8217;s .vmx file, it is referencing snapshot delta files not the parent vmdk.</p>
<p>The .vmsd file&#8217;s purpose is to maintain information about the snapshots on that VM. It is read by Virtual Center to get the snapshot name and chain details. It is also read by vmware-cmd in the above command.</p>
<p>The solution is is to first confirm that hte current snapshot CID / pCID chain and fix that if it is broken. Then remove the .vmsd file. Next, create a snapshot on the VM either through vmware-cmd or through Virtual Center (it&#8217;s best to do this logged into the ESX host directly rather than Virtual Center because we will also remove it from the host). Next, check the snapshot chain either in Virtual Center or using vmware-cmd, this time you should see hassnapshot = 1 and the fiull, correct chain in Virtual Center. Finally, if the chain is restored correctly, remove the snapshot chain as you would normally.</p>
]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2009/10/25/vmware-esx-another-snapshot-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMware ESX &#8211; Fixing Broken / Corrupt Snapshot Chains</title>
		<link>http://danejeffrey.com/blog/2009/09/17/vmware-esx-fixing-broken-corrupt-snapshot-chains/</link>
		<comments>http://danejeffrey.com/blog/2009/09/17/vmware-esx-fixing-broken-corrupt-snapshot-chains/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 12:12:40 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[snapshots]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=164</guid>
		<description><![CDATA[Have recently had to deal with a virtual machine regularly failing to remove snapshots via VCB. The VM has 3 VMDK&#8217;s connected to it and I&#8217;ve seen as many as 11 delta files per disk (through VCB and troubleshooting efforts, etc) &#8211; that&#8217;s 33 snapshot deltas in the working directory!
Anyway, what can happen is the [...]]]></description>
			<content:encoded><![CDATA[<p>Have recently had to deal with a virtual machine regularly failing to remove snapshots via VCB. The VM has 3 VMDK&#8217;s connected to it and I&#8217;ve seen as many as 11 delta files per disk (through VCB and troubleshooting efforts, etc) &#8211; that&#8217;s 33 snapshot deltas in the working directory!</p>
<p>Anyway, what can happen is the snapshot chain gets corrupted somehow and needs to be consistent before ESX can remove commit the snapshots back into the parent VMDK. You can see this happen when you run <code>vmware-cmd .vmx removesnapshots</code> and it returns quite quickly with an error.</p>
<p><strong>What to look at:</strong><br />
You need to go back through the VMDK chain and ensure that the parentCID and CID for each vmdk is intact and effectively makes a linked list of hex values that ties each delta to the next, all the way back to the parent disk.</p>
<p><strong>How to look at it:</strong><br />
Open an SSH session to the ESX host, cd to the snapshot working directory for the VM in question (likely going to be the location of the VM&#8217;s .vmx config file).<br />
ls -lah to check out the contents of the directory. We are looking for the *-00000X.vmdk files<br />
Starting with the original VMDK (you can cat the .vmx file to find out where that is located), cat the .vmdk file to check out the first CID field (the parentCID for the original VMDK will be all f&#8217;s).<br />
Take note of the CID then cat the next VMDK in the chain (i.e. the first delta&#8217;s VMDK file). The parentCID field should match the CID value you noted.<br />
Rinse and repeat all the way up the chain.</p>
<p><strong>How to fix it:</strong><br />
A broken link in the chain will be a VMDK that has the same parentCID as CID. Either field needs to be changed to something else (just change one letter or number is fine) then the corresponding file either up the chain or down the chain (depending on if you chainged parentCID or CID) also needs to be updated to complete the chain.<br />
Then, run <code>vmware-cmd .vmx removesnapshots</code> again and it should commit correctly.</p>
<p>I know the above isn&#8217;t all that clear &#8211; writing from memory rarely is. Will try to update when I have an example to refer to. Note there are a lot of good examples at <a href="http://communities.vmware.com">http://communities.vmware.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2009/09/17/vmware-esx-fixing-broken-corrupt-snapshot-chains/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
