Thursday, September 3, 2015

Which esxi host will be my HA master?


    Want to predict which host will become your high availability master?

    According to Duncan Epping's deep dive here

     The host that is participating in the election with the greatest number of connected datastores will be elected master. If two or more hosts have the same number of datastores connected, the one with the highest Managed Object Id will be chosen. This however is done lexically; meaning that 99 beats 100 as 9 is larger than 1

    So the host with the most datastores should win
    And if they have equal stores
    The host with the highest moid should win.


    Test A
    Here I have 4 hosts.
    Host 3 has 4 datastores every other host has 1
    Host3 should become the ha master

    Currently there is no HA master as it is off






    Turning on HA
    It installed on host 1 first so it came up first so it was the master.



    This is after it finished




    So the first host to have ha installed is the one that gets to be the master

    TestB
    What if we bump that one off?
    Will  #3 then become the master?








    Yes. As predicted #3 is the master


    TestC

    Now the other 3 hosts have the same number of datastores.
    So if we bump off 3 then when one will be the master?
    Lets look at the MOID
    Host 1 should be the master since it has a moid of 98.  remember lexically 94 > 103
    Host 3 moid 98 is already the master so it doesn’t count in our guess of who the master will be.






    Bump off #3

    Number 1 is the master



    Yes. As predicted #1 is the master
    -------------------------------------------------------------------------------
    As mentioned in an earlier post vSphere High Availability has been completely overhauled… This means some of the historical constraints have been lifted and that means you can / should / might need to change your design or implementation.
    What I want to discuss today is the changes around the Primary / Secondary node concept that was part of HA prior to vSphere 5.0. This concept basically limited you in certain ways… For those new to VMware /vSphere, in the past there was a limit of 5 primary nodes. As a primary node was a requirement to restart virtual machines you always wanted to have at least 1 primary node available. As you can imagine this added some constraints around your cluster design when it came to Blades environments or Geo-Dispersed clusters.
    vSphere 5.0 has completely lifted these constraints. Do you have a Blade Environment and want to run 32 hosts in a cluster? You can right now as the whole Primary/Secondary node concept has been deprecated. HA uses a new mechanism called the Master/Slave node concept. This concept is fairly straight forward. One of the nodes in your cluster becomes the Master and the rest become Slaves. I guess some of you will have the question “but what if this master node fails?”. Well it is very simple, when the master node fails an election process is initiated and one of the slave nodes will be promoted to master and pick up where the master left off. On top of that, lets take the example of a Geo-Dispersed cluster, when the cluster is split in two sites due to a link failure each “partition” will get its own master. This allows for workloads to be restarted even in a geographically dispersed cluster when the network has failed….
    What is this master responsible for? Well basically all the tasks that the primary nodes used to have like:
    • restarting failed virtual machines
    • exchanging state with vCenter
    • monitor the state of slaves
    As mentioned when a master fails a election process is initiated. The HA master election takes roughly 15 seconds. The election process is simple but robust. The host that is participating in the election with the greatest number of connected datastores will be elected master. If two or more hosts have the same number of datastores connected, the one with the highest Managed Object Id will be chosen. This however is done lexically; meaning that 99 beats 100 as 9 is larger than 1. That is a huge improvement compared to what is was like in 4.1 and prior isn’t it?
    ==========================================================================
    5. Can you brief what difference did you find between ESXi 4.1 and 5.0?

    VMware vSphere 4.1 HAVMware vSphere 5.0 HA
    It is called as Automated Availability Manager in this version.It is called as Fault Domain Manager in this version
    When we configure HA on vSphere 4.1 cluster, the first 5 hosts will be designated as Primary nodes, out of these 5 one node will act as “Master Primary” and which will handle restarts of VM’s in the event of a host failure. All the remaining hosts will join as Secondary Nodes.When we configure HA on vSphere 5.0 cluster, the first node will be elected as master and all other nodes will be configured slaves. Master node will be elected based on number of data stores it is connected to, and if all the hosts in cluster are connected to same number of data stores, host’s managed id will be taken into consideration. Host with highest managed id will be elected as master.
    Primary nodes maintain information about cluster settings and secondary node states. All these nodes exchange their heartbeat with each other to know the health status of other nodes.·         Primary nodes sends their heart beats to all other primary and secondary nodes.      Secondary nodes sends their heart beats to primaries only. Heart beats will be exchanged between all nodes every second.In case of a primary failure, other primary node will take the responsibility of restarts.If all primaries goes down at same point, no restarts will be initiated, in other words to initiate reboots at least one primary is required. Election of primary happens only during following scenarioso   When a host is disconnectedo   When a host is entered into maintenance modeo   When a host is not respondingo   And when cluster is reconfigured for HA.
    Link
    All hosts exchanges their heartbeats with each other to know about their health states.     Host Isolation response has been enhanced in this version, by introducing data store heart beating. Every host creates a hostname-hb file on the configured data stores and keeps it updated at specific interval. Two data stores will be selected for this purpose.   If we want to know who is master and who are slaves, just need to go to vCenter and click on Cluster Status from h
    =====================================================================
    Open the Web Browser and then Connect with this URL
    https://VCHostnameOrIPAddress/vod/index.html 
    Here authentication is required provide the credentials of vCenter administrator user here the click on the host status link

    Note:- MOID gets changed if host is removed from vCenter and then again added. 

No comments:

Post a Comment