Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. @startuml machine-controller-reconcile
  2.  
  3. start;
  4.  
  5. :Machine controller;
  6.  
  7. repeat
  8. :Reconcile;
  9.  
  10. if (Machine has a TaskRef) then (yes)
  11. if (Task exists) then (yes)
  12. if (Task is running/pending) then (yes)
  13. #LightGreen:Requeue;
  14. elseif (Task is success/failed) then (yes)
  15. #edf7de:Remove TaskRef from Machine;
  16. endif
  17. else (no)
  18. #edf7de:Remove TaskRef from Machine;
  19. #LightGreen:Requeue;
  20. endif
  21. endif
  22. if (Is requeued or in error) then (no)
  23. if (Machine has a MachineRef) then (no)
  24. if (Can find VM by InstanceUUID) then (yes)
  25. #edf7de:Assign MachineRef to Machine;
  26. endif
  27. endif
  28. if (Machine has a MachineRef) then (no)
  29. if (Can find VM by MachineRef) then (no)
  30. #edf7de:Remove MachineRef from Machine;
  31. endif
  32. endif
  33. if (Machine has DeletionTimestamp) then (yes)
  34. if (Machine has a MachineRef) then (yes)
  35. #edf7de:Delete VM;
  36. #edf7de:Assign delete TaskRef to Machine;
  37. #LightGreen:Requeue;
  38. endif
  39. else (no)
  40. if (Machine has a MachineRef) then (yes)
  41. if (VM metadata matches calculated metadata) then (no)
  42. #edf7de:Reconfigure VM with calculated metadata;
  43. #edf7de:Assign reconfigure TaskRef to Machine;
  44. #LightGreen:Requeue;
  45. else (yes)
  46. #edf7de:Update Machine status with MAC addresses from VM;
  47. if (VM powered on) then (no)
  48. #edf7de:Power on VM;
  49. #edf7de:Assign power TaskRef to Machine;
  50. #LightGreen:Requeue;
  51. else (yes)
  52. if (VM has IP addresses) then (yes)
  53. #edf7de:Update Machine status with IP addresses from VM;
  54. else (no)
  55. #LightGreen:Requeue;
  56. endif
  57. endif
  58. endif
  59. else (no)
  60. #edf7de:Clone template to create new VM;
  61. #edf7de:Assign clone TaskRef to Machine;
  62. #LightGreen:Requeue;
  63. endif
  64. endif
  65. endif
  66. #edf7de:Machine state patched back to API server;
  67. repeat while (Reconcile is requeued) is (yes)
  68. -> no;
  69. if (Error occurred) then (yes)
  70. #Pink:Reconcile failed;
  71. else (no)
  72. #LightBlue:Reconcile success;
  73. endif
  74. stop;
  75.  
  76. @enduml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement