Skip to content

Conversation

psafont
Copy link
Member

@psafont psafont commented Apr 3, 2024

This allows orchestrators to copy devices like VBDs from the VM, export the
metadata without the disk, import the VM to any pool, and finally add the
saved VBDs to the new VM before booting it.

Also include cleanups in the cli server, it's full of ad-hoc methods.

This has passed manual testing, the corresponding FQP test by QA, and tested by CVAD people as well

@psafont psafont force-pushed the private/paus/chelydra branch from 2228822 to 3ce7acd Compare April 3, 2024 15:46
)
vmrefs ;
(* We only keep VMs which are not snapshot *)
(* When only snapshots have been imported, return all of them.
Copy link
Contributor

@lindig lindig Apr 4, 2024

Choose a reason for hiding this comment

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

I don't have the context of this - but is this a behavior that customers expect?

Copy link
Member Author

Choose a reason for hiding this comment

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

Customers can export snapshots from a pool, without this change when importing this back in, their uuid/ reference can't be known for sure. This leads to uncomfortable ergonomics.

I think returning the references of snapshots just created back to the user is something they expect.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was more confused by the difference between when only snapshots are imported and the case were a mix of snapshots and VMs are imported - as I read the comment, the behaviour is different.

Copy link
Member Author

Choose a reason for hiding this comment

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

Before this PR the export of metadata-only was blocked, so I don't think this change of behaviour affects any users :)

robhoes and others added 10 commits April 8, 2024 15:36
I am not sure where this restriction came from. It was introduced in the
same commit that introduced the metadata-export feature itself, without
explanation. Full exports of snapshots are already allowed.

Signed-off-by: Rob Hoes <[email protected]>
This allows clients to know which snapshots they knowingly just created and act
on them instead of looking again into the db and try to divine which snapshots
the call created.

Signed-off-by: Pau Ruiz Safont <[email protected]>
This allows clients to detect that the newer device type exclusions for export
are available.

Signed-off-by: Rob Hoes <[email protected]>
This allows to orchestrators to copy devices like VBDs from the VM, export the
metadata without the disk, import the VM to any pool, and finally add the
saved VBDs to the new VM before booting it.

Signed-off-by: Pau Ruiz Safont <[email protected]>
This allows to easily test the http endpoint. Also advertises the metadata
parameter on these calls

Signed-off-by: Pau Ruiz Safont <[email protected]>
Use the helper functions to process parameters, use atomics instead of ad-hoc
references for counting in possibly-parallel case

Signed-off-by: Pau Ruiz Safont <[email protected]>
Signed-off-by: Pau Ruiz Safont <[email protected]>
Tooling complains about using 1970 as the date otherwise

Signed-off-by: Pau Ruiz Safont <[email protected]>
@psafont psafont force-pushed the private/paus/chelydra branch from 3ce7acd to 0c6805f Compare April 8, 2024 14:43
@psafont psafont requested review from gangj and minglumlu April 9, 2024 10:19
[op (List.hd srs)]
| [sr] ->
[op sr]
| _ ->
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use when here to make this more pattern matchy? like

| [sr] -> [op sr]
| srs -> when multiple && get_bool_param params ...

Copy link
Member Author

Choose a reason for hiding this comment

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

This file is in need of a lot of care to use sensible coding standards. I think removing the use of List.hd is enough for now. Maybe as an OIL task...

(* add VTPMs that belong to this VM *)
vm.API.vM_VTPMs
|> List.iter (fun ref -> if Db.is_valid_ref __context ref then add ref) ;
if not (List.mem Devicetype.VTPM excluded_devices) then
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we allow users to exclude vtpms as well (and then add them back later on)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this code is doing the exclusion. For adding it back to the VM, I don't think there's an easy way to export the TPM contents separately

@psafont psafont merged commit 6dea56a into xapi-project:master Apr 9, 2024
@psafont psafont deleted the private/paus/chelydra branch April 9, 2024 13:41

This comment was marked as off-topic.

@psafont psafont changed the title CP-46851: add parameter to skip device types on get_export_metadata CP-48463: add parameter to skip device types on get_export_metadata Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants