OMV in a lxc container

  • Hello and sorry for the English "google translator" :)


    I wanted to know if there was a solution to make OMV compatible with a lxc container.
    Currently, the interface does not detect the ext4 partition (and disk). Even if I added another:


    Sys. fich. Type Taille Util. Dispo Uti% Monté sur
    rootfs rootfs 24G 6,8G 16G 31% /
    /dev/mapper/core--vg-root ext4 24G 6,8G 16G 31% /
    /dev/mapper/core--vg-data ext4 500G 6G 494G 3% /data


    Y t there a "manual" solution (config.xml?) To add?


    Thank you for your help, and OMV is really a fabulous tool !

    • Offizieller Beitrag

    Install Debian Wheezy 7 in the container and then install OMV. Very easy to do.


    Code
    echo "deb http://packages.openmediavault.org/public kralizec main" > /etc/apt/sources.list.d/openmediavault.list
    apt-get update
    apt-get install openmediavault-keyring postfix
    apt-get update
    apt-get install openmediavault
    omv-initsystem

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I've only spent a few hours playing with LXC and OMV... but I suspect the issue is that OMV is looking for a block device to mount, and your container doesn't have one. You need to expose your block devices to the LXC container that is running OMV. I have no idea if this is actually possible -- I ended up changing my approach before I could figure it out.

  • I have the solution that works, but I do not know if I can stay with that:


    1) In file config lxc containeur:
    # lv test, dm-2
    lxc.cgroup.devices.allow = b 252:2 rwm


    2)
    lxc-device -n openmediavault add /dev/dm-2 /dev/dm-2


    3) In containeur:
    ln -s /dev/dm-2 /dev/mapper/Data--Storage-test

    • Offizieller Beitrag

    I have an error with the last command:


    root@openmediavault:~# omv-initsystem
    run-parts: /usr/share/openmediavault/initsystem/60rootfs exited with return code 2


    To find out the problem you have to edit '/usr/share/openmediavault/initsystem/60rootfs' and add 'set -x' somewhere at the top of the file. After that execute the script and post the output.

  • thanks,


    It stops when it passes the command "udevadm":


    + OMV_FSTAB_MNTOPS_NONROTATIONAL=noatime,nodiratime,discard
    + udevadm control --reload-rules
    run-parts: /usr/share/openmediavault/initsystem/60rootfs exited with return code 2


    The command returns nothing:
    root@openmediavault:~# udevadm control --reload-rules


    But I understand that udev does not work in a container ?

    • Offizieller Beitrag

    The command returns nothing:
    root@openmediavault:~# udevadm control --reload-rules


    But I understand that udev does not work in a container ?


    Hmmm, are you sure? I do not have worked with LXC until now, but if i can use it to isolate a whole OS, how should this work. Many softwrae is using UDEV now, how do they work in such a container?


  • Hmmm, are you sure? I do not have worked with LXC until now, but if i can use it to isolate a whole OS, how should this work. Many softwrae is using UDEV now, how do they work in such a container?


    I'm not sure. I thought this type of control could work and outside of the container. The control (udevadm control --reload-rules) should return what?

  • The bigger problem with LXC is, that it is meant/designed for a SINGLE process and not for running multiple processes in one container.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Hi


    I'm also trying to run OMV in a LXC container


    I'm having the exact same issue, and I believe this is due to /etc/fstab in the container. The file contains only the following :


    Code
    # UNCONFIGURED FSTAB FOR BASE SYSTEM


    If I show the mounted filesystems (with mount) I notice the rootfs is actually mounted :


    Code
    /dev/vg0/srv-filer-01 on / type ext4 (rw,relatime,data=ordered)


    I think the issue may be solved by trying to detect if OMV is in a container before changing the rootfs mout options.


    Edit : Found this : http://stackoverflow.com/quest…ss-runs-inside-lxc-docker

    My wiki : http://howto-it.dethegeek.eu.org


    = latest setup =
    proxmox VE 6 hypervisor on a J1900 CPU + 8GB RAM
    guests : OpenWRT (VM), OMV 5 (VM), Samba 4 domain controller (LXC)
    OMV alive since 2011 I guess : never crashed, always upgraded : stronger than my hard drives.


    Searching for a P2P online storage solution : must be open source, client side encrypted, quota supprt. Tahoe LAFS is the nearest, but is lacking quota. Would be perfect to build a OMV based, anonymous online storage for backups

    Einmal editiert, zuletzt von dethegeek ()

    • Offizieller Beitrag

    I would file a feature request on bugtracker.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • @dethegeek post the output of blkid inside your container please. Also, how did you get around the resolv.conf problem? Running the container in priviliged mode?


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Hi


    If lxc support is welcome in the roadmap, yes I may create a feature request. (EDIT : #1281)


    blkid returns nothing. There is no /dev/sd* available in the container. I think it makes sense because I did not customize my container (I got everything to learn about cgroups).


    About networking :


    I created a bridge on the host to make my containers available in my LAN. the container has a static ip address, I managed to set it using /etc/network/interfaces, and left the network settings empty in lxc.container.conf. I'm not sure but it appears some indentation in /etc/ntework/interfaces is mandatory. I did not find yet any network issue.


    I think there will be some limitation with NFS, and I found the webinterface has an issue when I try to view the phisical drives.

    My wiki : http://howto-it.dethegeek.eu.org


    = latest setup =
    proxmox VE 6 hypervisor on a J1900 CPU + 8GB RAM
    guests : OpenWRT (VM), OMV 5 (VM), Samba 4 domain controller (LXC)
    OMV alive since 2011 I guess : never crashed, always upgraded : stronger than my hard drives.


    Searching for a P2P online storage solution : must be open source, client side encrypted, quota supprt. Tahoe LAFS is the nearest, but is lacking quota. Would be perfect to build a OMV based, anonymous online storage for backups

    Einmal editiert, zuletzt von dethegeek ()

  • Oh pardon, then it was df -h, please post that output.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Hi


    Here's the output


    Code
    root@srv-filer-01:~# df -h
    Sys. fich.            Taille Util. Dispo Uti% Monté sur
    rootfs                  9,8G  1,1G  8,2G  12% /
    /dev/vg0/srv-filer-01   9,8G  1,1G  8,2G  12% /
    tmpfs                   396M  108K  396M   1% /run
    tmpfs                   5,0M     0  5,0M   0% /run/lock
    tmpfs                   982M     0  982M   0% /run/shm
    tmpfs                   2,0G     0  2,0G   0% /tmp


    /dev/vg0/srv-filer-01 is the logical volume containing the root filesystem for my container.


    I notice the container does not have /dev/root, and so does my laptop running a physical Debian Jessie.


    Maybe /dev/root is not the best bet to find the root filesystem ?

    My wiki : http://howto-it.dethegeek.eu.org


    = latest setup =
    proxmox VE 6 hypervisor on a J1900 CPU + 8GB RAM
    guests : OpenWRT (VM), OMV 5 (VM), Samba 4 domain controller (LXC)
    OMV alive since 2011 I guess : never crashed, always upgraded : stronger than my hard drives.


    Searching for a P2P online storage solution : must be open source, client side encrypted, quota supprt. Tahoe LAFS is the nearest, but is lacking quota. Would be perfect to build a OMV based, anonymous online storage for backups

  • Intresting. You don't have the bind mounts for resolveconf, hosts etc. You must be running the container priviliged then.
    Is that container running wheezy or jessie?


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Hi


    Do you mean /etc/resolv.conf, /etc/hosts ?


    If so, they exist in the container. I got a complete filesystem. However, is not fully populated. One of the big difference between a physical setup and a contained setup is the content of /dev. My container does not contain any block device (/dev/sda, /dev/cdrom, ...)


    The container is running Wheezy.


    I think the issues we may encouter when runnung OMV as LXC guest are :
    - access to block devices (should be solved with some privileges in the guest's setup)
    - NFS support (NFS kernel server will not run in a guest, confirmed with a FOG server I setup a few days ago)
    - any other acess to a file in /dev OMV may try.


    I think this would be a good starting point to enumerate any /dev/* file involved in the scripts OMV uses, and try define the privileges we must give to the container.


    I'd like to emphasize my container has a dedicated logical volume :
    my host is running Ubuntu 14.04 server, with LVM for all of my volumes.


    My volume group vg0 has many unused space. I use tposiblhis space to create a LV for each container, as allowed by lxc-create . This make possible to snapshot and backup my guests without down time (I'll validate this soon because some details needs further investigation).

    My wiki : http://howto-it.dethegeek.eu.org


    = latest setup =
    proxmox VE 6 hypervisor on a J1900 CPU + 8GB RAM
    guests : OpenWRT (VM), OMV 5 (VM), Samba 4 domain controller (LXC)
    OMV alive since 2011 I guess : never crashed, always upgraded : stronger than my hard drives.


    Searching for a P2P online storage solution : must be open source, client side encrypted, quota supprt. Tahoe LAFS is the nearest, but is lacking quota. Would be perfect to build a OMV based, anonymous online storage for backups

  • Hi


    I'm searching for a way tu make OMV run.


    I'm now running on a Debian Jessie host, with a Wheezy guest.


    I found omv-initsystem runs fine after manually fixing /etc/hosts . the name of the container should resolve into 127.0.0.1. If not, hostmane -f is damn slow (probably fails), and collectd cannot start leaving the system in a not fully configured state after installinf openmediavault.


    After a fix in the file : service collectd restart; apt-get install -f; omv-initsystem


    Now, trying to access some physical block devices from the guest...


    Would be these info useful to make OMV lxc friendly ?


    EDIT : 2 block devices are available in my container now :)

    My wiki : http://howto-it.dethegeek.eu.org


    = latest setup =
    proxmox VE 6 hypervisor on a J1900 CPU + 8GB RAM
    guests : OpenWRT (VM), OMV 5 (VM), Samba 4 domain controller (LXC)
    OMV alive since 2011 I guess : never crashed, always upgraded : stronger than my hard drives.


    Searching for a P2P online storage solution : must be open source, client side encrypted, quota supprt. Tahoe LAFS is the nearest, but is lacking quota. Would be perfect to build a OMV based, anonymous online storage for backups

    Einmal editiert, zuletzt von dethegeek ()

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!