Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upQubes Admin API #853
Comments
marmarek
added this to the
Release 3 milestone
Mar 8, 2015
marmarek
added
enhancement
C: core
P: major
labels
Mar 8, 2015
marmarek
modified the milestones:
Release 3.1,
Release 3.0
May 13, 2015
marmarek
modified the milestones:
Release 4.1,
Release 3.1
Feb 8, 2016
andrewdavidwong
added
the
help wanted
label
Jun 9, 2016
added a commit
that referenced
this issue
Jun 9, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
woju
Nov 18, 2016
Member
Just pushed a draft of the API, to the qubes-doc, since the table is messy and won't be readable in the issue.
https://www.qubes-os.org/doc/mgmt1/
Didn't link anywhere yet.
@andrewdavidwong could you look on the page? It breaks the layout horribly and I don't know how to make this neither pretty nor readable. I took a shortcut and embedded a <style> directly in the page, which is bad, too.
|
Just pushed a draft of the API, to the qubes-doc, since the table is messy and won't be readable in the issue. https://www.qubes-os.org/doc/mgmt1/ Didn't link anywhere yet. @andrewdavidwong could you look on the page? It breaks the layout horribly and I don't know how to make this neither pretty nor readable. I took a shortcut and embedded a |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@woju: No problem; I'll work on this soon. |
added a commit
to QubesOS/qubes-doc
that referenced
this issue
Nov 19, 2016
added a commit
to QubesOS/qubes-doc
that referenced
this issue
Nov 19, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andrewdavidwong
Nov 19, 2016
Member
@woju: How does it look now? (Note: You might need to clear your cache to get the new CSS.)
|
@woju: How does it look now? (Note: You might need to clear your cache to get the new CSS.) |
added a commit
to QubesOS/qubes-doc
that referenced
this issue
Nov 19, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
woju
Nov 19, 2016
Member
Thanks. It is prettier, though it's less readable, since it gets scrolled independent of page, and wraps the cells. I disabled it on purpose, because if there is <name> class=<class> state=<state>\n, I didn't want it to get on multiple lines.
|
Thanks. It is prettier, though it's less readable, since it gets scrolled independent of page, and wraps the cells. I disabled it on purpose, because if there is |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andrewdavidwong
Nov 19, 2016
Member
Thanks. It is prettier, though it's less readable, since it gets scrolled independent of page,
The only way to avoid that is to use a different layout for the page. It sounds like maybe you don't want it to have the doc layout with the right-hand side bar. If the table doesn't get clipped, it'll simply overlap that side bar and be even less readable.
and wraps the cells. I disabled it on purpose, because if there is class= state=\n, I didn't want it to get on multiple lines.
Ok.
The only way to avoid that is to use a different layout for the page. It sounds like maybe you don't want it to have the
Ok. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Scrolling horizontally IMO isn't a problem - vertically is. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andrewdavidwong
Nov 19, 2016
Member
If the table doesn't get clipped vertically, it'll be larger than the height of most viewports. My impression is that this is bad practice in web design, but I don't have any source to back that up.
|
If the table doesn't get clipped vertically, it'll be larger than the height of most viewports. My impression is that this is bad practice in web design, but I don't have any source to back that up. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andrewdavidwong
Nov 19, 2016
Member
What if we create a full layout version of the table that takes up an entire page and provide a link from the existing page underneath the clipped table?
Alternatively, we could convert the entire page into the full layout and lose the side bar.
|
What if we create a Alternatively, we could convert the entire page into the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
woju
Nov 19, 2016
Member
I don't mind the side bar disappearing at all. And, as Marek said, table shouldn't be vertically scrollable independent of the page, because it makes it very annoying on touchscreen.
You may be right in the sense that nowadays it is fashionable to design custom scrolling, those designers do it and people get used to that, but IMHO this is not usable.
It may be valuable to devise some CSS class for the tables in documentation, since I will have at least two more such tables, for VM "events" and "features" (new functionality in R4.0 core).
But we are getting sidetracked.
|
I don't mind the side bar disappearing at all. And, as Marek said, table shouldn't be vertically scrollable independent of the page, because it makes it very annoying on touchscreen. You may be right in the sense that nowadays it is fashionable to design custom scrolling, those designers do it and people get used to that, but IMHO this is not usable. It may be valuable to devise some CSS class for the tables in documentation, since I will have at least two more such tables, for VM "events" and "features" (new functionality in R4.0 core). But we are getting sidetracked. |
added a commit
to QubesOS/qubesos.github.io
that referenced
this issue
Nov 19, 2016
added a commit
to QubesOS/qubesos.github.io
that referenced
this issue
Nov 19, 2016
added a commit
to QubesOS/qubes-doc
that referenced
this issue
Nov 19, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Great! Thank you. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@woju What should |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
woju
Nov 23, 2016
Member
@kalkin some identifier about the volume and possibly very basic info, but I'm not sure what exactly.
The idea is that there are two set of calls, mgmt1.vm.volume.* and mgmt1.pool.volume.*, to allow for expressing the policy decisions "allow management of pool" and "allow management of storage for VM". They overlap in scope, on purpose. Currently I don't know who will use which one and in what context.
|
@kalkin some identifier about the volume and possibly very basic info, but I'm not sure what exactly. The idea is that there are two set of calls, |
added a commit
to QubesOS/qubes-doc
that referenced
this issue
Nov 24, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 13, 2017
Member
Issue(s) with current API draft:
- missing handling of global properties: I propose
mgmt.property.prefix with exactly the same set of actions as formgmt.vm.property.. Or maybemgmt.global.property.? - Very limited error reporting - for example the reason why VM startup failed (no such VM, not enough memory, missing files, etc)
mgmt.vm.property.Listandmgmt.vm.property.Helpare bound to VM instance at API level, while in practice those are bound to VM class. Generally I'm ok with that, but I face a practical issue: don't know how to properly handle docstrings for client-side wrappers. Our API havevm.property_list, so this part is not a problem (IMOdir(vm)not working is not a problem), but no idea how to handlehelp(VMClass.property). Maybe shouldn't? And handle only docstring on the object(s) returned byvm.property_list?- missing calls for cloning - either at VM level (
mgmt.vm.Clone), or individual elements (mgmt.vm.property.Clone,mgmt.vm.volume.Cloneetc). I'm in favor of the first option (full VM clone with just new name+qid).
edited by @woju: deleted checkboxes
|
Issue(s) with current API draft:
edited by @woju: deleted checkboxes |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 13, 2017
Member
And issues with current qubesd implementation:
- No way to distinguish empty return data from failed call (at local socket level). Maybe qubesd should always respond with
OK/FAILon the first line and only then with actual data - this could be translated byqubesd-queryto exit code.
edited by @woju: deleted checkboxes
|
And issues with current qubesd implementation:
edited by @woju: deleted checkboxes |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 22, 2017
Member
A way to query for vm -> label colour for GUI domain.
mgmt.vm.property.Get+label? But it will give only label name, not other properties (color, icon). Maybe we need mgmt.vm.label.*? But the target of this call can't be a label, must be some VM (probably dom0).
Also:
- A way to query state of a single VM (and maybe VM existence check at the same time). Proposal: allow calling
mgmt.vm.Listto a specific VM, not only to dom0.
edited by @woju: deleted checkboxes
Also:
edited by @woju: deleted checkboxes |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 23, 2017
Member
- Serialization of VM type (like 'netvm' property). Should it be just string? Then stubs deserializing it will have no idea it's more than string (
vm.netvm.ipwill not work). Maybe we need explicit type declaration in result of*.Getmethods - instead ofdefault=yes|no value, it would bedefault=yes|no type=... value?
Note that *.Set calls don't have this problem, because qubesd know what type should be there, and it's responsibility of appropriate handler to convert string to appropriate type. Actually it would be wrong to pass any type information here - it would make parsing of untrusted input more complex.
edited by @woju: deleted checkboxes
Note that edited by @woju: deleted checkboxes |
added a commit
to marmarek/qubes-core-admin
that referenced
this issue
Apr 7, 2017
added a commit
to marmarek/qubes-core-admin
that referenced
this issue
Apr 10, 2017
added a commit
to marmarek/qubes-core-admin
that referenced
this issue
Apr 10, 2017
added a commit
to marmarek/qubes-core-admin
that referenced
this issue
Apr 21, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Apr 25, 2017
Member
Another problems with the current API design:
- no way to create StandaloneVM out of TemplateVM (previously having separate
add_new_vmandclone_disk_fileswas used for that), mgmt.vm.Cloneoperation may be used to bypass some policy - for example user is not allowed to change netvm property of some VM (like force using some application through Tor), but can clone VM under another name and then change it.
The second one would be in fact a problem with a specific qrexec policy, but IMO an easy to make one. Using tags instead of VM names to identify sources/targets would somehow mitigate it (tags are preserved with clone/rename etc), but not all places accept tags (for example you can't use tag in target= parameter). Maybe we need to decouple clone operation to separate "create VM", "copy properties", and "copy disk files", as it was in the old API?
|
Another problems with the current API design:
The second one would be in fact a problem with a specific qrexec policy, but IMO an easy to make one. Using tags instead of VM names to identify sources/targets would somehow mitigate it (tags are preserved with clone/rename etc), but not all places accept tags (for example you can't use tag in |
added a commit
to marmarek/qubes-core-admin
that referenced
this issue
May 1, 2017
added a commit
to marmarek/qubes-core-admin
that referenced
this issue
May 1, 2017
added a commit
to marmarek/qubes-core-admin
that referenced
this issue
May 9, 2017
added a commit
to marmarek/qubes-core-admin
that referenced
this issue
May 10, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
May 11, 2017
Member
Next thing to do: rename "Mgmt API" to "Admin API", as it should be from the beginning.
|
Next thing to do: rename "Mgmt API" to "Admin API", as it should be from the beginning. |
marmarek commentedMar 8, 2015
•
edited
Edited 1 time
-
marmarek
edited Aug 8, 2017 (most recent)
Reported by joanna on 10 May 2014 12:56 UTC
https://groups.google.com/d/msg/qubes-devel/f2gDpXE3NJ8/_kH7LUrzJ80J
Migrated-From: https://wiki.qubes-os.org/ticket/853
TODO list, aggregated from commits below:
mgmt.property.prefix with exactly the same set of actions as formgmt.vm.property.. Or maybemgmt.global.property.?mgmt.vm.property.Listandmgmt.vm.property.Helpare bound to VM instance at API level, while in practice those are bound to VM class. Generally I'm ok with that, but I face a practical issue: don't know how to properly handle docstrings for client-side wrappers. Our API havevm.property_list, so this part is not a problem (IMOdir(vm)not working is not a problem), but no idea how to handlehelp(VMClass.property). Maybe shouldn't? And handle only docstring on the object(s) returned byvm.property_list?mgmt.vm.Clone), or individual elements (mgmt.vm.property.Clone,mgmt.vm.volume.Cloneetc). I'm in favor of the first option (full VM clone with just new name+qid).OK/FAILon the first line and only then with actual data - this could be translated byqubesd-queryto exit code.mgmt.vm.Listto a specific VM, not only to dom0.vm.netvm.ipwill not work). Maybe we need explicit type declaration in result of*.Getmethods - instead ofdefault=yes|no value, it would bedefault=yes|no type=... value?:- we need a better idea for passing volume identifier (pool:vidcurrently). Or allow:in qrexec.vid) may contains chars not allowed in qrexec argument - for example/; we need to encode it somehow, or think of some other way (keep only pool name in argument and movevidto data stream?)add_new_vmandclone_disk_fileswas used for that),mgmt.vm.Cloneoperation may be used to bypass some policy - for example user is not allowed to change netvm property of some VM (like force using some application through Tor), but can clone VM under another name and then change it.admin.vm.Shutdownshould shutdown netvm even if is has vms connected to itvm.kill()called from except: clause