Skip to content

[Request]: Disk size is missing from resources, only cpus and memory #518

Closed as not planned

Description

@afbjorklund

Feature or enhancement request details

It seems that there is a parameter missing for storage, always 512GiB?

-c, --cpus <cpus> Number of CPUs to allocate to the container
-m, --memory <memory> Amount of memory in bytes, kilobytes (K), megabytes

    /// Resources like cpu, memory, and storage quota. 
    public struct Resources: Sendable, Codable {
        /// Number of CPU cores allocated.
        public var cpus: Int = 4
        /// Memory in bytes allocated.
        public var memoryInBytes: UInt64 = 1024.mib()
        /// Storage quota/size in bytes.
        public var storage: UInt64?
    
        public init() {}
    }
        var resource = ContainerConfiguration.Resources()
        if let cpus {
            resource.cpus = Int(cpus)
        }
        if let memory {
            resource.memoryInBytes = try Parser.memoryString(memory).mib()
        }
        return resource
    }

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. afbjorklund commented on Aug 18, 2025

    @afbjorklund
    Author

    Also it is parsed as "mib" (which is a good thing, but not as documented):

  2. jglogan commented on Aug 19, 2025

    @jglogan
    Contributor

    @afbjorklund You can have any disk size you want as long as it is 512GB (today).

    We're working on getting more storage features into the backlog, this will be one issue less to create. Thanks!

  3. added
    facet/storage
    on Aug 19, 2025
  4. afbjorklund commented on Aug 20, 2025

    @afbjorklund
    Author

    It is not a big deal ("512 GiB ought to be enough"), just noticed it was missing...

    Setting storage size is also missing from the Docker and Kata containers, though.

  5. dcantah commented on Aug 20, 2025

    @dcantah
    Contributor

    An approach we could take (that is completely feasible and I know works) for storage size is we can create a "dummy" ext4 blockdev and attach it to the vm and do an overlayfs with that dummy filesystem and the real one. The amount of space would be bound by however large the fs on the dummy block is (so you could choose much less or much more than 512GiB).

  6. afbjorklund commented on Sep 28, 2025

    @afbjorklund
    Author

    I don't think this option will be needed, we will be using Docker for the Kata Containers and it doesn't have it either...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    facet/storage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions