Skip to content

multiple devices for blkio cgroup resource not working #274

@runcom

Description

@runcom

By declaring in runtime.json a linux.resources like the following:

"resources": {
    [omitted]
    "blockIO": {
        "blkioWeight": 0,
        "blkioWeightDevice": "8:0 500\n8:16 500",
        "blkioThrottleReadBpsDevice": "",
        "blkioThrottleWriteBpsDevice": "",
        "blkioThrottleReadIopsDevice": "",
        "blkioThrottleWriteIopsDevice": ""
    },
    [omitted]
},

blkio.weight_device (and blkioThrottle*) isn't populated with both the devices but only the first one is correctly added.
Current code is directly writing 8:0 500\n8:16 500 to the cgroup file which isn't clearly working. To fix this, multiple ioutil.WriteFile() should be done for each device declared.
The same applies to the others fields defined above as a string.

proposed spec changes opencontainers/runtime-spec#193
this PR moby/moby#13959 and two other are wrongly assuming the above format will work

Once/If the proposed changes to the spec lands I'll gladly take care of this here if it's ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions