Uploaded image for project: 'MicroShift'
  1. MicroShift
  2. USHIFT-5860

Device Plugin Allows Duplicate Assignment of Exclusive Devices to Multiple Pods

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • 2
    • Moderate
    • None
    • uShift Sprint 274
    • None
    • None
    • None

      Description of problem:

      When the same device path is set to multiple devices, i see that pod using multiple devices with same device path comes up fine.
      

      Version-Release number of selected component (if applicable):

      MicroShift Version: 4.20.0_0.nightly_2025_06_02_175911_20250612111214_71d4f99d2
      Base OCP Version: 4.20.0-0.nightly-2025-06-02-175911
      
      

      How reproducible:

      Always
      

      Steps to Reproduce:

      1. create a device called /dev/testdevice using the command sudo mknod /dev/testdevice c 123 0
      2. Add below gdp config into /etc/microshift/config.yaml
      genericDevicePlugin:
          status: Enabled
          domain: device.microshift.io
          devices:
            - name: devicea
              groups:
                - paths:
                    - path: /dev/testdevice
                      mountPath: /dev/mounta
             - name: deviceb
               groups:
                 - paths:
                     - path: /dev/testdevice
                       mountPath: /dev/mountb
      2. Now schedule two pods with devices device.microshift.io/devicea and device.microshift.io/deviceb.
      3. Use the pod specs below to configure the pods.
      apiVersion: v1
      kind: Pod
      metadata:
        name: podb
      spec:
        containers:
        - name: serial-app-container
          image: registry.access.redhat.com/ubi8/ubi
          command: ["sleep", "3600"] # Keep the container running for an hour
          resources:
            limits:
              device.microshift.io/deviceb: "1" # Request 1 serial device
        restartPolicy: Never 
      
      apiVersion: v1
      kind: Pod
      metadata:
        name: poda
      spec:
        containers:
        - name: serial-app-container
          image: registry.access.redhat.com/ubi8/ubi
          command: ["sleep", "3600"] # Keep the container running for an hour
          resources:
            limits:
              device.microshift.io/devicea: "1" # Request 1 serial device
        restartPolicy: Never 
      

      Actual results:

      I see both the pods getting scheduled and comes to running state.
      

      Expected results:

      I expect first pod to be running and second pod to be pending state because a pod is already consuming the device which is at that path.
      

      Additional info:

      Discussion related to this here: https://redhat-internal.slack.com/archives/C03CJTNLKAT/p1750153046434939
      

              pmatusza@redhat.com Patryk Matuszak
              knarra@redhat.com Rama Kasturi Narra
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: