• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

Disable DRS for a VM

Duncan Epping · Mar 28, 2018 ·

I have been having discussions with a customer who needs to disable DRS on a particular VM. I have written about disabling DRS for a host in the past, but not for a VM, well I probably have at some point but that was years ago. The goal here is to ensure that DRS won’t move a VM around but HA can still restart it. Of course you can create VM to Host rules, and you can create “must rules”. When you create must rules this could lead to an issue when the host on which the VM is running fails as HA will not restart it. Why? Well it is a “must rule”, which means that HA and DRS must comply to the rule specified. But there’s a solution, look at the screenshot below.

In the screenshot you see the “automation level” for the VM in the list, this is the DRS Automation level. (Yes the name will change in the H5 Client, making it more obvious what it is) You add VMs by clicking the green plus sign. Next you select the desired “automation mode” for those VMs and click okay. You can of course completely disable DRS for the VMs which should never be vMotioned by DRS, in this case during contention those “disabled VMs” are not considered at all. You can also set the automation mode to Manual or Partially Automated for those VMs as that gives you at least initial placement, but has as a downside that the VMs are considered for migration by DRS during contention. This could lead to a situation where DRS recommends that particular VM to be migrated, without you being able to migrate it. This in its turn could lead to VMs not getting the resources they require. So this is a choice you have to make, do I need initial placement or not?

If you prefer the VMs to stick to a certain host I would highly recommend to set VM/Host Rules for those VMs, use “should rules”, which define on which host the VM should run. Combined with the new Automation Level this will result in the VM being placed correctly, but not migrated by DRS when there’s contention. On top of that, it will allow HA to restart the VM anywhere in the cluster! Note that with “manual automation level” DRS will ask you if it is okay to place the VM on a certain host, with “partially automated” DRS will do the initial placement for you. In both cases balancing will not happen for those VMs automatically, but recommendations will be made, which you can ignore. (not use “safely”, as it may not be safe)

Related

Server 6.0, 6.5, drs, vSphere

Reader Interactions

Comments

  1. Benjamin Conrad says

    28 March, 2018 at 16:43

    On a related note, after deploying 1000’s of VMs using our scripts we noted that sometimes a vMotion would happen during OS customization and would break the deployment. Disabling DRS on the VM temporarily during the deployment and then back to automatic resolves this issue.

    • Duncan Epping says

      29 March, 2018 at 10:20

      I have never heard this before, thanks for leaving a comment as it may help others solving potential problems

  2. storagelearner1988 says

    28 March, 2018 at 17:18

    Please kindly help removing vSphere DRS advance option config parameter “TryBalanceVmsPerHost” Cluster. I try to remove myself but even after submitting OK the setting still exists.

    • Duncan Epping says

      29 March, 2018 at 10:19

      Please contact the VMware Global Support team, I can’t find much detail internally either.

  3. Babak says

    29 March, 2018 at 06:35

    Dear friend
    So thanks from this article
    But i have a few questions :
    1- if just automation level set on Disable just drs will be disable and if host that vm has been reside on that fail vm will be restart on the other host?

    2- if just create vm/host rule on my cluster and set type virtual machines to host and set must run on host in group this rule is just for HA or also this rule will be work for DRS??

    Br
    Babak

    • Duncan Epping says

      29 March, 2018 at 10:22

      1. You are mixing HA and DRS. HA restarts the VM, DRS does load balancing. If you disable the “automation mode” then DRS is disabled, HA will work fine!
      2. Cluster Rules are always for both HA and DRS. So if you set these it will apply to both “load balancing” and “restarts”

      • Babak says

        29 March, 2018 at 10:35

        So thanks
        About question2 is that your means if i set vm/host rule and define type to virtual machine to host and set must run on host vm just reside on define host and will not move for load balance or during host fail?

        2- if i do all of above just set should run on host instead of must run on host vm will be move in severe conditions while host fail and move for balance cluster?

        • Duncan Epping says

          29 March, 2018 at 10:44

          Like the post explains “must” is a mandatory rule. HA / DRS will never violate this.

          If you follow the above, and set the should rule then DRS will not balance the VM, but HA will be able to restart it

Primary Sidebar

About the author

Duncan Epping is a Chief Technologist in the Office of CTO of the Cloud Platform BU at VMware. He is a VCDX (# 007), the author of the "vSAN Deep Dive", the “vSphere Clustering Technical Deep Dive” series, and the host of the "Unexplored Territory" podcast.

Upcoming Events

May 24th – VMUG Poland
June 1st – VMUG Belgium
Aug 21st – VMware Explore
Sep 20th – VMUG DK
Nov 6th – VMware Explore
Dec 7th – Swiss German VMUG

Recommended Reads

Sponsors

Want to support Yellow-Bricks? Buy an advert!

Advertisements

Copyright Yellow-Bricks.com © 2023 · Log in