{"id":94,"date":"2017-05-23T07:48:44","date_gmt":"2017-05-23T07:48:44","guid":{"rendered":"http:\/\/kanecharles.com\/?p=94"},"modified":"2017-05-23T07:56:37","modified_gmt":"2017-05-23T07:56:37","slug":"duplicate-nfs-datastore-names-appear-adding-multiple-hosts","status":"publish","type":"post","link":"http:\/\/kanecharles.com\/?p=94","title":{"rendered":"Duplicate NFS datastore names appear when adding to multiple hosts"},"content":{"rendered":"<p>I observed some strange behaviour in the lab recently whereby I was attempting to add an NFS datastore to all hosts (to be used as a <a href=\"https:\/\/blogs.vmware.com\/vsphere\/2012\/03\/setting-up-a-shared-vmware-tools-directory.html\">shared vmware tools repository<\/a>). I was expecting to see\u00a0<strong>vmtools<\/strong> as the datastore name\u00a0listed for all hosts, but instead saw\u00a0<strong>vmtools,\u00a0<\/strong><strong>vmtools (1)<\/strong><strong>,<\/strong>\u00a0and <strong>vmtools (2)<\/strong>.\u00a0This odd behaviour seemed to be inconsistent in that it wouldn&#8217;t always do 1:1 mapping of a single host to a datastore name and would often change the number of hosts attached to each datastore name. This appears to be some sort of race condition.<\/p>\n<p data-imagelightbox=\"g\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-96 size-medium aligncenter\" src=\"http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools1-800x221.png\" alt=\"vmtools (1) Datastore\" width=\"800\" height=\"221\" srcset=\"http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools1-800x221.png 800w, http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools1-1080x299.png 1080w, http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools1.png 1089w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p data-imagelightbox=\"g\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-97 size-medium aligncenter\" src=\"http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools2-800x204.png\" alt=\"vmtools (2) Datastore\" width=\"800\" height=\"204\" srcset=\"http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools2-800x204.png 800w, http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools2.png 1076w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p data-imagelightbox=\"g\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-95 size-medium aligncenter\" src=\"http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools-800x200.png\" alt=\"vmtools Datastore\" width=\"800\" height=\"200\" srcset=\"http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools-800x200.png 800w, http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools-1080x270.png 1080w, http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools.png 1090w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>I spent the best part of an hour trying to work out exactly why this was happening, and could not come to a conclusion. Thus, I did what any person with a little bit of\u00a0OCD would do, I persisted to get some consistency.<\/p>\n<h2>The solution<\/h2>\n<p>Use PowerCLI.<\/p>\n<p data-imagelightbox=\"g\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"95\" class=\"size-medium wp-image-98 alignleft\" src=\"http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/add_nfs_datastore-800x95.png\" alt=\"New-Datastore\" srcset=\"http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/add_nfs_datastore-800x95.png 800w, http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/add_nfs_datastore-1440x171.png 1440w, http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/add_nfs_datastore-1080x128.png 1080w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<pre class=\"lang:default decode:true\">Get-VMHost | New-Datastore -Nfs -Name vmtools -Path \/mnt\/ssd120\/vmware\/vmtools\/ -NfsHost 192.168.200.250<\/pre>\n<p>Tweak your PowerCLI to suit your needs. Whilst this is common knowledge for most people, it should be noted that it was the only method I could find that ensure consistent naming across all hosts.<\/p>\n<p>&nbsp;<\/p>\n<p>For reference, this was observed\u00a0against vCenter Server Appliance 6.5.0d and ESXi 6.5.0d.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I observed some strange behaviour in the lab recently whereby I was attempting to add an NFS datastore to all hosts (to be used as a shared vmware tools repository). I was expecting to see\u00a0vmtools&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[22],"tags":[32,33,29,30,34,31,28,35,23,36],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Duplicate NFS datastore names appear when adding to multiple hosts - Just Virtualise It<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/kanecharles.com\/?p=94\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Duplicate NFS datastore names appear when adding to multiple hosts - Just Virtualise It\" \/>\n<meta property=\"og:description\" content=\"I observed some strange behaviour in the lab recently whereby I was attempting to add an NFS datastore to all hosts (to be used as a shared vmware tools repository). I was expecting to see\u00a0vmtools&hellip;\" \/>\n<meta property=\"og:url\" content=\"http:\/\/kanecharles.com\/?p=94\" \/>\n<meta property=\"og:site_name\" content=\"Just Virtualise It\" \/>\n<meta property=\"article:published_time\" content=\"2017-05-23T07:48:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-05-23T07:56:37+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools1-800x221.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/kanecharles.com\/?p=94\",\"url\":\"http:\/\/kanecharles.com\/?p=94\",\"name\":\"Duplicate NFS datastore names appear when adding to multiple hosts - Just Virtualise It\",\"isPartOf\":{\"@id\":\"https:\/\/kanecharles.com\/#website\"},\"datePublished\":\"2017-05-23T07:48:44+00:00\",\"dateModified\":\"2017-05-23T07:56:37+00:00\",\"author\":{\"@id\":\"https:\/\/kanecharles.com\/#\/schema\/person\/74979a618948fe77d9532fb02459a01f\"},\"breadcrumb\":{\"@id\":\"http:\/\/kanecharles.com\/?p=94#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/kanecharles.com\/?p=94\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/kanecharles.com\/?p=94#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kanecharles.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Duplicate NFS datastore names appear when adding to multiple hosts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kanecharles.com\/#website\",\"url\":\"https:\/\/kanecharles.com\/\",\"name\":\"Just Virtualise It\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kanecharles.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/kanecharles.com\/#\/schema\/person\/74979a618948fe77d9532fb02459a01f\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kanecharles.com\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/2.gravatar.com\/avatar\/2355263244a445329266499f6a0c0bf2?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/2.gravatar.com\/avatar\/2355263244a445329266499f6a0c0bf2?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"http:\/\/kanecharles.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Duplicate NFS datastore names appear when adding to multiple hosts - Just Virtualise It","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":"http:\/\/kanecharles.com\/?p=94","og_locale":"en_US","og_type":"article","og_title":"Duplicate NFS datastore names appear when adding to multiple hosts - Just Virtualise It","og_description":"I observed some strange behaviour in the lab recently whereby I was attempting to add an NFS datastore to all hosts (to be used as a shared vmware tools repository). I was expecting to see\u00a0vmtools&hellip;","og_url":"http:\/\/kanecharles.com\/?p=94","og_site_name":"Just Virtualise It","article_published_time":"2017-05-23T07:48:44+00:00","article_modified_time":"2017-05-23T07:56:37+00:00","og_image":[{"url":"http:\/\/kanecharles.com\/wp-content\/uploads\/2017\/05\/vmtools1-800x221.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/kanecharles.com\/?p=94","url":"http:\/\/kanecharles.com\/?p=94","name":"Duplicate NFS datastore names appear when adding to multiple hosts - Just Virtualise It","isPartOf":{"@id":"https:\/\/kanecharles.com\/#website"},"datePublished":"2017-05-23T07:48:44+00:00","dateModified":"2017-05-23T07:56:37+00:00","author":{"@id":"https:\/\/kanecharles.com\/#\/schema\/person\/74979a618948fe77d9532fb02459a01f"},"breadcrumb":{"@id":"http:\/\/kanecharles.com\/?p=94#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/kanecharles.com\/?p=94"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/kanecharles.com\/?p=94#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kanecharles.com\/"},{"@type":"ListItem","position":2,"name":"Duplicate NFS datastore names appear when adding to multiple hosts"}]},{"@type":"WebSite","@id":"https:\/\/kanecharles.com\/#website","url":"https:\/\/kanecharles.com\/","name":"Just Virtualise It","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kanecharles.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/kanecharles.com\/#\/schema\/person\/74979a618948fe77d9532fb02459a01f","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kanecharles.com\/#\/schema\/person\/image\/","url":"http:\/\/2.gravatar.com\/avatar\/2355263244a445329266499f6a0c0bf2?s=96&d=mm&r=g","contentUrl":"http:\/\/2.gravatar.com\/avatar\/2355263244a445329266499f6a0c0bf2?s=96&d=mm&r=g","caption":"admin"},"url":"http:\/\/kanecharles.com\/?author=1"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8faOH-1w","_links":{"self":[{"href":"http:\/\/kanecharles.com\/index.php?rest_route=\/wp\/v2\/posts\/94"}],"collection":[{"href":"http:\/\/kanecharles.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/kanecharles.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/kanecharles.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kanecharles.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=94"}],"version-history":[{"count":5,"href":"http:\/\/kanecharles.com\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":106,"href":"http:\/\/kanecharles.com\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions\/106"}],"wp:attachment":[{"href":"http:\/\/kanecharles.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kanecharles.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kanecharles.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}