On 05/07/16 12:07 +0300, Shmuel Melamud wrote:
Hi!
I'm writing code for a new verb (sparsifyInplace) in VDSM and got two
different opinions about whether to use SPM or SDM for it:
1) SDM is the new correct approach, need to use it.
2) SDM is on early stage and may be changed significantly, so it is better
to use SPM as mature and reliable approach.
What's your opinion?
SDM is definitely the better way to go, if you can, since it will make
less work for you in the future and also make your verb use host
resources more efficiently.
My guess is that sparsifyInplace just needs to run a command against a
volume path that is visible to a selected vdsm host and wait for it to
complete. Do you intend for this to be run also while a VM is using
the volume?
For SDM verbs in vdsm there is a basic formula. All verbs are
asynchronous. A new public API function is created in HSM. This
function unpacks parameters and then creates and schedules a HostJob
instance. The HostJob performs any necessary locking and does the
work. It also has an interface for progress reporting and for
aborting the operation. Engine monitors HostJobs using a public vdsm
API.
While it's true that SDM is in early stages, the underlying
infrastructure that you will need has been upstream for awhile now.
I'll be happy to provide some additional details if you have further
questions.
--
Adam Litke