{"id":3470,"date":"2016-12-19T13:49:19","date_gmt":"2016-12-19T12:49:19","guid":{"rendered":"http:\/\/tomaskalabis.com\/wordpress\/?p=3470"},"modified":"2016-12-19T15:08:50","modified_gmt":"2016-12-19T14:08:50","slug":"vmware-esxi-cannot-delete-file","status":"publish","type":"post","link":"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/","title":{"rendered":"VMware ESXi &#8211; Cannot delete file from datastore"},"content":{"rendered":"<h3>VMware ESXi &#8211; Cannot delete file from datastore<\/h3>\n<figure id=\"attachment_3465\" aria-describedby=\"caption-attachment-3465\" style=\"width: 355px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/12\/cannot-delete-file-2-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-3465 size-full\" src=\"http:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/12\/cannot-delete-file-2-1.png\" width=\"355\" height=\"110\" srcset=\"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/12\/cannot-delete-file-2-1.png 355w, https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/12\/cannot-delete-file-2-1-288x89.png 288w\" sizes=\"(max-width: 355px) 100vw, 355px\" \/><\/a><figcaption id=\"caption-attachment-3465\" class=\"wp-caption-text\">VMware ESXi &#8211; Cannot delete file from datastore<\/figcaption><\/figure>\n<p><a href=\"http:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/12\/cannot-delete-file-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-large wp-image-3461\" src=\"http:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/12\/cannot-delete-file-1-494x47.png\" alt=\"\" width=\"494\" height=\"47\" srcset=\"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/12\/cannot-delete-file-1-494x47.png 494w, https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/12\/cannot-delete-file-1-288x27.png 288w, https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2016\/12\/cannot-delete-file-1.png 591w\" sizes=\"(max-width: 494px) 100vw, 494px\" \/><\/a><\/p>\n<p>When you try and delete an orphaned VM or your old VM you get the error:<\/p>\n<pre class=\"theme:onderka15 lang:default decode:true \">\/vmfs\/volumes\/57b321fa-349912dc-bc05-90b11c3dbf06\/AD_replica # rm AD-flat.vmdk\r\nrm: can't remove 'AD-flat.vmdk': Device or resource busy<\/pre>\n<p>so let&#8217;s try to delete from command line (from ESXi host) but got the error message:&#8220;<strong>can&#8217;t remove &#8218;AD-flat.vmdk&#8216;: Device or resource busy<\/strong>&#8220; because the file is\u00a0still locked by ESX<\/p>\n<pre class=\"theme:pspad lang:default decode:true \"># vmkfstools -L release \/vmfs\/volumes\/IFT_Replica\/AD_replica\/AD-flat.vmdk\r\nCommand release failed\r\nError: Inappropriate ioctl for device<\/pre>\n<p>you can use the &#8222;vmkfstools&#8220; for release locked file&#8230; but in my case its not possible &#8222;<strong>release failed<\/strong>&#8220;<\/p>\n<p>Migrate off the VMs from the host and place it into maintenance mode and reboot it. After reboot try delete file, that was locked by ESXi host. For delete whole folder i used <strong>rm -rf<\/strong> command on the ESXi host.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VMware ESXi &#8211; Cannot delete file from datastore When you try and delete an orphaned VM or your old VM you get the error: \/vmfs\/volumes\/57b321fa-349912dc-bc05-90b11c3dbf06\/AD_replica # rm AD-flat.vmdk rm: can&#8217;t &#8230;<\/p>\n","protected":false},"author":2,"featured_media":2402,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[224,113],"tags":[220,80],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>VMware ESXi - Cannot delete file from datastore<\/title>\n<meta name=\"description\" content=\"VMware ESXi - Cannot delete file from datastore - When you try and delete an orphaned VM or your old VM you get the error: Device or resource busy&quot; because\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/\" \/>\n<meta property=\"og:locale\" content=\"cs_CZ\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VMware ESXi - Cannot delete file from datastore\" \/>\n<meta property=\"og:description\" content=\"VMware ESXi - Cannot delete file from datastore - When you try and delete an orphaned VM or your old VM you get the error: Device or resource busy&quot; because\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/\" \/>\n<meta property=\"og:site_name\" content=\"tomaskalabis.com\" \/>\n<meta property=\"article:published_time\" content=\"2016-12-19T12:49:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-12-19T14:08:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2015\/07\/vsphere_logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"164\" \/>\n\t<meta property=\"og:image:height\" content=\"164\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tomas Kalabis\" \/>\n<meta name=\"twitter:label1\" content=\"Napsal(a)\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tomas Kalabis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Odhadovan\u00e1 doba \u010dten\u00ed\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuta\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/\",\"url\":\"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/\",\"name\":\"VMware ESXi - Cannot delete file from datastore\",\"isPartOf\":{\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2015\/07\/vsphere_logo.png\",\"datePublished\":\"2016-12-19T12:49:19+00:00\",\"dateModified\":\"2016-12-19T14:08:50+00:00\",\"author\":{\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/8e7e83f618a561ed3734a38cef4cf1d6\"},\"description\":\"VMware ESXi - Cannot delete file from datastore - When you try and delete an orphaned VM or your old VM you get the error: Device or resource busy\\\" because\",\"breadcrumb\":{\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/#breadcrumb\"},\"inLanguage\":\"cs\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"cs\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/#primaryimage\",\"url\":\"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2015\/07\/vsphere_logo.png\",\"contentUrl\":\"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2015\/07\/vsphere_logo.png\",\"width\":164,\"height\":164},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tomaskalabis.com\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VMware ESXi &#8211; Cannot delete file from datastore\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/#website\",\"url\":\"https:\/\/tomaskalabis.com\/wordpress\/\",\"name\":\"tomaskalabis.com\",\"description\":\"my personal blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tomaskalabis.com\/wordpress\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"cs\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/8e7e83f618a561ed3734a38cef4cf1d6\",\"name\":\"Tomas Kalabis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"cs\",\"@id\":\"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9f7e4796b38d5720e8a07b918f423311?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9f7e4796b38d5720e8a07b918f423311?s=96&d=retro&r=g\",\"caption\":\"Tomas Kalabis\"},\"sameAs\":[\"https:\/\/x.com\/tomaskalabis\"],\"url\":\"https:\/\/tomaskalabis.com\/wordpress\/author\/kalabis\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"VMware ESXi - Cannot delete file from datastore","description":"VMware ESXi - Cannot delete file from datastore - When you try and delete an orphaned VM or your old VM you get the error: Device or resource busy\" because","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/","og_locale":"cs_CZ","og_type":"article","og_title":"VMware ESXi - Cannot delete file from datastore","og_description":"VMware ESXi - Cannot delete file from datastore - When you try and delete an orphaned VM or your old VM you get the error: Device or resource busy\" because","og_url":"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/","og_site_name":"tomaskalabis.com","article_published_time":"2016-12-19T12:49:19+00:00","article_modified_time":"2016-12-19T14:08:50+00:00","og_image":[{"width":164,"height":164,"url":"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2015\/07\/vsphere_logo.png","type":"image\/png"}],"author":"Tomas Kalabis","twitter_misc":{"Napsal(a)":"Tomas Kalabis","Odhadovan\u00e1 doba \u010dten\u00ed":"1 minuta"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/","url":"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/","name":"VMware ESXi - Cannot delete file from datastore","isPartOf":{"@id":"https:\/\/tomaskalabis.com\/wordpress\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/#primaryimage"},"image":{"@id":"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/#primaryimage"},"thumbnailUrl":"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2015\/07\/vsphere_logo.png","datePublished":"2016-12-19T12:49:19+00:00","dateModified":"2016-12-19T14:08:50+00:00","author":{"@id":"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/8e7e83f618a561ed3734a38cef4cf1d6"},"description":"VMware ESXi - Cannot delete file from datastore - When you try and delete an orphaned VM or your old VM you get the error: Device or resource busy\" because","breadcrumb":{"@id":"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/#breadcrumb"},"inLanguage":"cs","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/"]}]},{"@type":"ImageObject","inLanguage":"cs","@id":"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/#primaryimage","url":"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2015\/07\/vsphere_logo.png","contentUrl":"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2015\/07\/vsphere_logo.png","width":164,"height":164},{"@type":"BreadcrumbList","@id":"https:\/\/tomaskalabis.com\/wordpress\/vmware-esxi-cannot-delete-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tomaskalabis.com\/wordpress\/"},{"@type":"ListItem","position":2,"name":"VMware ESXi &#8211; Cannot delete file from datastore"}]},{"@type":"WebSite","@id":"https:\/\/tomaskalabis.com\/wordpress\/#website","url":"https:\/\/tomaskalabis.com\/wordpress\/","name":"tomaskalabis.com","description":"my personal blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tomaskalabis.com\/wordpress\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"cs"},{"@type":"Person","@id":"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/8e7e83f618a561ed3734a38cef4cf1d6","name":"Tomas Kalabis","image":{"@type":"ImageObject","inLanguage":"cs","@id":"https:\/\/tomaskalabis.com\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9f7e4796b38d5720e8a07b918f423311?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9f7e4796b38d5720e8a07b918f423311?s=96&d=retro&r=g","caption":"Tomas Kalabis"},"sameAs":["https:\/\/x.com\/tomaskalabis"],"url":"https:\/\/tomaskalabis.com\/wordpress\/author\/kalabis\/"}]}},"jetpack_featured_media_url":"https:\/\/tomaskalabis.com\/wordpress\/wp-content\/uploads\/2015\/07\/vsphere_logo.png","_links":{"self":[{"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/posts\/3470"}],"collection":[{"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3470"}],"version-history":[{"count":4,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/posts\/3470\/revisions"}],"predecessor-version":[{"id":3475,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/posts\/3470\/revisions\/3475"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/media\/2402"}],"wp:attachment":[{"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tomaskalabis.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}