How does curtin, cloud-init and the ephemeral image work?

  1. The user triggers MaaS to deploy by telling MaaS a) which bare metal to use, a.k.a. the target bare metal b) which image and kernel you want to deploy to.
  2. MaaS controls the target bare metal (usually via BMC) to power reset
  3. The target bare metal netboots via PXE service provided by MaaS
  4. The target bare metal boots into the ephemeral image provide by MaaS (via the previous PXE service)
  5. cloud-init in the system (booted by the ephemeral image on the target bare metal) is triggered to talk to MaaS when the previous boot process completes.
  6. MaaS offers the target bare metal more information and data because of the inquiry triggered by cloud-init previously.
  7. cloud-init triggers curtin to write data according to the information provided in the previous step. For example, curtin knows which disk of the target bare metal should be written with the target image.
  8. curtin completes to write the target image to the target disk of the target bare metal.
  9. cloud-init gets the return status of curtin's writing mission, and reports the execution status and log to MaaS.
  10. MaaS confirmed what cloud-init reported. If everything is ok, the target bare metal is rebooted by cloud-init, and MaaS chages the status of the target bare metal (the node) from "Deploying" to "Deployed" so MaaS will disable its PXE service for this deployed node.