[SOLVED] Is it possible to make failover with 2 nodes and zfs

Discussion in 'Proxmox VE: Installation and configuration' started by fxandrei, May 15, 2019.

  1. fxandrei

    fxandrei Member

    Joined:
    Jan 10, 2013
    Messages:
    47
    Likes Received:
    1
    So i have 2 servers, with proxmox 5.4 installed, with zfs disks, and configured in a cluster.
    They are identical.
    One very important thing is that i have no shared storage. So the vms run locally (as is, they have local disks.... so no live migration).

    So i have some vms on node1.
    From what i know i can replicate the disks from node1 on node2 (because of zfs) and if node1 fails i can manually restart them on node2.
    Is there a way to have auto failover ?

    So for me this scenario would work:
    - have the disks replicated from node1 to node2
    - if node1 fails the vms should start on node2 with the replicated disks (even if they are not the latest disks).
    - manually revert back node1 when possible

    Anyone ever had this scenario ?
     
  2. Richard

    Richard Proxmox Staff Member
    Staff Member

    Joined:
    Mar 6, 2015
    Messages:
    662
    Likes Received:
    23

    That's possible, but not in a 2-node cluster. If in a 2-node cluster 1 one fails also the other is not operable (quorum missed). If you add a 3rd node the requested scenario will work - HA has to be configured.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. James Crook

    James Crook Member
    Proxmox Subscriber

    Joined:
    Jul 28, 2017
    Messages:
    34
    Likes Received:
    1
    I kept getting asked this, as we only have two machines, the short answer as above it no. You need to have odd voting, so in theory you could have a node with 2 votes and one with 1, but this will mean it will never really failover (unless you then edit the votes after the host goes down)

    It's easier to have a small 3rd node (NUC or other small PC), just powerfull enough to run Proxmox, but not host any machines, that would give you the 3rd vote, and enable you to have failover.
     
  4. fxandrei

    fxandrei Member

    Joined:
    Jan 10, 2013
    Messages:
    47
    Likes Received:
    1
    This will "fix" just the votes problem (maybe i can have a vm with proxmox on another server).
    But what about the fact that i dont have a shared storage?
     
  5. James Crook

    James Crook Member
    Proxmox Subscriber

    Joined:
    Jul 28, 2017
    Messages:
    34
    Likes Received:
    1
    Could you not use the ZFS send in proxmox and send snapshots every 5 minutes?
     
  6. Richard

    Richard Proxmox Staff Member
    Staff Member

    Joined:
    Mar 6, 2015
    Messages:
    662
    Likes Received:
    23
    In case of ZFS you don't need shared storage. Works with replication, see https://pve.proxmox.com/pve-docs/pve-admin-guide.html#chapter_pvesr

    Note that live migration does not work in that case.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. fxandrei

    fxandrei Member

    Joined:
    Jan 10, 2013
    Messages:
    47
    Likes Received:
    1
    Well this is not clear to me.
    If i add another node to the cluster, i can then make a ha group consisting of the "real" nodes right ?!
    Then i go and replicate the disks from node a to node b (the real nodes).
    If nodeA fails, the will get restarted on nodeB ?
     
  8. Richard

    Richard Proxmox Staff Member
    Staff Member

    Joined:
    Mar 6, 2015
    Messages:
    662
    Likes Received:
    23
    Right
    Yes
    Yes
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. fxandrei

    fxandrei Member

    Joined:
    Jan 10, 2013
    Messages:
    47
    Likes Received:
    1
    I will try this out as soon as i have some spare time, and get back here.
     
  10. fxandrei

    fxandrei Member

    Joined:
    Jan 10, 2013
    Messages:
    47
    Likes Received:
    1
    So this seems to be working.
    I made another vm on another server that was in the same network as the 2 real nodes.
    I added this vm to the cluster, and the made a ha group consisting of the 2 real nodes.
    The zfs replication was on for each vm

    I then moved one vm on node2, and went ahead and force-reset it.
    I saw that the vm that was on node2 migrated to node2 and started.

    Another thing that i observed is the fact that if migrate a vm to one node, its replication setting changes so that it replicates to the node it came from.

    This is pretty nice.
    A HA cluster with 2 nodes and no shared storage.

    One thing to mention is the fact that you cannot live migrate a vm from the GUI, and this quote from the proxmox wiki :
    So if the vms used change a lot, well, you probably should try to use shared storage.


    Other than that i think this setup is pretty solid.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice