LXC container creation fails - TASK ERROR: cannot open directory //rpool: No such file or directory

Discussion in 'Proxmox VE: Installation and configuration' started by Sebastiaan7676, Apr 7, 2018.

  1. Sebastiaan7676

    Sebastiaan7676 New Member

    Joined:
    Mar 19, 2018
    Messages:
    22
    Likes Received:
    0
    I've had some issues with my Proxmox 5.1-41 install.

    I had issues with ZFS where things weren't mounting, and the WebGUI wasn't working - which turned out to be a badly configured /etc/hosts file.

    Once this was fixed, things worked, however now I can't get containers working.

    during my fiddling to fix the issue, i think i must have stuffed up something with ZFS and how/where it mounts.

    Now when i try to create a new container, on the last 'confirm' screen it has the following error:

    Code:
    mounting container failed
    TASK ERROR: cannot open directory //rpool: No such file or directory
    here is the output of zfs list:
    Code:
    NAME                           USED  AVAIL  REFER  MOUNTPOINT
    rpool                         83.3G  2.66T    96K  /
    rpool/ROOT                    4.33G  2.66T    96K  /ROOT
    rpool/ROOT/pve-1              4.33G  2.66T  4.33G  /
    rpool/data                    70.5G  2.66T    96K  /data
    rpool/data/subvol-102-disk-1  1.70G  48.3G  1.70G  /data/subvol-102-disk-1
    rpool/data/vm-100-disk-1      1.14G  2.66T  1.14G  -
    rpool/data/vm-101-disk-1      2.21G  2.66T  2.21G  -
    rpool/data/vm-101-disk-2      65.4G  2.66T  65.4G  -
    rpool/swap                    8.50G  2.67T    56K  -
    pvesm status gives:
    Code:
    Name             Type     Status           Total            Used       Available        %
    local             dir     active      2857919744         4542720      2853377024    0.16%
    local-zfs     zfspool     active      2927294988        73917920      2853377068    2.53%
    if I manually edit my container /etc/pve/lxc/102.conf file and change the rootfs to match the MOUNTPOINT, it works fine - i.e.:

    /etc/pve/lxc/102.conf below now works:

    Code:
    arch: amd64
    cores: 2
    cpulimit: 2
    hostname: plex
    memory: 8192
    nameserver: 8.8.8.8 1.1.1.1
    net0: name=eth0,bridge=vmbr0,hwaddr=36:AC:BC:B6:0B:44,ip=dhcp,type=veth
    onboot: 1
    ostype: archlinux
    rootfs: /data/subvol-102-disk-1,size=50G
    searchdomain: seb
    startup: order=3
    swap: 4096
    lxc.hook.autodev: /var/lib/lxc/102/tuntap
    lxc.cgroup.devices.allow: c 10:200 rwm
    
    but prior to this issue, rootfs was listed as:
    Code:
    rootfs: local-zfs:subvol-102-disk-1,size=50G
    which was working. But now I have to enter the exact mountpoint.

    I have a feeling this issue is similar to what is outlined by Greg here: https://forum.proxmox.com/threads/cannot-restart-container.35869/

    Is there some way I can re-configure proxmox to create containers with the current mountpoints?

    Or otherwise get things back to how they should be?

    Otherwise from here I can't create new containers from the Web GUI, and would need to do so by hand and explicitly state the rootfs.

    VM's are working just fine., including the creation of new VM's. This issue is just with containers.

    Any assistance greatly appreciated.


    Seb
     
  2. Sebastiaan7676

    Sebastiaan7676 New Member

    Joined:
    Mar 19, 2018
    Messages:
    22
    Likes Received:
    0
    bump.

    Anyone have any ideas?
     
  3. dcsapak

    dcsapak Proxmox Staff Member
    Staff Member

    Joined:
    Feb 1, 2016
    Messages:
    3,515
    Likes Received:
    318
    how does your /etc/pve/storage.cfg look like?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Sebastiaan7676

    Sebastiaan7676 New Member

    Joined:
    Mar 19, 2018
    Messages:
    22
    Likes Received:
    0
    Hi dcsapak.

    /etc/pve/storage.cfg
    Code:
    dir: local
        path /var/lib/vz
        content iso,vztmpl,backup
    
    zfspool: local-zfs
        pool rpool/data
        sparse
        content images,rootdir
    
     
  5. dcsapak

    dcsapak Proxmox Staff Member
    Staff Member

    Joined:
    Feb 1, 2016
    Messages:
    3,515
    Likes Received:
    318
    what does 'pvesm path local-zfs:subvol-102-disk-1' show ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Sebastiaan7676

    Sebastiaan7676 New Member

    Joined:
    Mar 19, 2018
    Messages:
    22
    Likes Received:
    0
    That command produces:
    Code:
    /rpool/data/subvol-102-disk-1
     
  7. dcsapak

    dcsapak Proxmox Staff Member
    Staff Member

    Joined:
    Feb 1, 2016
    Messages:
    3,515
    Likes Received:
    318
    could you try to create a container from the commandline with e.g.

    pct create <ID> <Template> --rootfs local-zfs:8

    ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Sebastiaan7676

    Sebastiaan7676 New Member

    Joined:
    Mar 19, 2018
    Messages:
    22
    Likes Received:
    0
    This is what happens:

    Code:
    root@proxmox:/# pct create 105 /var/lib/vz/template/cache/archlinux-base_20170704-1_amd64.tar.gz --rootfs local-zfs:8
    mounting container failed
    cannot open directory //rpool: No such file or directory
     
  9. fabian

    fabian Proxmox Staff Member
    Staff Member

    Joined:
    Jan 7, 2016
    Messages:
    3,199
    Likes Received:
    496
    you need to set the mountpoint to the default one, e.g. for 'rpool/data' it needs to be '/rpool/data' (same for all children, but those should be inherited unless you manually messed with them)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Sebastiaan7676

    Sebastiaan7676 New Member

    Joined:
    Mar 19, 2018
    Messages:
    22
    Likes Received:
    0
    OK. I can't recall messing with storage.cfg, but will change it to /rpool/data.

    I assume a reboot would be in order?
     
  11. fabian

    fabian Proxmox Staff Member
    Staff Member

    Joined:
    Jan 7, 2016
    Messages:
    3,199
    Likes Received:
    496
    you misunderstood me - your mountpoints in ZFS are set wrong:
    Code:
    rpool/data                    70.5G  2.66T    96K  /data
    rpool/data/subvol-102-disk-1  1.70G  48.3G  1.70G  /data/subvol-102-disk-1
    
    you need to do "zfs set mountpoint=/rpool/data rpool/data"
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Sebastiaan7676

    Sebastiaan7676 New Member

    Joined:
    Mar 19, 2018
    Messages:
    22
    Likes Received:
    0
    Ahh OK, yes, that appears to have fixed the creation of new containers.

    Curiously, now reverting my 102.conf back to what it was for rootfs is not working, but I'll dig into the logs and see what is going on. Now it is failing to start. lol.

    Thanks so much for the assistance. Much appreciate the patience with a proxmox newb like me.
     
  13. hvisage

    hvisage Member

    Joined:
    May 21, 2013
    Messages:
    36
    Likes Received:
    0
    Hmm... @fabian stating that "ZFS mountpoints" are wrong, is a wrong statement.

    When you create a ZFS, the mountpoint can be "anything", and specifically here I was running in similar issue. The problem being that it's not the "expected" mountpoint, would be correct, but as rpool is the "root pool" for a ZFS on / pool, and then to have things mounted from / instead of /rpool, is the "correct" way.

    I'd rather advise ProxMox to consider using/checking/etc. (perhaps even forcing to a more "proxmox specific directory"??) the actual mountpoint, and not to ASSUME it's based on the ZFS zpool name?


    Code:
    root@hvtest:~# zfs list
    NAME                                   USED  AVAIL  REFER  MOUNTPOINT
    rpool                                 5.62G   109G    96K  /
    rpool/Containers                        96K   109G    96K  /rpool/Containers
    rpool/ROOT                            3.58G   109G    96K  none
    rpool/ROOT/debian                     3.58G   109G  3.30G  /
    rpool/home                            1.20G   109G  4.45M  /home
    rpool/home/root                        144K   109G   144K  /root
    rpool/home/vm-100-disk-0               207M   109G   159M  -
    rpool/home/vm-100-disk-1              46.3M   109G  26.0M  -
    rpool/home/vm-100-state-afterRestore   394M   109G   394M  -
    rpool/home/vm-100-state-niceSetup      514M   109G   514M  -
    rpool/home/vm-101-disk-0              61.3M   109G  61.3M  -
    rpool/var                              858M   109G    96K  /var
    rpool/var/cache                        847M   109G   847M  /var/cache
    rpool/var/log                         9.66M   109G  9.66M  /var/log
    rpool/var/spool                        676K   109G   676K  /var/spool
    rpool/var/tmp                          168K   109G   168K  /var/tmp
    root@hvtest:~#
    Code:
    root@hvtest:~# zfs get -H -o value mountpoint rpool/home
    /home
    
     
  14. fabian

    fabian Proxmox Staff Member
    Staff Member

    Joined:
    Jan 7, 2016
    Messages:
    3,199
    Likes Received:
    496
    I never said that you cannot set the mountpoint to other values - but PVE only supports the default one (which allows us to statically determine the mount path instead of having to ask ZFS for each volume, which is a nice performance short cut).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. hvisage

    hvisage Member

    Joined:
    May 21, 2013
    Messages:
    36
    Likes Received:
    0
    yeah, nice "performance short cut", but you then need to consider the root ZFS installations and document that perhaps somewhere??
     
  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