I am new to rancheros - and I am having trouble persisting the state when booting from ISO.
I am using a VMware infrastructure with the CD pointed to the .iso file (for v0.7.0), and I have set up an empty sda1 disk that is formatted as ext4 and labelled with RANCHER_STATE.
Any changes that I make with the .iso booted do not seem to persist, and I see no evidence in the logs or on the system that it ever mounted the persistent sda1 device.
My superficial initial look at the code that mounts the device (in init.go) - suggests that the rancher.state.dev is “”. This variable seems to be normally passed as a linux command line parameter and this is not being done for an ISO boot.
Is this something I am doing wrong, or has persistent state booted from an ISO been deprecated?
I fixed the .iso so it had the following commandline:
Nov 5 21:41:23 rancher kernel: [ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz quiet rancher.state.dev=“LABEL=RANCHER_STATE” rancher.autologin=tty1 rancher.autologin=ttyS0 initrd=/boot/initrd
and rebooted. I created a partition on sda1 with the label RANCHER_STATE, and it still does not seem to be mounted at boot time. I don’t see any kernel log messages for the mount, and I was able to mount it manually (which normally means it wasn’t already mounted)
What would be the easiest way to debug this, and do I have to set any other parameters?
Maybe I am misunderstanding how the state works in the .iso case, but I was hoping to share the .iso file across multiple VMs in my virtual machine infrastructure, and only persist the “delta”'s (as a file system like aufs would do) on the virtual disks.
I have indeed tried installing the iso’s onto disk and they work fine - except that the disks are quite large holding read-only components like the kernel, the initrd, and a large chunk of rootfs which never gets changed.
If a persistent .iso just does the equivalent of a disk install, then I will
sorry - hit send too early -
if a persistent .iso just does the equivalent of a disk install and not just store delta’s on the disk, then I will use the disk install, and not worry about this.
I’m also thinking about using the iso with persistence. Upgrading RancherOS would be as simple as switching isos, but if rancher.state.dev isn’t set by default anymore then it would be a bit more complicated. I wonder why they changed that, seems stupid. Someone also needs to update the documentation: http://docs.rancher.com/os/running-rancheros/workstation/boot-from-iso/
The only space you’d save by not doing an install is the size of the size of the kernel and initrd. In the case of RancherOS, this isn’t very much so I’d say it’s probably worth doing a proper install.
You basically mention the reason we ended up changing the default. It was previously possible to interfere with an existing installation (accidentally performing an upgrade) by booting from ISO.
You don’t have to perform an installation with a persistent ISO so it might be easier to automate. Other than that I’d recommend performing a standard installation.
There are merge file systems, or CopyOnWrite filesystems that allow you to have multiple media mounts onto the same file structure.
In this case, I was wondering if you mounted the ISO, and merged a COW sda filesystem onto the root - then any writes to the filesystem would be stored as a file on the sda. If a file wasn’t on the sda, then the filesystem would retreive the version from the ISO.
I think most users expect booting from an ISO to be stateless. rancher.state.dev can be configured via a kernel parameter so I don’t see much issue in making it opt-in.
Adding rancher.state.dev=LABEL=RANCHER_STATE to the iso kernel parameters works in RacherOS v0.7 but not in v0.7.1. How do I set the persistent state drive in v0.7.1?