Skip to content

Creating / deleting drivers’ home directories is not cleanly/reliably implemented #703

@ClydeByrdIII

Description

@ClydeByrdIII

I'm prefixing this by saying this is all from a perspective of linux environment with kernels 6.8 with ubuntu distro.

Based on

func checkAndRecordOverlaySupport(home, runhome string) (bool, error) {

If overlay support feature isn't already cached on the host (which will happen every boot since it caches in /run/containers/storage/overlay, backed by tmpfs)
It will try to test support, on failure it'll delete home which in default configurations would be /var/lib/containers/storage/overlay if I'm not mistaken.

But on success, it'll also attempt to delete home, before it eventually recreates it

defer func() {
// Permitted to fail, since the various subdirectories
// can be empty or not even there, and the home might
// legitimately be not empty
_ = unix.Unmount(mergedDir, unix.MNT_DETACH)
_ = os.RemoveAll(layerDir)
_ = os.Remove(home)
}()

In the XFS project quota libs section it's suggested that we can assign a project id to /var/lib/containers/storage/overlay

// xfs_quota tool can be used to assign a project id to the driver home directory, e.g.:
// echo 100000:/var/lib/containers/storage/overlay >> /etc/projects
// echo 200000:/var/lib/containers/storage/volumes >> /etc/projects
// echo storage:100000 >> /etc/projid
// echo volumes:200000 >> /etc/projid
// xfs_quota -x -c 'project -s storage volumes' /<xfs mount point>
//
// In the example above, the storage directory project id will be used as a
// "start offset" and all containers will be assigned larger project ids
// (e.g. >= 100000). Then the volumes directory project id will be used as a
// "start offset" and all volumes will be assigned larger project ids
// (e.g. >= 200000).
// This is a way to prevent xfs_quota management from conflicting with
// containers/storage.

But, if the home deletion is successful, doesn't that remove the XFS project quota ID on home if the admin set one up before running a workload?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions