{"id":1786,"date":"2011-07-06T19:50:50","date_gmt":"2011-07-07T02:50:50","guid":{"rendered":"http:\/\/greg.porter.name\/wordpress\/?p=1786"},"modified":"2011-08-03T08:07:45","modified_gmt":"2011-08-03T15:07:45","slug":"growing-a-disk-is-always-a-bad-idea-if-you-have-snapshots","status":"publish","type":"post","link":"https:\/\/greg.porter.name\/wordpress\/?p=1786","title":{"rendered":"Growing a Disk is *ALWAYS* a Bad Idea if You Have Snapshots"},"content":{"rendered":"<blockquote>\n<h3><strong><strong><strong><strong>Never grow a disk if the machine has snapshots.\u00a0 Even if the GUI lets you.<\/strong><\/strong><\/strong><\/strong><\/h3>\n<\/blockquote>\n<p>This morning I got a request to grow a virtual disk on a vm.\u00a0 What you should do is look at the machine and see if it has any snapshots.\u00a0 If it does, then you should delete them before attempting any disk grow operations.\u00a0 In fact, what should happen is is if you try it, the GUI will give you an error stating that the &#8220;machine has snapshots, grow is not allowed&#8221;.\u00a0 I was going too fast (and didn&#8217;t have enough coffee) and tried growing  it with the machine on.\u00a0 It failed.\u00a0 I didn&#8217;t check for snapshots, I  just turned the machine off.\u00a0 Then I grew the disk.\u00a0 It allowed me to do  this.\u00a0 (Really, the GUI should have refused to do this.)\u00a0 This did *NOT* do what I expected&#8230;<\/p>\n<p><strong><strong><!--more--><br \/>\n<\/strong><\/strong><\/p>\n<p>Behind the scenes what happened was that the grow operation messed up the reference to the snapshot.\u00a0 So the disk I grew was basically the right size but missing the active snapshot.\u00a0 In effect, it looked like the disk from &#8220;way back when&#8221; (before the snapshot was made) and was missing a lot of contents.\u00a0 We tried various fiddling around with vmkfstools, etc., but it was never happy again.\u00a0 We wound up recovering the file system on the affected disk from tape.<\/p>\n<p>If I get bored someday, I&#8217;m going to see if this happens reliably with a test machine.\u00a0 In other words:<\/p>\n<ul>\n<li>Make a VM, put some stuff in it.<\/li>\n<li>Make a snapshot<\/li>\n<li>Change the vm, perhaps add some stuff into a file system.<\/li>\n<li>Attempt to grow a disk with it on (the GUI should stop you)<\/li>\n<li>Turn the machine off, attempt to grow a disk with it off (the GUI should stop you)<\/li>\n<\/ul>\n<p>If it reliably behaves like it did this morning (i.e. allows you to grow the disk, thereby destroying the vm), then it probably should be reported to VMware as a bug.<\/p>\n<p><a href=\"https:\/\/kb.vmware.com\/selfservice\/microsites\/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=994\">See this VMware KB article for the gory details:<\/a><\/p>\n<blockquote><p><strong><span style=\"font-size: 10pt;\"><span style=\"font-family: Arial;\"><span style=\"font-family: Arial; font-size: 10pt;\"><strong>Warning:<\/strong><\/span> In current versions of ESX 2.5, 3.x and 4.x, do not extend a disk that  has snapshots. Commit or discard snapshots before increasing the size of  the virtual disk. Extending the size of a virtual disk that has  snapshots invalidates the snapshots.<\/span><\/span><\/strong><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Never grow a disk if the machine has snapshots.\u00a0 Even if the GUI lets you. This morning I got a request to grow a virtual disk on a vm.\u00a0 What you should do is look at the machine and see&hellip; <a href=\"https:\/\/greg.porter.name\/wordpress\/?p=1786\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1786","post","type-post","status-publish","format-standard","hentry","category-content"],"_links":{"self":[{"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1786"}],"version-history":[{"count":22,"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1786\/revisions"}],"predecessor-version":[{"id":1804,"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1786\/revisions\/1804"}],"wp:attachment":[{"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}