Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playbook to deploy test VM #35

Open
tepene opened this issue May 4, 2024 · 10 comments
Open

Playbook to deploy test VM #35

tepene opened this issue May 4, 2024 · 10 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tepene
Copy link
Collaborator

tepene commented May 4, 2024

Describe the feature

I'd like this project to be enhanced with a playbook which will set up a test VM where the built images can be tested because that's what this project is about. On-premises Universal Blue.

It should at least support Virtual machine manger. That's what we have available in bluefin-dx. Maybe a LXC setup would be nice too or if possible in a container directly. There's Windows in Docker so why not ublue in docker?

@tepene tepene added the enhancement New feature or request label May 4, 2024
@tepene tepene self-assigned this May 4, 2024
@tepene
Copy link
Collaborator Author

tepene commented May 28, 2024

@tepene
Copy link
Collaborator Author

tepene commented May 29, 2024

we also need a kickstart file

@tepene tepene added the help wanted Extra attention is needed label May 29, 2024
@tepene
Copy link
Collaborator Author

tepene commented May 29, 2024

to create an anaconda iso which boots the kickstart file, lorax might be the thing to use

@tepene
Copy link
Collaborator Author

tepene commented May 29, 2024

we also need a kickstart file

I did a fresh bluefin install from iso image. This is what gets created

cat /root/anaconda-ks.cfg

# Generated by Anaconda 39.32.6
# Generated by pykickstart v3.48
#version=DEVEL
# Use graphical install
graphical

%pre
#!/bin/sh

set -oue pipefail

DEFAULT_URL="ghcr.io/ublue-os/silverblue-main:39"

for ARG in `cat /proc/cmdline`; do
    if [[ "${ARG}" =~ ^imageurl= ]]; then
         URL="${ARG#*=}"
    fi
done

URL=$(echo "${URL:-${DEFAULT_URL}}" | tr "[:upper:]" "[:lower:]")

RELEASE="$(sed "2q;d" "/run/install/repo/.discinfo")"
[[ "${RELEASE}" -eq "39" ]] && RELEASE="latest"
readonly RELEASE

readonly ARCH="$(sed "3q;d" "/run/install/repo/.discinfo")"

cat << EOL > /tmp/ks-urls.txt
ostreecontainer --url="${URL}" --no-signature-verification
url --url="https://download.fedoraproject.org/pub/fedora/linux/releases/${RELEASE}/Everything/${ARCH}/os/"
EOL
%end

# Keyboard layouts
keyboard --vckeymap=ch-legacy --xlayouts='ch (legacy)'
# System language
lang en_US.UTF-8

# OSTree container setup
ostreecontainer --no-signature-verification --url="ghcr.io/ublue-os/bluefin:latest"

# Generated using Blivet version 3.8.1
ignoredisk --only-use=vda
# System bootloader configuration
bootloader --append="rd.luks.options=discard" --location=mbr --boot-drive=vda
autopart
# Partition clearing information
clearpart --none --initlabel

# System timezone
timezone Europe/Zurich

#Root password
rootpw --lock
user --groups=wheel --name=bluefin --gecos="bluefin"

some modification and templating needed, but i think this might work

@tepene
Copy link
Collaborator Author

tepene commented May 31, 2024

with podman version > 5.0 its possible to build a bootable disk image. I currently can't test since my machine is still on GTS with podman 4.9. Maybe someone could give this a shot? I can't test before next week or so.

@tepene
Copy link
Collaborator Author

tepene commented Jun 3, 2024

I'm currently not able to build an image:

❯ sudo podman run \
    --rm \
    -it \
    --add-host=registry.ublue.local:192.168.100.253 \
    --privileged \
    --pull=newer \
    --security-opt label=type:unconfined_t \
    -v $(pwd)/config.json:/config.json \
    -v $(pwd)/output:/output \
    quay.io/centos-bootc/bootc-image-builder:latest \
    --tls-verify=false --type qcow2 \
    registry.ublue.local/bluefin:latest

The --add-host=registry.ublue.local:192.168.100.253 is needed since the entry in /etc/hosts points to 127.0.0.1. The IP address has to be replaced with your computers IP.
The --tls-verify=false is to disable certificate verification. If things work out as I hope i would build a custom image where the certificate for *.ublue.local would be included.

Building the image fails with:

Generating manifest manifest-qcow2.json
Error: cannot build manifest: cannot get rootfs type for container: failed to run bootc install print-configuration: exit status 1, stderr:
ERROR Loading configuration: No bootc/install config found; this operating system must define a default configuration to be installable

2024/06/03 11:05:21 error: cannot build manifest: cannot get rootfs type for container: failed to run bootc install print-configuration: exit status 1, stderr:
ERROR Loading configuration: No bootc/install config found; this operating system must define a default configuration to be installable

Maybe it's because of podman v4.9 and not 5. But I haven't found a per-requisite for this in the README.md.

I have to investigate further

@tepene
Copy link
Collaborator Author

tepene commented Jun 15, 2024

To figure out if this is a podman version issue I followed the example:

sudo podman pull quay.io/centos-bootc/centos-bootc:stream9
sudo podman run \
    --rm \
    -it \
    --privileged \
    --pull=newer \
    --security-opt label=type:unconfined_t \
    -v $(pwd)/output:/output \
    -v /var/lib/containers/storage:/var/lib/containers/storage \
    quay.io/centos-bootc/bootc-image-builder:latest \
    --type qcow2 \
    --local \
    quay.io/centos-bootc/centos-bootc:stream9

The build was successful:

⏱  Duration: 34s
manifest - finished successfully
build:    	0752f47e3c09c849c232fe0205b3cd06f1a7e32deb38d29da2e58d39ab9fe2ad
image:    	bcca9f3dae637050a91cc8e526275623b9f1cc7ad505192ac54805590f70aaa9
qcow2:    	85a8dc3f2ed40f98caa5b128f91f89da4f6c4fdc511294ce1b8210c0d45c2c0d
vmdk:     	a3529f2be1bfbeac2adc5067ae49b7a7cb78a314379f620968b36e7330f3e008
ovf:      	9dfc3bc1a8e43bf34ff307031a2aef03c9fd3b63fd18196a1b7f46f8f566fc14
archive:  	372fb0dbce6827353d6ea6df3d5b7ca67000a5473d1408974d907cc1a1762d44
Build complete!
Results saved in

Trying the same with the bluefin image results in `ERROR Loading configuration: No bootc/install config found; this operating system must define a default configuration to be installable.

@castrojo any chance we can get a bootc/install config into the main ublue-os image? I currently don't know what is needed for this.

@aussielunix
Copy link

I have a few tasks I created for testing my images locally.
These are for local libvirt/kvm and my proxmox cluster.

https://github.com/aussielunix/bootc/blob/main/justfile

@tepene
Copy link
Collaborator Author

tepene commented Sep 20, 2024

According to ublue-os/main#572 bootc is not in the image yet. I'll keep an eye on it but i think this should be the way to go for smoothe deployment in a libvirt test vm

@tepene
Copy link
Collaborator Author

tepene commented Nov 11, 2024

still not working with latest tag

sudo podman run \
    --rm \
    -it \
    --privileged \
    --pull=newer \
    --security-opt label=type:unconfined_t \
    -v $(pwd)/config.toml:/config.toml:ro \
    -v $(pwd)/output:/output \
    -v /var/lib/containers/storage:/var/lib/containers/storage \
    quay.io/centos-bootc/bootc-image-builder:latest \
    --type qcow2 \
    --rootfs btrfs \
    --local \
    ghcr.io/ublue-os/bluefin:latest
Generating manifest manifest-qcow2.json
2024/11/11 10:52:57 error: cannot build manifest: initializing dnf in 5d1c7f350fa427d1fa1a83414787176165c157ddafa30036394001e0bd4ce9cd container failed: exit status 2
output:
error: unrecognized subcommand 'check'

Usage: yum [OPTIONS] <COMMAND>

For more information, try '--help'.

there seams to be something odd happening with dnf. I have to investigate further...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants