Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions ocaml/xapi/dbsync_master.ml
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,20 @@ let release_locks ~__context =
Xapi_vm_lifecycle.force_state_reset ~__context ~self ~value:`Halted
)
vms ;
(* All VMs should have their scheduled_to_be_resident_on field cleared *)
List.iter
(fun self ->
Db.VM.set_scheduled_to_be_resident_on ~__context ~self ~value:Ref.null
)
(Db.VM.get_all ~__context)
(* Clear all assignments that are only scheduled *)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand these scheduled_* fields are used only by the coordinator to remember something within XAPI calls. So it will be safe to clean all of these fields when the xapi on coordinator is in starting up, as at the moment no any xapi calls are in progress.

let value = Ref.null in
Db.VM.get_all ~__context
|> List.iter (fun self ->
Db.VM.set_scheduled_to_be_resident_on ~__context ~self ~value
) ;
Db.PCI.get_all ~__context
|> List.iter (fun self ->
Db.PCI.set_scheduled_to_be_attached_to ~__context ~self ~value
) ;
Db.VGPU.get_all ~__context
|> List.iter (fun self ->
Db.VGPU.set_scheduled_to_be_resident_on ~__context ~self ~value
)

let create_tools_sr __context name_label name_description sr_introduce
maybe_create_pbd =
Expand Down