Skip to content

Instantly share code, notes, and snippets.

@balamurugana
Created November 29, 2021 04:05
Show Gist options
  • Save balamurugana/ff5e493664fbcec8183ab005e1d59d12 to your computer and use it in GitHub Desktop.
Save balamurugana/ff5e493664fbcec8183ab005e1d59d12 to your computer and use it in GitHub Desktop.
DirectCSI Drive And Volume States

Drive states

DriveStatusUnavailable

Drive CRD object is marked as Unavailable, if drive met one of the following condition at startup or added at runtime or dynamic discovery sync.

  • device size is less than 16 MiB.
  • device is in readonly state.
  • device contains partitions.
  • device is used as swap space in linux.
  • device is used in LVM, linux RAID or LUKS device.
  • device is mounted somewhere else i.e. outside of /var/lib/directcsi.

DriveStatusAvailable

Drive CRD object is marked as Available, if drive met none of the following condition at startup or added at runtime or dynamic discovery sync.

  • device size is less than 16 MiB.
  • device is in readonly state.
  • device contains partitions.
  • device is used as swap space in linux.
  • device is used in LVM, linux RAID or LUKS device.
  • device is mounted somewhere else i.e. outside of /var/lib/directcsi.

DriveStatusInUse

Drive CRD object is marked as InUse at ControllerServer.CreateVolume() i.e. when volume is created on the drive.

DriveStatusReady

Drive CRD object is marked as Ready, when

  • format is requested and it is done successfully in driveEventHandler.format().
  • all volumes in the drive are released completely in volumeEventHandler.releaseVolume().

DriveStatusTerminating

Drive CRD object is marked as Terminating, when

  • drive CRD is deleted in driveEventHandler.delete().
  • no drive on the server matches drive CRD object in ueventHandler.syncDrives().
  • the respective drive is physically removed from the server in ueventHandler.removeDrive().

DriveStatusReleased

Drive CRD object is marked as Released by kubectl direct-csi drives release command if the drive is in Ready state.

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