-
Notifications
You must be signed in to change notification settings - Fork 292
RFC: update better VM revert proposal #6696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
d15451a
to
753944c
Compare
- in: `sr_uuid`: the UUID of the SR containing both the VDI and the snapshot | ||
- in: `vdi_uuid`: the UUID of the snapshot whose contents should be duplicated | ||
- in: `target_uuid`: the UUID of the target whose contents should be replaced | ||
- in: `vdi_uuid`: the UUID of the snapshot whose contents must be duplicated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe worth calling this snapshot_uuid
? otherwise v1 and v3 arguments are not consistent (vdi/snapshot, target/vdi)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see if I can change it, it might be a bit inflexible, and not up to me whether it can be changed or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this piece of code is common for all the calls to sm, so it ends up with these names, even if the function in sm.ml has reasonable arguments:
let vdi_revert ~dbg dconf driver sr vdi snapshot =
debug "vdi_revert" driver
(sprintf "sr=%s vdi=%s snapshot=%s" (Ref.string_of sr) (Ref.string_of vdi)
(Ref.string_of snapshot)
) ;
(* NB the SM backends treat the snapshot as the 'target', hence first argument
*)
let call =
Sm_exec.make_call ~sr_ref:sr ~vdi_ref:snapshot dconf "vdi_revert"
[Ref.string_of vdi]
in
Sm_exec.parse_unit (Sm_exec.exec_xmlrpc ~dbg (driver_filename driver) call)
- defining a new storage operation `VDI.revert` in storage_interface and | ||
calling this from `VM.revert` | ||
- proxying the storage operation to SMAPIv3 and SMAPv1 backends accordingly | ||
- changing the Xapi implementation of `VM.revert` to first try the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be exposed as a feature that the SM layer can expose when supported and then there is no need to try with failback.
f028d09
to
753944c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typos as Mark mentioned but otherwise approved.
Can we het the DCO problems fixed, @psafont? |
Signed-off-by: Pau Ruiz Safont <[email protected]>
This proposal is 11 years old and the architecture of xapi ahs changed enough that the proposal needs changing. In particular, SMAPIv3 has been introduced which means that there's an xapi storage interface shared between the two SMAPI backend, and that the fallback the logic that was done at SMAPI level now must be done at the level of xapi. I've also elected to further restrict the fallback behaviour to VM reverts, VDI revert will require backend support: it reduces the chances of failures during revert resulting in wrong fields in the database. Signed-off-by: Pau Ruiz Safont <[email protected]>
a80e9e0
to
aa04042
Compare
With the PoC, I'm not seeing any issues regarding the design, although all the ad-hoc code in VM.revert is making implementing this more complex than I would like |
This proposal is 11 years old and the architecture of xapi has changed
enough that the proposal needs changing.
In particular, SMAPIv3 has been introduced which means that there's an
xapi storage interface shared between the two SMAPI backend, and that
the fallback the logic that was done at SMAPI level now must be done at the
level of xapi.
I've also elected to further restrict the fallback behaviour to VM
reverts, VDI revert will require backend support: it reduces the chances of
failures during revert resulting in wrong fields in the database.
I'm still unsure about exposing VDI.revert, I would avoid it if at all possible, maybe as an internal or hidden API? It might be useful to exposed to use it in quicktests, like it was done in the initial prototype.