{"id":1772,"date":"2011-07-02T19:09:11","date_gmt":"2011-07-03T02:09:11","guid":{"rendered":"http:\/\/greg.porter.name\/wordpress\/?p=1772"},"modified":"2011-07-29T13:27:25","modified_gmt":"2011-07-29T20:27:25","slug":"be-careful-when-putting-an-vmware-esx-host-in-maintenance-mode-with-a-vcli-script","status":"publish","type":"post","link":"https:\/\/greg.porter.name\/wordpress\/?p=1772","title":{"rendered":"Be Careful When Putting an VMware ESX Host in Maintenance Mode With A vCLI Script"},"content":{"rendered":"<p>If your VMware ESX hosts are like our ESX hosts, the hosts are in clusters and you have Distributed Resource Scheduling (DRS) enabled.\u00a0 So in the vCenter GUI, when you right click a host and select &#8220;Enter Maintenance Mode&#8221;, DRS evacuates all running virtual machines to other hosts in the cluster.<\/p>\n<p>I&#8217;m learning more about scripting actions like this with <a href=\"https:\/\/www.vmware.com\/pdf\/vsphere4\/r41\/vsp4_41_vcli_inst_script.pdf\">the vSphere Command-Line Interface (vCLI)<\/a>.<\/p>\n<p>Specifically, the book says that the vCLI command &#8220;vicfg-hostops &#8211;operation enter&#8221; (&#8220;Entering and Exiting Maintenance Mode with vicfg-hostops&#8221;, page 28) does exactly the same thing.\u00a0 In fact that page in the manual says &#8220;If VMware DRS is in use, virtual machines that are running on a host that enters maintenance mode are migrated to another host automatically.&#8221;<\/p>\n<p>This is <strong>*NOT*<\/strong> true.\u00a0 When you run this command, runnings vm&#8217;s are <strong>SUSPENDED<\/strong>, not migrated.<\/p>\n<p>As far as I can tell, I&#8217;m doing everything correctly.\u00a0 <a href=\"https:\/\/communities.vmware.com\/message\/1683678\">Others have seen the same thing<\/a>.<\/p>\n<p>I&#8217;m not sure if it&#8217;s a &#8220;feature&#8221; or what, but be careful.\u00a0 Telling a host to enter maintenance mode with a vCLI script may not migrate running machines.<\/p>\n<p>(If it matters, I&#8217;m running ESX 4.1, Update 1.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If your VMware ESX hosts are like our ESX hosts, the hosts are in clusters and you have Distributed Resource Scheduling (DRS) enabled.\u00a0 So in the vCenter GUI, when you right click a host and select &#8220;Enter Maintenance Mode&#8221;, DRS&hellip; <a href=\"https:\/\/greg.porter.name\/wordpress\/?p=1772\" 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-1772","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\/1772","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=1772"}],"version-history":[{"count":5,"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1772\/revisions"}],"predecessor-version":[{"id":1776,"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1772\/revisions\/1776"}],"wp:attachment":[{"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greg.porter.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}