{"id":147,"date":"2019-01-14T13:30:03","date_gmt":"2019-01-14T13:30:03","guid":{"rendered":"http:\/\/www.djblond.cz\/?p=147"},"modified":"2019-02-11T17:23:14","modified_gmt":"2019-02-11T17:23:14","slug":"virtual-machine-show-0mb-disk-space","status":"publish","type":"post","link":"https:\/\/www.djblond.cz\/index.php\/2019\/01\/14\/virtual-machine-show-0mb-disk-space\/","title":{"rendered":"Virtual machine show 0MB disk space"},"content":{"rendered":"<p>Recently I had a very strange issue on Vmware ESXi 6.5. Two of the virutal machines shows 0MB disks. The virtual machines and operating system did run without issues. You could stop machine, restart machine, but from VMware point of view, you couldn&#8217;t migrate or even extend disk.<\/p>\n<p>I have also tried following recovery otpions (without luck)<\/p>\n<ul>\n<li>remove machine from invertory and add it back on second host<\/li>\n<li>restore machine from backup<\/li>\n<li>check snaphosts (no one snaphot was used)<\/li>\n<li>check VMX file and search inside if the machine pointing to snaphoted VMDK (usually 00001.vmdk)<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-150\" src=\"http:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/01\/Inkeddisk_zero_LI-300x285.jpg\" alt=\"\" width=\"522\" height=\"496\" srcset=\"https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/01\/Inkeddisk_zero_LI-300x285.jpg 300w, https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/01\/Inkeddisk_zero_LI-768x730.jpg 768w, https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/01\/Inkeddisk_zero_LI-624x594.jpg 624w, https:\/\/www.djblond.cz\/wp-content\/uploads\/2019\/01\/Inkeddisk_zero_LI.jpg 860w\" sizes=\"(max-width: 522px) 100vw, 522px\" \/><\/p>\n<p>I finally gave up and create support ticket for VMware and we have been able to resolve it by recreating the VMDK descriptors for each disk. Here are steps how to achieve it:<\/p>\n<ul>\n<li>You have to enable SSH on particular host where the machine is running<\/li>\n<li>Connect to SSH and go to\u00a0vmfs\/volumes\/\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">cd\u00a0vmfs\/volumes\/<\/pre>\n<\/li>\n<li>Locate on which datastore your machine is running and go to VM machine folder<\/li>\n<li>Create temporary directory, e.g. TEMP inside the VM folder. This step is for your safety, becuase we will be working inside this temp folder so we will not rewrite any original data. <span style=\"color: #ff0000;\"><strong>This step is very important and you sholud always do it this way so you will not accidentaly destroy original data.<\/strong><\/span>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">mkdir temp\u00a0<\/pre>\n<\/li>\n<li>Now list the current content of your VM folder. Use\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"> ls -la <\/pre>\n<p>and you sholud see somethinng like this<\/li>\n<\/ul>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">[root@host1:\/vmfs\/volumes\/5828af60-b805b1e5-67ef-28f10ed2bc11\/SLP-FT-APPS] ls -la\r\ntotal 195172392\r\ndrwxr-xr-x    1 root     root          3640 Jan 11 00:58 .\r\ndrwxr-xr-t    1 root     root          2940 Dec  6 00:27 ..\r\n-rw-r--r--    1 root     root           242 Dec  6 00:27 SLP-FT-APPS-7a7b605f.hlog\r\n-rw-------    1 root     root     6442450944 Jan 11 00:58 SLP-FT-APPS-9cf8f5c1.vswp\r\n-rw-r--r--    1 root     root            13 Jan 10 17:04 SLP-FT-APPS-aux.xml\r\n-rw-r--r--    1 root     root          8684 Jan 11 00:59 SLP-FT-APPS.nvram\r\n-rw-r--r--    1 root     root             0 Jan 11 00:58 SLP-FT-APPS.vmsd\r\n-rwxr-xr-x    1 root     root          6098 Jan 11 00:58 SLP-FT-APPS.vmx\r\n-rw-------    1 root     root             0 Jan 11 00:58 SLP-FT-APPS.vmx.lck\r\n-rw-r--r--    1 root     root          3239 Dec 29 07:37 SLP-FT-APPS.vmxf\r\n-rwxr-xr-x    1 root     root          5993 Jan 11 00:58 SLP-FT-APPS.vmx~\r\n-rw-------    1 root     root       5243392 Jan 11 00:59 SLP-FT-APPS1-ctk.vmdk\r\n-rw-------    1 root     root     85899345920 Jan 11 01:09 SLP-FT-APPS1-flat.vmdk\r\n-rw-------    1 root     root           560 Jan 11 00:58 SLP-FT-APPS1.vmdk\r\n-rw-------    1 root     root       6554112 Jan 11 00:59 SLP-FT-APPS1_1-ctk.vmdk\r\n-rw-------    1 root     root    107374182400 Jan 11 01:09 SLP-FT-APPS1_1-flat.vmdk\r\n-rw-------    1 root     root           575 Jan 11 00:58 SLP-FT-APPS1_1.vmdk\r\n-rw-r--r--    1 root     root       2997208 Dec  6 02:16 vmware-10.log\r\n-rw-r--r--    1 root     root       2837004 Jan 11 00:56 vmware-11.log\r\n-rw-r--r--    1 root     root        380110 Dec  6 02:16 vmware-6.log\r\n-rw-r--r--    1 root     root       1909306 Dec  6 02:16 vmware-7.log\r\n-rw-r--r--    1 root     root       7848280 Dec  6 02:16 vmware-8.log\r\n-rw-r--r--    1 root     root       2059993 Dec  6 02:16 vmware-9.log\r\n-rw-r--r--    1 root     root        301034 Jan 11 01:08 vmware.log\r\ndrwxr-xr-x    1 root     root           700 Jan 11 00:57 vmware_11.01.2019\r\n-rw-------    1 root     root     115343360 Jan 11 00:58 vmx-SLP-FT-APPS-2633561537-1.vswp<\/pre>\n<ul>\n<li>now you have to note the size of VMDK flat disk and name. <span style=\"color: #ff0000;\"><span style=\"color: #000000;\">In our case<\/span><strong> 85899345920 Jan 11&nbsp;01:09 SLP-FT-APPS1-flat.vmdk <\/strong><\/span><\/li>\n<li>go to the temp folder you have created\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">cd temp<\/pre>\n<\/li>\n<li>run following command\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">vmkfstools -c\u00a085899345920 SLP-FT-APPS1.vmdk-d thin<\/pre>\n<p>this command will create two new files<\/li>\n<\/ul>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">-rw------- 1 root root 60.0G Jan 11 01:54 SLP-FT-APPS1-flat.vmdk\r\n-rw------- 1 root root 502 Jan 11 01:54 SLP-FT-APPS1.vmdk<\/pre>\n<p>You can remove *-flat.vmdk, becuase we just need disk decriptor. Be careful, that you are still in your temp folder<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">rm *flat.vmdk<\/pre>\n<p>Now copy newly created .vmdk file out of the TEMP folder and rewrite the original. If you want to have backup of original file, rename it first.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">cd ..\r\n\r\nmv\u00a0SLP-FT-APPS1.vmdk\u00a0SLP-FT-APPS1.vmdk_original\r\n\r\ncp temp\/SLP-FT-APPS1.vmdk .<\/pre>\n<p>Finally we have to reload setting of the machine. First we will run command to get all VMs and make a note of VMid, then we will reload it.<br \/>\nTo get the machines run following command<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">vim-cmd vmsvc\/getallvms<\/pre>\n<p>From command I got, that my machine has ID 44, so we will reload it now<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">vim-cmd vmsvc\/reload 44<\/pre>\n<p>Review the results in vShpere client. If everything will be allright, we can remove our temporary folder<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">rm -rf temp\/<\/pre>\n<p>Hope that somebody will find this article helpful. In any case, just do not hesitate to ask via comments. I will reply as soon as possible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I had a very strange issue on Vmware ESXi 6.5. Two of the virutal machines shows 0MB disks. The virtual machines and operating system did run without issues. You&#8230; <a href=\"https:\/\/www.djblond.cz\/index.php\/2019\/01\/14\/virtual-machine-show-0mb-disk-space\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":190,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/posts\/147"}],"collection":[{"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":23,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":156,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/posts\/147\/revisions\/156"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/media\/190"}],"wp:attachment":[{"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.djblond.cz\/index.php\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}