runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Add support for passing block devices.

Open amshinde opened this issue 7 years ago • 1 comments

Block devices can be passed to the container in the following ways:

  1. docker run --device=/dev/sda:/dev/vda
  2. docker run --mount type=bind,source=/dev/sda,target=/dev/xyz
  3. docker run -v /dev/sda:/dev/sdc …

In the first case, the device is passed to the runtime in the config.json under the "devices" object under "linux" as documented here https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md#configLinuxDevices.

We need to add support to pass block devices to the Clear Container VM and mount them at the correct location. We can start off by using virtio-block for passing devices, followed by support for other drivers.

In case 2 and 3, the volume is passed as a bind mount and appears under the "mounts" section in config.json. Our current implementation ignores anything under /dev, while handling volumes under other non-system locations passing them as 9pfs mounts. The volumes under the system locations need to be handled as well. We can start with passing such volumes with 9pfs.

amshinde avatar Oct 13 '17 18:10 amshinde

PR https://github.com/containers/virtcontainers/pull/422 opened to address this issue.

amshinde avatar Oct 13 '17 19:10 amshinde