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

tools: add qm-storage-settings #421

Merged
merged 1 commit into from
May 4, 2024

Conversation

dougsland
Copy link
Collaborator

setup calls storage() function to execute the initial storage configuration but it's not called during the ostree deploy as it's required to call /usr/share/qm/setup. This patch extract the logic from setup with few improvements and now can be called externally via ostree / osbuild / osbuild-auto.

@dougsland
Copy link
Collaborator Author

CI/CD failing with the agent-flood test which is related to #416

@dougsland
Copy link
Collaborator Author

/hold still executing a bunch of tests.

setup calls storage() function to execute the initial storage
configuration but it's not called during the ostree deploy as
it's required to call /usr/share/qm/setup. This patch extract
the logic from setup with few improvements and now can be
called externally via ostree / osbuild / osbuild-auto.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
@dougsland dougsland force-pushed the storage-ostree-and-regular branch from 83bb716 to 18ccd0b Compare May 3, 2024 21:18
@dougsland
Copy link
Collaborator Author

Okay, the patch works in ostree and also regular images:

ostree

# ./runvm --nographics ./cs9-qemu-qmcontainer-ostree.x86_64.qcow2
BdsDxe: loading Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x3,0x0)
BdsDxe: starting Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x3,0x0)
System BootOrder not found.  Initializing defaults.
Creating boot entry "Boot0007" with label "CentOS Linux" for file "\EFI\centos\shimx64.efi"

  Booting `Automotive Stream Distribution 9 (ostree:0)'

Automotive Stream Distribution 9
Kernel 5.14.0-438.391.el9iv.x86_64 on an x86_64

localhost login: 
root
Password:

[root@localhost ~]# ls /ostree/.    # just proving it's ostree distro version
boot.1	boot.1.1  deploy  repo

[root@localhost ~]# cat /usr/lib/qm/rootfs/etc/containers/storage.conf
[storage]
driver = "overlay"
runroot = "/run/containers/storage"
graphroot = "/var/lib/containers/storage"
transient_store = true

[storage.options]
additionalimagestores = [
   "/usr/share/containers/storage",
   "/var/lib/shared"                                   <----------- Patch worked, the prove.
]

[storage.options.overlay]
mountopt = "nodev,metacopy=on"
[root@localhost ~]# cat /usr/lib/qm/rootfs/etc/containers/containers.conf
[containers]
default_sysctls = []

cgroup_conf=[
	"memory.oom.group=1",
]

oom_score_adj = 750

[engine]
env = ["TMPDIR=/var/tmp.images"]                    <----------- Patch worked, the prove.

[root@localhost ~]# podman ps
CONTAINER ID  IMAGE       COMMAND     CREATED        STATUS        PORTS       NAMES
e3181567cf0e              /sbin/init  3 minutes ago  Up 3 minutes              qm

root@localhost ~]# podman exec -it qm bash
bash-5.1# podman ps
CONTAINER ID  IMAGE                       COMMAND               CREATED        STATUS        PORTS       NAMES
e1afd146a8b9  localhost/auto-apps:latest  /usr/bin/radio-se...  3 minutes ago  Up 3 minutes              systemd-radio
4f3e00348899  localhost/auto-apps:latest  /usr/bin/engine-s...  3 minutes ago  Up 3 minutes              systemd-engine

regular

# ./runvm --nographics ./cs9-qemu-qmcontainer-regular.x86_64.qcow2
BdsDxe: loading Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x3,0x0)
BdsDxe: starting Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x3,0x0)
System BootOrder not found.  Initializing defaults.
Creating boot entry "Boot0007" with label "CentOS Linux" for file "\EFI\centos\shimx64.efi"

  Booting `Automotive Stream Distribution (5.14.0-438.391.el9iv.x86_64) 9'

[    1.657006] Error: Driver 'pcspkr' is already registered, aborting...
[    3.032014] overlayfs: idmapped layers are currently not supported
[    3.247801] Warning: Unmaintained driver is detected: nft_compat
[    4.447878] overlayfs: idmapped layers are currently not supported

Automotive Stream Distribution 9
Kernel 5.14.0-438.391.el9iv.x86_64 on an x86_64

localhost login: root
Password:

[root@localhost ~]# cat /etc/os-release
NAME="Automotive Stream Distribution"
VERSION="9"
ID="autosd"
ID_LIKE="rhel fedora centos"
VERSION_ID="9"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Automotive Stream Distribution 9"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:centos:autosd:9"
HOME_URL="https://sig.centos.org/automotive/"
REDHAT_SUPPORT_PRODUCT="Automotive Stream Distribution"
REDHAT_SUPPORT_PRODUCT_VERSION="Automotive Stream Distribution 9"

[root@localhost ~]# cat /usr/lib/qm/rootfs/etc/containers/storage.conf
[storage]
driver = "overlay"
runroot = "/run/containers/storage"
graphroot = "/var/lib/containers/storage"
transient_store = true

[storage.options]
additionalimagestores = [
   "/usr/share/containers/storage",
   "/var/lib/shared"                                            <----------- Patch worked, the prove.
]

[storage.options.overlay]
mountopt = "nodev,metacopy=on"
[root@localhost ~]# cat /usr/lib/qm/rootfs/etc/containers/containers.conf
[containers]
default_sysctls = []

cgroup_conf=[
	"memory.oom.group=1",
]

oom_score_adj = 750

[engine]
env = ["TMPDIR=/var/tmp.images"]           <----------- Patch worked, the prove.
[root@localhost ~]#

[root@localhost ~]# podman ps
CONTAINER ID  IMAGE       COMMAND     CREATED        STATUS        PORTS       NAMES
d164f464bb10              /sbin/init  3 minutes ago  Up 3 minutes              qm

[root@localhost ~]# podman exec -it qm bash
bash-5.1# podman ps
CONTAINER ID  IMAGE                       COMMAND               CREATED        STATUS        PORTS       NAMES
96121288b5b5  localhost/auto-apps:latest  /usr/bin/engine-s...  3 minutes ago  Up 3 minutes              systemd-engine
87e9a01af3d6  localhost/auto-apps:latest  /usr/bin/radio-se...  3 minutes ago  Up 3 minutes              systemd-radio
bash-5.1#

@dougsland
Copy link
Collaborator Author

The full solution requires 3 patches:

containers/qm: tools: add qm-storage-settings.
URL: #421

automotive/sample-images: qm: add org.osbuild-auto.qm.storage.settings.
URL: https://gitlab.com/CentOS/automotive/sample-images/-/merge_requests/510

qm: add qm-storage-settings.
URL: https://gitlab.com/CentOS/automotive/rpms/osbuild-auto/-/merge_requests/12

@dougsland
Copy link
Collaborator Author

Fixes: #422

@dougsland dougsland merged commit 78b899d into containers:main May 4, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant