Hi all,
As part of our plan to support live merging of VM disk snapshots it
seems we will need a new form of asynchronous task in ovirt-engine. I
am aware of AsyncTaskManager but it seems to be limited to managing
SPM tasks. For live merge, we are going to need something called
VmTasks since the async command can be run only on the host that
currently runs the VM.
The way I see this working from an engine perspective is:
1. RemoveSnapshotCommand in bll is invoked as usual but since the VM is
found to be up, we activate an alternative live merge flow.
2. We submit a LiveMerge VDS Command for each impacted disk. This is
an asynchronous command which we need to monitor for completion.
3. A VmJob is inserted into the DB so we'll remember to handle it.
4. The VDS Broker monitors the operation via an extension to the
already collected VmStatistics data. Vdsm will report active Block
Jobs only. Once the job stops (in error or success) it will cease
to be reported by vdsm and engine will know to proceed.
5. When the job has completed, VDS Broker raises an event up to bll.
Maybe this could be done via VmJobDAO on the stored VmJob?
6. Bll receives the event and issues a series of VDS commands to
complete the operation:
a) Verify the new image chain matches our expectations (the snap is
no longer present in the chain).
b) Delete the snapshot volume
c) Remove the VmJob from the DB
Could you guys review this proposed flow for sanity? The main
conceptual gaps I am left with concern #5 and #6. What is the
appropriate way for VDSBroker to communicate with BLL? Is there an
event mechanism I can explore or should I use the database? I am
leaning toward the database because it is persistent and will ensure
#6 gets completed even if engine is restarted somewhere in the middle.
For #6, is there an existing polling / event loop in bll that I can
plug into?
Thanks in advance for taking the time to think about this flow and for
providing your insights!
--
Adam Litke