lima icon indicating copy to clipboard operation
lima copied to clipboard

Add support for SUSE's MicroOS

Open e-minguez opened this issue 2 years ago • 7 comments

Description

https://en.opensuse.org/Portal:MicroOS

e-minguez avatar Apr 04 '23 10:04 e-minguez

I'm currently trying to make it work but unfortunately it seems the /mnt mountpoint is read only so the mkdir -p -m 700 "${LIMA_CIDATA_MNT}" command here https://github.com/lima-vm/lima/blob/master/pkg/cidata/cidata.TEMPLATE.d/user-data#L35 fails.

However I'm able to ssh into the VM properly. It seems the LIMA_CIDATA_MNT variable is hardcoded https://github.com/lima-vm/lima/blob/master/docs/internal.md#environment-variables-1 I guess it would be nice to make it configurable (?)

The configuration file I've used is this one:

# This example requires Lima v0.7.0 or later
images:
# Hint: run `limactl prune` to invalidate the "Current" cache
- location: https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-OpenStack-Cloud.qcow2
  arch: "x86_64"
- location: https://download.opensuse.org/ports/aarch64/tumbleweed/appliances/openSUSE-MicroOS.aarch64-OpenStack-Cloud.qcow2
  arch: "aarch64"
mounts:
- location: "~"
- location: "/tmp/lima"
  writable: true

I think this is related to #1372 as well.

e-minguez avatar Apr 04 '23 10:04 e-minguez

I think on CoreOS /mnt is a symlink to /var/mnt, but in general I think Lima needs some modifications in order to support read-only systems... Currently there is alpine-lima, which uses a read-write but temporary filesystem (a.k.a. "LiveCD")

Even if it is able to find the scripts, I think that they will still fail when they try for instance to install packages (due to the filesystem being read-only). To actually support them (CoreOS/MicroOS), it needs to install on passive partition and reboot.


Where does OpenSUSE expect to find the configdrive ?

At least the label seems to be the same, always something.

The filesystem volume label must be cidata.

https://en.opensuse.org/Portal:MicroOS/cloud-init

EDIT: Just a temporary location, enough to get user-data.

subp.py[DEBUG]: Running command ['mount', '-o', 'ro', '-t', 'auto', '/dev/sr0', '/run/cloud-init/tmp/tmppztoyvpn'] with allowed return codes [0] (shell=False, capture=True)

afbjorklund avatar Apr 04 '23 10:04 afbjorklund

I've tried a quick & dirty workaround which is ssh into the VM, edit the 00-lima.boot.sh to use /tmp instead and then run the script... and it seems to work until some point.. the package installation fails of course.

e-minguez avatar Apr 04 '23 10:04 e-minguez

Ultimately it might need lima-flatcar and lima-microos images, with all the required configuration and packages already done. But they are still annoying to use, with random reboots and "everything" being read-only...

afbjorklund avatar Apr 04 '23 10:04 afbjorklund

Made some ignition hacks in PR #1653 for Fedora, not sure if they would also work on openSUSE ?

The package installation is skipped altogether, and (some of) the boot scripts were "ported" to yaml

afbjorklund avatar Jul 03 '23 18:07 afbjorklund

Haven't heard anything, so I don't think there is much interest in running immutable OS in Lima

afbjorklund avatar Jan 02 '24 06:01 afbjorklund

It claims to have cloud-init support now, https://en.opensuse.org/Portal:MicroOS#Cloud-Init_Based_Configuration

Haven't tried if the other changes (done for Fedora and Container Linux) was enough, to also work with MicroOS? But otherwise the reasons for not including MicroOS (with ignition and systemd) are the same as in https://github.com/lima-vm/lima/issues/1372#issuecomment-1891390458

The /mnt and /run locations are still hardcoded in Lima, when it comes to the healthchecks (for ssh and boot)

  • /bin/cp /mnt/lima-cidata/meta-data /run/lima-ssh-ready
  • /bin/cp /mnt/lima-cidata/meta-data /run/lima-boot-done

afbjorklund avatar Jan 15 '24 07:01 afbjorklund