Recent thoughts on swap via ZVOL?

Discussion in 'Proxmox VE: Installation and configuration' started by NSomers, Apr 11, 2017.

  1. NSomers

    NSomers New Member

    Joined:
    Mar 30, 2017
    Messages:
    4
    Likes Received:
    1
    Hey everyone,

    I was wondering where things stand with using swap on ZFS? I can't seem to find a good consensus on whether it is advised or not.

    I'm building a new system and couldn't for the life of me get the PVE installer to create a ZFS root and boot under UEFI. As a workaround, I used a Live CD to create a ZFS root and installed Jessie there, which I plan to install over with PVE 4.x (kind of a side note, but interested in any feedback on this). I noticed that I didn't have a swap partition after doing this (idiot) and was considering using a ZVOL for swap instead of having to re-partition the 8 disks in the pool - it was a challenge enough to get this far, ha.

    Thanks a lot!
     
  2. David Pilibosian

    David Pilibosian New Member

    Joined:
    Apr 11, 2017
    Messages:
    5
    Likes Received:
    0
    From my latest testing with Proxmox 4.4 swapping on a ZVOL will still cause crashing once memory pressure gets too high and you actually start to use the swap. My solution to this has been to install proxmox on a small mdadm fake raid and create the ZFS pools after the fact. Your solution does sound better though. I'd be interested in a brief write-up of your method if you get it to work.
     
  3. RolandK

    RolandK New Member

    Joined:
    Mar 5, 2019
    Messages:
    2
    Likes Received:
    0
    see github.com/zfsonlinux/zfs/issues/7734 for this
     
  4. wolfgang

    wolfgang Proxmox Staff Member
    Staff Member

    Joined:
    Oct 1, 2014
    Messages:
    4,763
    Likes Received:
    316
    Hi,

    the Proxmox VE install in the current version of 5.4 doesn't create any swap partition anymore if ZFS is selected.
    Generall we recommend all installation to remove the swap zvol.
    If you like to have swap an extra swap disk is required.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. saphirblanc

    saphirblanc Member
    Proxmox Subscriber

    Joined:
    Jul 4, 2017
    Messages:
    34
    Likes Received:
    0
    Hi!
    In case of upgrading a cluster from 5.2-10 to 5.4, do the upgrade disable in anyway the SWAP ? What would be the safest way to disable/remove the SWAP in an existing installation ?
    Thanks.
     
  6. wolfgang

    wolfgang Proxmox Staff Member
    Staff Member

    Joined:
    Oct 1, 2014
    Messages:
    4,763
    Likes Received:
    316
    No upgrade will ever remove your swap partition.
    As I wrote the installer will not create the swapp if zfs is selected.
    Get the swap partition
    Code:
    swapon
    
    disable swap.
    Code:
    swapoff <path to swap>
    
    remove swap entry from /etc/fstab
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. mbaldini

    mbaldini Member

    Joined:
    Nov 7, 2015
    Messages:
    169
    Likes Received:
    20
  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