rancher / os

Tiny Linux distro that runs the entire OS as Docker containers
https://rancher.com/docs/os/v1.x/en/
Apache License 2.0
6.44k stars 660 forks source link

Request: Add support to Proxmox/LXC #2611

Open mhermosi opened 5 years ago

mhermosi commented 5 years ago

I have been breaking my brain on how to create a Linux Container template from your sources and or your images.

It would be nice to have an official LXC template that we can upload into our Proxmox servers instead of spawning new KVM machines.

I am still trying to figure out what would be the best approach for this.

Thanks,

-Martin

kingsd041 commented 5 years ago

I don't know much about Proxmox LXC, please give me some time to investigate this feature.

kingsd041 commented 5 years ago

We may support launching ROS on Proxmox VE via docker-machine in the next release. Can this meet your needs? @mhermosi

mhermosi commented 5 years ago

I think that might help, that is based on QEMU/KVM right?, I am not sure if using Linux Containers may be an option.. I thought it could be.

kingsd041 commented 5 years ago

RancherOS does not run inside containers. But You can run that as fully virtualized VM. @mhermosi

piersdd commented 5 years ago

Automated RancherOS deployment on Proxmox would be tenable if PVE's cloud-init could be extended to provide the user-data field. One could then pass a cloud-config YAML file. This would also assist with CoreOS KVM deployments.

JensPfeifle commented 5 years ago

There's a preliminary patch available that allows one to set custom userdata and networkdata files that are used instead of the generated ones. At the moment the patch has been merged and will most likely be packaged in the next version of qemu-server. You can follow https://bugzilla.proxmox.com/show_bug.cgi?id=2064 to get notified of a release.

niusmallnan commented 5 years ago

Currently, we have supported launching RancherOS on Proxmox VE:

rancheros-proxmoxve-autoformat.iso is used for docker-machine. rancheros-proxmoxve.iso is used for booting from ISO. proxmoxve/initrd and vmlinuz are used for the netboot like iPXE.

I don't know how LXC integrates with Proxmox, but LXC is not supported by RancherOS.

rnz commented 3 years ago

Hi! For starting in lxc on proxmox, I repack https://releases.rancher.com/os/v1.5.6/proxmoxve/rootfs.tar.gz with add symlinks:

bin -> usr/bin
usr/bin/init -> ros
usr/bin/sh -> busybox

Create container:

pct create 390 /mnt/pve/share/template/cache/rancher156.tar.gz --arch amd64 --hostname n02-test-k8s --rootfs c5:16 --memory 16384 --cores 16 --ostype unmanaged --features nesting=1 --net0 name=eth0,bridge=vmbr100,ip=dhcp

And lxc-container is running, but container is stopped on boot:

# lxc-start --logfile /tmp/lxc-start-390.log -lDEBUG -f /var/lib/lxc/390/config -F -n 390
[            ] init:info: [1/23] Starting set env WITH NIL cfg
[            ] init:info: [2/23] Starting preparefs WITH NIL cfg
[            ] init:info: [3/23] Starting save init cmdline WITH NIL cfg
[            ] init:info: [4/23] Starting mount OEM
[            ] init:info: [5/23] Starting debug save cfg
[            ] init:info: [6/23] Starting load modules
[            ] init:info: [7/23] Starting recovery console
[            ] init:info: [8/23] Starting b2d env
[            ] init:info: [9/23] Starting mount STATE and bootstrap
[            ] init:info: [10/23] Starting cloud-init
[            ] init:info: ros init: No Detected Hypervisor
[            ] init:info: Configdrive was enabled but has no configdrive device or filesystem, ignore cloudinit
[            ] init:info: [11/23] Starting read cfg and log files
[            ] init:info: [12/23] Starting switchroot
[            ] init:info: [13/23] Starting mount OEM2
[            ] init:info: [14/23] Starting mount BOOT
[            ] init:info: [15/23] Starting write cfg and log files
[            ] init:info: Swizzle: Wrote file to /var/lib/rancher/conf/cloud-config.d/init.yml
[            ] init:info: Swizzle: Wrote file to /etc/resolv.conf
[            ] init:info: Swizzle: Wrote file to /var/log/system-docker.log
[            ] init:info: Swizzle: Wrote file to /var/log/boot/init.log
[            ] init:info: Swizzle: Wrote file to /var/log/boot/ros-sysinit.log
[            ] init:info: [16/23] Starting b2d Env
[            ] init:info: [17/23] Starting hypervisor tools
[            ] init:info: [18/23] Starting preparefs2
[            ] init:info: [19/23] Starting load modules2
[            ] init:info: [20/23] Starting set proxy env
[            ] init:info: [21/23] Starting init SELinux
[            ] init:info: [22/23] Starting setupSharedRoot
[            ] init:info: [23/23] Starting sysinit
[            ] init:info: Launching System Docker
[            ] ros-sysinit:info: Resolv.conf == [], <nil>
[            ] ros-sysinit:info: Exec [/usr/bin/ros-sysinit]
[            ] ros-sysinit:info: [1/4] Starting loadSystemImages
[            ] ros-sysinit:info: Skipped loading system images because /var/lib/rancher/.sysimages_%s_loaded.done exists
[            ] ros-sysinit:info: [2/4] Starting start project
[            ] ros-sysinit:error: Networking not available to load resource
[            ] ros-sysinit:info: Project [os]: Starting project 
[            ] ros-sysinit:info: Waiting for Docker at unix:///var/run/system-docker.sock
[            ] ros-sysinit:info: Waiting for Docker at unix:///var/run/system-docker.sock