burmilla / os

Tiny Linux distro that runs the entire OS as Docker containers
https://burmillaos.org
Apache License 2.0
210 stars 13 forks source link

Unable to mount NFS #40

Open poxin13 opened 3 years ago

poxin13 commented 3 years ago

BurmillaOS Version: (ros os version) v1.9.0

Where are you running BurmillaOS? (docker-machine, AWS, GCE, baremetal, etc.) Proxmox KVM

Which console you use (default, ubuntu, centos, etc..) default

Do you use some service(s) which are not enabled by default? enabled qemu-guest-agent enabled volume-nfs

Please share copy of your cloud-init (remember remove all sensitive data first)

hostname: burmilla-docker
mounts:
- - 192.168.1.10:/mnt/zfs-spin-storage
  - /mnt/zfs-spin-storage
  - nfs4
  - ""
rancher:
  console: default
  environment:
    EXTRA_CMDLINE: /init
  network:
    dns:
      nameservers:
      - 192.168.1.1
    interfaces:
      eth0:
        address: 192.168.1.15/24
        dhcp: false
        gateway: 192.168.1.1
  services_include:
    qemu-guest-agent: true
    volume-nfs: true
  state:
    dev: LABEL=RANCHER_STATE
    wait: true
  upgrade:
    url: https://raw.githubusercontent.com/burmilla/releases/v1.9.x/releases.yml
$ system-docker logs console

FINISHED: /sbin/agetty --noclear tty4 linuxtime="2020-12-25T03:11:06Z" level=error msg="Networking not available to load resource"

time="2020-12-25T03:11:06Z" level=error msg="Networking not available to load resource"

mount: /mnt/zfs-spin-storage: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.

time="2020-12-25T03:11:06Z" level=error msg="Failed to mount /mnt/zfs-spin-storage: exit status 32"

[            ] respawn:info: respawn BurmillaOS
built: '2020-12-14T03:55:31Z', v1.9.0
respawn BurmillaOS

Mount has no problem on a standard ubuntu server. Haven't been able to figure this out.

Should I be able to mount this directly from console? Looks like the same error.

rancher@burmilla-docker:/mnt$ sudo mount -t nfs4 -vvvvvv 192.168.1.10:/mnt/zfs-spin-storage /mnt/zfs-spin-storage
mount: /mnt/zfs-spin-storage: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program
poxin13 commented 3 years ago

I installed nfs-common on the console and seemed to work after that. Was able to mount manually and via mounts in cloud config.

olljanat commented 3 years ago

Hmm. We should not require install to console. Will reopen and investigate this later.

olljanat commented 3 years ago

Looks that we need also update documentation. Purpose of volume-nfs service (and volume-cifs) is provide NFS/CIFS support for containers with https://github.com/ContainX/docker-volume-netshare

Mounts to console needs nfs-common / cifs-utils to be installed to console.

msn62 commented 3 years ago

Mounting a nfs volume is something a lot of users struggled with in Rancheros, including myself. Finally i found a solution that I would like to share.

WAIT until the network is up during the initiation phase.

This can be accomplished in two ways by editing the file: /var/lib/rancher/conf/cloud-config.d

rancher:

do a dummy call to a datasource to initiate the network

cloud_init: datasources:

Both options, initiating the network by a dummy call or wait until a dhcp address is assigned (dhcp_timeout: 0) worked in my case.

Hope this helps somebody. Iam quite a Linux noob btw.

olljanat commented 3 years ago

Mounting a nfs volume is something a lot of users struggled with in Rancheros, including myself. Finally i found a solution that I would like to share.

WAIT until the network is up during the initiation phase.

Thanks this was useful tip. I guess that we can include some wait network logic to volume-nfs container https://github.com/burmilla/os-services/blob/v1.9.0/images/20-volumenetshare/Dockerfile

alesnav commented 2 years ago

After upgrading from RancherOS console version to BurmillaOS console version (that was my fault when I did the upgrade...) I cannot longer use NFS mount on nodes.

I see this comment at the beggining, but I don't know how to install nfs-common package, can you explain that?

I installed nfs-common on the console and seemed to work after that. Was able to mount manually and via mounts in cloud config.

Thanks!!

EDIT: Ok, it's so simple... It's enough to perform an apt-get update && apt-get install nfs-common. Will nfs-common be included in default BurmillaOS console?

olljanat commented 2 years ago

Will nfs-common be included in default BurmillaOS console?

Good question. Based on https://packages.debian.org/buster/nfs-common it looks to be quite small and there is already couple of persons who need it so maybe it would be easiest include lt as part of next update.

alesnav commented 2 years ago

It requires some other dependencies and I saw a 26,2 MB installation space in total, so it is not as small as it looks like, but I vote for its addition anyway.

priceaj commented 1 year ago

I've just had the same issue, migrated from RancherOS yesterday (as the existing RancherOS docker version didn't support Ubuntu Jammy images as per https://docs.linuxserver.io/faq#jammy ). The upgrade was seamless btw so thanks for that!!

NFS mounts seemed to work fine until I reset the default console via

sudo ros console switch default

as per everyone else the way I had previously gotten NFS to work on RancherOS was as follows in my config:


mounts:
- - nasbox.local:/Folder
  - /NAS
  - nfs4
  - ""

services_include:
    volume-nfs: true

Worked around as above by Installing nfs-common via

EDIT: Ok, it's so simple... It's enough to perform an apt-get update && apt-get install nfs-common. Will nfs-common be included in default BurmillaOS console?

I assume that this will need to be done every-time the console is reset (i.e. every upgrade)?

olljanat commented 1 year ago

I assume that this will need to be done every-time the console is reset (i.e. every upgrade)?

Yes if you do console reset as part of upgrade. However it does not happen automatically (like discussed #150 ) so you can choose just updating packages with apt-get update+upgrade like on any Debian based distro.

Or automate that package installation https://burmillaos.org/docs/configuration/advanced/running-commands/ and use reset option.

alesnav commented 1 month ago

I've just faced the same NFS problem when trying to deploy a new environment, and I finished in this same issue to realize that I need to install nfs-common package.

@olljanat will this package finally be included in the base image?

Thanks!!

olljanat commented 1 month ago

It is a bit unclear when next version will be released but there is already some other changes waiting in v2.0.2-rc1 so if someone creates pull request about this it will more likely get included.