vSAN1

 View Only
  • 1.  Keep a VM to belong to a certain host in a 2-node vSAN cluster

    Posted Jan 23, 2023 09:14 AM

    Hi community,

    I know, that using DRS anti-affinity rules, it is possible to keep a certain VM to belong to a certain vSAN Host, so in case of the Host going down, this VM will not start on the other Host, while the remaining VMs on the failing Host will start on the other Host through HA restart. This to be used, e.g. for some active-passive application redundancy, where a dedicated VM is running on each Host. The vSAN will still ensure, that the VM on the failed Host can be recreated in case of storage being damaged on the failing Host.

    My question is, if something similar can be done, in case of not having DRS as not having ESXi Enterprise+ licenses, but only ESXi Standard licenses?

    PS: At one time, I thought it could be done by setting HA restart priority to disabled on the VM to be isolated, but what actually happens, is that the VM is moved to other Host but not started. So when failing Host is started, e.g. after a temporary power loss, the VM will not be started on either Hosts. I had a support case on this, but the supporter did claim, that the only way to do the isolation is to use HA in combination with DRS. 

    Best regards

    Henrik        



  • 2.  RE: Keep a VM to belong to a certain host in a 2-node vSAN cluster

    Posted Jan 23, 2023 04:33 PM

    If you set the HA Restart Priority to Disabled, HA will never try to start the VM, even when the original host comes back online.

    Using DRS, you would have to set a rule that the VM MUST run on the host.  In a host failure, DRS will not "move" a VM, but there is a registration that will occur on remaining hosts that are in the cluster to ensure that VMs are not orphaned.

    Curious, what's the use case here for having a VM with no HA restart and cannot move to a different host?



  • 3.  RE: Keep a VM to belong to a certain host in a 2-node vSAN cluster

    Posted Jan 24, 2023 07:21 AM

    Hi Tibmeister,

    thanks for the answer.

    The use case for the setup is in short: Cluster applications with redundancy through software connectivity.

    2 ESXi Hosts each in a separate datacenter. Each Host has a VM with an application, where the applications are connected in an active-passive cluster configuration with a heartbeat function, so that the passive cluster node will take over instantly, if the Host with the active node goes down. So, as long one datacenter/Host is alive, this guaranties the application to be available. 

    With normal HA, if first Host-A goes down and later comes up, both cluster VMs will be running on Host-B. When Host-B goes down, the application will be unavailable until Host-A have the cluster VMs restarted. So in this setup, HA actually degrades application availability.           



  • 4.  RE: Keep a VM to belong to a certain host in a 2-node vSAN cluster

    Posted Jan 24, 2023 10:40 AM

    If HA is disabled for the VM then it still re-registers the VM indeed on another host. I would have to check if that can be disabled maybe with an advanced setting. We introduced this years ago as we had customers who had powered off VMs, which could not be powered on when a host failed as a result of HA not re-registering the VM on the host which is alive.

     

    Also, you CAN create "must" rules for VMs, even without vSphere DRS. So you could block the VM from being powered-on elsewhere, regardless of where it is registered if I am not mistaken.



  • 5.  RE: Keep a VM to belong to a certain host in a 2-node vSAN cluster

    Posted Jan 24, 2023 10:45 AM

    Found it. You can add an advanced setting. The setting is the following:

    das.reregisterRestartDisabledVMs

    add this and set it to "false", this will disable the re-registering of the VMs which are disabled for restarts.



  • 6.  RE: Keep a VM to belong to a certain host in a 2-node vSAN cluster

    Posted Jan 26, 2023 07:15 AM

    Thanks for the answer about the advanced setting depping. 

    Just to clarify. As it is to be used in combination with disabling HA restart priority; a host with such VM setting goes down, e.g. loosing power and power is restored, will the VM then start automatically, or needs to be started manual?   



  • 7.  RE: Keep a VM to belong to a certain host in a 2-node vSAN cluster

    Posted Jan 27, 2023 07:34 AM

    If you disable HA then you will need to manually restart it. That is unfortunately what that setting does. The only other option you have is "VM to Host" must rules, that will still register the VM somewhere else, but would block it from being powered on.



  • 8.  RE: Keep a VM to belong to a certain host in a 2-node vSAN cluster
    Best Answer

    Posted Jan 24, 2023 01:43 PM

    If you have the DRS rule set to keep the VMs separate then when Host-A comes back online one of the VMs will be immediately moved to that host. You can also pin a particular VM to Host-A to further manage it. 
    min this configuration, if Host-A goes down, both VMs will be running on Host-B until Host-A comes back, at which time the VMs will be separated again.