Mid.CBF Pre-AA2-MVP Design

Startup Sequence

@startuml startup
!include mid-cbf-puml-definitions.txt

title MCS Startup Sequence\nAll Units have hardware\nAll FHS connected and on Network
participant "CSP_Mid.LMC" as lmc #Thistle

box "\nMCS\n"
  participant "Controller" as controller
  collections "Subarray" as subarray
  collections "VCC\nUnit" as vcc_unit
  collections "FSP\nUnit" as fsp_unit
  collections "FSP" as mcs_fsp
  participant "Network Switch\nController" as network
end box

box "\nHardware\n"
  participant "OpenStack\nIronic" as ironic #LightGreen
  collections "Network\nSwitch" as network_api #LightGreen
end box

box "\nFHS\n"
  collections "FHS\nMonitor" as fhs_ctrl
  collections "VCC\nControl" as vcc_ctrl
  collections "FSP\nControl" as fsp_ctrl
end box


rnote over controller
  AdminMode: OFFLINE
  OpState: DISABLE
  HealthState: UNKNOWN
end rnote
/ rnote over subarray
    AdminMode: OFFLINE
    OpState: DISABLE
    HealthState: UNKNOWN
  end rnote
/ rnote over vcc_unit
    AdminMode: OFFLINE
    OpState: DISABLE
    HealthState: UNKNOWN
  end rnote
/ rnote over fsp_unit
    AdminMode: OFFLINE
    OpState: DISABLE
    HealthState: UNKNOWN
  end rnote
/ rnote over mcs_fsp
    AdminMode: OFFLINE
    OpState: DISABLE
    HealthState: UNKNOWN
  end rnote
/ rnote over fhs_ctrl
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote
/ rnote over vcc_ctrl
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote
/ rnote over fsp_ctrl
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote


group #PowderBlue Initialize Controller Communications
  lmc --> controller : Subscribe to\nhealthState
  lmc <- controller  : Push healthState\n(on subscription)
  lmc -> controller  : AdminMode.ONLINE
  activate controller


  group #LightCyan Connect to VCC Units
    controller --> vcc_unit : Initialize\nDeviceProxy
    controller --> vcc_unit : Subscribe to\nhealthState
    controller <-  vcc_unit : Push healthState\n(on subscription)
    controller -> vcc_unit  : AdminMode.ONLINE
    activate vcc_unit

    group #MintCream If VCC Unit has hardware\n(FHS node UUID in properties)
      vcc_unit --> fhs_ctrl : Initialize\nDeviceProxy
      vcc_unit --> fhs_ctrl : Subscribe to\nhealthState
      vcc_unit <-  fhs_ctrl : Push healthState\n(on subscription)

      loop For all 6 FHS VCC controllers of the VCC Unit
        vcc_unit --> vcc_ctrl : Initialize\nDeviceProxy
        vcc_unit --> vcc_ctrl : Subscribe to\nhealthState
        vcc_unit <-  vcc_ctrl : Push healthState\n(on subscription)
      end

      vcc_unit --> network  : Initialize\nDeviceProxy
      vcc_unit --> network  : Subscribe to\nhealthState
      vcc_unit <-  network  : Push healthState\n(on subscription)

      group HardwareStatusClient
        vcc_unit -> ironic   : Request node status
        activate ironic
        vcc_unit <-- ironic  : Node status info
        deactivate ironic
        vcc_unit -> vcc_unit : Update healthInfo
      end

      rnote over vcc_unit
        AdminMode: ONLINE
        OpState: ON
        HealthState: OK,
        DEGRADED or FAILED
      end rnote

    else If VCC Unit has no hardware, do nothing
      rnote over vcc_unit
        AdminMode: OFFLINE
        OpState: DISABLE
        HealthState: UNKNOWN
      end rnote
    end

    controller <- vcc_unit : Push healthState\n(on change)
    deactivate vcc_unit 
  end


  lmc <- controller : Push healthState\n(on change)


  group #LightCyan Connect to FSP Units
    controller --> fsp_unit : Initialize\nDeviceProxy
    controller --> fsp_unit : Subscribe to\nhealthState
    controller <-  fsp_unit : Push healthState\n(on subscription)
    controller -> fsp_unit  : AdminMode.ONLINE
    activate fsp_unit

    group #MintCream If FSP Unit has hardware (FHS node UUIDs in properties)
      fsp_unit --> fhs_ctrl : Initialize\nDeviceProxy
      fsp_unit --> fhs_ctrl : Subscribe to\nhealthState
      fsp_unit <-  fhs_ctrl : Push healthState\n(on subscription)

      fsp_unit --> mcs_fsp  : Initialize\nDeviceProxy
      fsp_unit --> mcs_fsp  : Subscribe to\nhealthState
      fsp_unit <-  mcs_fsp  : Push healthState\n(on subscription)
      fsp_unit -> mcs_fsp   : AdminMode.ONLINE
      activate mcs_fsp

      loop For all 8 FHS FSP controllers of the FSP Unit
        mcs_fsp --> fsp_ctrl  : Initialize\nDeviceProxy
        mcs_fsp --> fsp_ctrl  : Subscribe to\nhealthState
        mcs_fsp <- fsp_ctrl   : Push healthState\n(on subscription)
        fsp_unit <- mcs_fsp   : Push healthState\n(on change)
        deactivate mcs_fsp
      end

      fsp_unit --> network  : Initialize\nDeviceProxy
      fsp_unit --> network  : Subscribe to\nhealthState
      fsp_unit <-  network  : Push healthState\n(on subscription)

      group HardwareStatusClient
        fsp_unit -> ironic   : Request node statuses
        activate ironic
        fsp_unit <-- ironic  : Node statuses info
        deactivate ironic
        fsp_unit -> fsp_unit : Update healthInfo
      end

      rnote over fsp_unit
        AdminMode: ONLINE
        OpState: ON
        HealthState: OK,
        DEGRADED or FAILED
      end rnote

    else If FSP Unit has no hardware, do nothing
      rnote over fsp_unit
        AdminMode: OFFLINE
        OpState: DISABLE
        HealthState: UNKNOWN  
      end rnote
    end

    controller <- fsp_unit  : Push healthState\n(on change)
    deactivate fsp_unit
  end

  note right of vcc_unit #White
    VCC FSP Units
    without hardware
    do not participate
    in remaining
    sequence
  end note

  group #LightCyan Connect to Subarrays
    controller --> subarray : Initialize\nDeviceProxy
    controller --> subarray : Subscribe to\nhealthState
    controller <- subarray  : Push healthState\n(on subscription)
    controller -> subarray  : AdminMode.ONLINE
    activate subarray
    subarray --> mcs_fsp    : Initialize\nDeviceProxy
    subarray --> vcc_ctrl   : Initialize\nDeviceProxy
    controller <- subarray  : Push healthState\n(on change)
    deactivate subarray

    rnote over subarray
      AdminMode: ONLINE
      OpState: ON
      HealthState: UNKNOWN
    end rnote

    note over subarray  #White
      Subarray will later monitor
      healthState/healthInfo of
      assigned resources.
    end note
  end


  lmc <- controller : Push healthState\n(on change)
  deactivate controller

  rnote over controller
    AdminMode: ONLINE
    OpState: OFF
    HealthState: OK,
    DEGRADED or FAILED
  end rnote
end group


group #PowderBlue Network Switch Startup (TBD)
  network -> network       : init_device()
  activate network 
  loop Network Switch Status Polling
    network -> network_api : Request switch status
    activate network_api
    network <- network_api : Switch status info
    deactivate network_api
  end
  vcc_unit <- network    : Push healthState\n(on change)
  fsp_unit <- network    : Push healthState\n(on change)
  deactivate network
  rnote over network
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote
end


group #PowderBlue Initialize System Parameters
  lmc -> controller      : InitSysParam(json_str)
  activate controller
  controller -> subarray : Write sysParam
  lmc <- controller      : Push ResultCode.OK
  deactivate controller
end


group #PowderBlue On Command - Provided for transition between AA1 (TDC) and AA2+ interface
  lmc -> controller        : On()
  activate controller
  controller -> controller : Set OpState to ON
  lmc <-  controller       : Push ResultCode.OK
  deactivate controller
  rnote over controller    : OpState: ON
end

@enduml

Shutdown Sequence

@startuml shutdown
!include mid-cbf-puml-definitions.txt

title Shutdown Sequence\n
participant "CSP_Mid.LMC" as lmc #Thistle

box "\nMCS\n"
  participant "Controller" as controller
  collections "Subarray" as subarray
  collections "VCC\nUnit" as vcc_unit
  collections "FSP\nUnit" as fsp_unit
  collections "FSP" as mcs_fsp
  participant "Network Switch\nController" as network
end box

box "\nHardware\n"
  participant "OpenStack\nIronic" as ironic #LightGreen
  collections "Network\nSwitch" as network_api #LightGreen
end box

box "\nFHS\n"
  collections "FHS\nMonitor" as fhs_ctrl
  collections "VCC\nControl" as vcc_ctrl
  collections "FSP\nControl" as fsp_ctrl
end box

rnote over controller
  AdminMode: ONLINE
  OpState: ON
  HealthState: OK,
  DEGRADED or FAILED
end rnote
/ rnote over subarray
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote
/ rnote over vcc_unit
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote
/ rnote over fsp_unit
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote
/ rnote over mcs_fsp
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote
/ rnote over fhs_ctrl
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote
/ rnote over vcc_ctrl
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote
/ rnote over fsp_ctrl
    AdminMode: ONLINE
    OpState: ON
    HealthState: OK,
    DEGRADED or FAILED
  end rnote


lmc -> controller : Off()
activate controller
group #PowderBlue Issue commands to set\nSubarrays to ObsState.EMPTY

  rnote over subarray     : ObsState: Any
  / rnote over mcs_fsp    : ObsState: Any

  controller -> subarray  : Abort()
  activate subarray

  subarray -> mcs_fsp     : Abort()
  activate mcs_fsp
  subarray <- mcs_fsp     : Push ResultCode.OK
  deactivate mcs_fsp
  rnote over mcs_fsp      : ObsState: ABORTED

  controller <- subarray  : Push ResultCode.OK
  deactivate subarray
  rnote over subarray     : ObsState: ABORTED

  controller -> subarray  : Restart()
  activate subarray

  subarray -> mcs_fsp     : ObsReset()
  activate mcs_fsp
  subarray <- mcs_fsp     : Push ResultCode.OK
  deactivate mcs_fsp
  rnote over mcs_fsp      : ObsState: IDLE
  subarray --x mcs_fsp    : Unsubscribe from\nhealthState

  controller <- subarray  : Push ResultCode.OK
  deactivate subarray
  rnote over subarray     : ObsState: EMPTY
end

group #PowderBlue Disconnect from Subarrays
  controller -> subarray  : AdminMode.OFFLINE
  controller --x subarray : Unsubscribe from\nhealthState
  rnote over subarray
    AdminMode: OFFLINE
    OpState: DISABLE
    HealthState: UNKNOWN
  end rnote
end

lmc <- controller : Push ResultCode.OK
deactivate controller

rnote over controller
  AdminMode: ONLINE
  OpState: OFF
  HealthState: OK,
  DEGRADED or FAILED
end rnote

lmc -> controller : AdminMode.OFFLINE
activate controller

group #PowderBlue Disconnect from VCC Units
  controller -> vcc_unit  : AdminMode.OFFLINE
  activate vcc_unit
  vcc_unit --x network    : Unsubscribe from\nhealthState
  vcc_unit --x fhs_ctrl   : Unsubscribe from\nhealthState
  vcc_unit --x vcc_ctrl   : Unsubscribe from\nhealthState
  controller --x vcc_unit : Unsubscribe from\nhealthState
  deactivate vcc_unit
  rnote over vcc_unit
    AdminMode: OFFLINE
    OpState: DISABLE
    HealthState: UNKNOWN
  end rnote
end

group #PowderBlue Disconnect from FSP Units
  controller -> fsp_unit  : AdminMode.OFFLINE
  activate fsp_unit
  fsp_unit -> mcs_fsp     : AdminMode.OFFLINE
  activate mcs_fsp
  mcs_fsp --x fsp_ctrl    : Unsubscribe from\nhealthState
  fsp_unit --x mcs_fsp    : Unsubscribe from\nhealthState
  deactivate mcs_fsp
  rnote over mcs_fsp
    AdminMode: OFFLINE
    OpState: DISABLE
    HealthState: UNKNOWN
  end rnote
  fsp_unit --x network    : Unsubscribe from\nhealthState
  fsp_unit --x fhs_ctrl   : Unsubscribe from\nhealthState
  controller --x fsp_unit : Unsubscribe from\nhealthState
  deactivate fsp_unit
  rnote over fsp_unit
    AdminMode: OFFLINE
    OpState: DISABLE
    HealthState: UNKNOWN
  end rnote
end

deactivate controller
rnote over controller
  AdminMode: OFFLINE
  OpState: DISABLE
  HealthState: UNKNOWN
end rnote

@enduml