Adam Litke has uploaded a new change for review.
Change subject: rest-api: Model VMs ......................................................................
rest-api: Model VMs
API Implemented: ---------------- /api/vms : Virtual machines * Manipulate virtual machines * Manipulate VM sub-collections: disks, cdroms, nics Actions: /api/vms/create - Create a new VM and launch it /api/vms/<id>/destroy - Stop a running VM /api/vms/<id>/pause - Pause a running VM /api/vms/<id>/cont - Continue a paused VM /api/vms/<id>/ticket - Assign a connection password for the VM's display
* Not fully implemented. Due to vdsm API limitations this part of the API is not yet fully-functional. Consider a RESTful VM creation sequence: POST /api/vms/define - Define a new VM in the system POST /api/vms/<id>/disks/add - Add a new disk to the VM POST /api/vms/<id>/cdroms/add - Add a cdrom POST /api/vms/<id>/nics/add - Add a NIC PUT /api/vms/<id> - Change boot sequence POST /api/vms/<id>/start - Boot the VM
Unfortunately this is not possible today with vdsm because a VM must be fully-specified at the time of creation and it will be started immediately. There are two ways forward:
1.) Deviate from a REST model and require a VM resource definition to include all sub-collections inline. -- or -- 2.) Support storage of vm definitions so that powered off VMs can be manipulated by the API.
My preference would be #2 because: it makes the API more closely follow RESTful principles, it maintains parity with the cluster-level VM manipulation API, and it makes the API easier to use in standalone mode.
Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Signed-off-by: Adam Litke agl@us.ibm.com --- M vdsm/rest/Controller.py M vdsm/rest/templates/Makefile.am M vdsm/rest/templates/api.xsd M vdsm/rest/templates/root.json.x M vdsm/rest/templates/root.xml.x M vdsm/rest/templates/rsdl.xml A vdsm/rest/templates/vm.json.x A vdsm/rest/templates/vm.xml.x A vdsm/rest/templates/vmcdrom.json.x A vdsm/rest/templates/vmcdrom.xml.x A vdsm/rest/templates/vmcdroms.json.x A vdsm/rest/templates/vmcdroms.xml.x A vdsm/rest/templates/vmdisk.json.x A vdsm/rest/templates/vmdisk.xml.x A vdsm/rest/templates/vmdisks.json.x A vdsm/rest/templates/vmdisks.xml.x A vdsm/rest/templates/vmnic.json.x A vdsm/rest/templates/vmnic.xml.x A vdsm/rest/templates/vmnics.json.x A vdsm/rest/templates/vmnics.xml.x A vdsm/rest/templates/vms.json.x A vdsm/rest/templates/vms.xml.x 22 files changed, 990 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/3756/1 -- To view, visit http://gerrit.ovirt.org/3756 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com
Gal Hammer has posted comments on this change.
Change subject: rest-api: Model VMs ......................................................................
Patch Set 6: I would prefer that you didn't submit this
(4 inline comments)
I didn't look at the code yet as I think that the REST api (as explained in the commit message) should be defined first.
.................................................... Commit Message Line 16: - Create a new VM and launch it It should be:
POST /api/vms
<data needed to create a vm>
Line 24: - Assign a connection password for the VM's display I would add a "action" (or something) to all the these paths:
/api/vms/<id>/action/ticket
Line 32: POST /api/vms/<id>/nics/add - Add a NIC POST /api/vms/<id>/disks
POST /api/vms/<id>/cdroms
POST /api/vms/<id>/nics
Line 41: all sub-collections inline. I don't think this is a deviation from the REST model. Since a creation of a VM requires all its hardware, you can't create a new VM resource unless you provide all the information.
After the VM was created and started, one can use the VM's URL and modify or query its hardware profile.
-- To view, visit http://gerrit.ovirt.org/3756 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com
Adam Litke has posted comments on this change.
Change subject: rest-api: Model VMs ......................................................................
Patch Set 6:
Gal, would you be willing to comment on my discussion thread on vdsm-devel? So far, no one has been willing to address it.
-- To view, visit http://gerrit.ovirt.org/3756 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com
Adam Litke has posted comments on this change.
Change subject: rest-api: Model VMs ......................................................................
Patch Set 6: (2 inline comments)
.................................................... Commit Message Line 16: - Create a new VM and launch it I am actually trying to follow the model being used by the ovirt-engine REST API in order to maintain compatibility with that sdk and cli
Line 24: - Assign a connection password for the VM's display These URLs are formed in the same way as ovirt-engine so I would prefer to keep them consistent.
-- To view, visit http://gerrit.ovirt.org/3756 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com
Gal Hammer has posted comments on this change.
Change subject: rest-api: Model VMs ......................................................................
Patch Set 6: (1 inline comment)
.................................................... Commit Message Line 16: - Create a new VM and launch it Are you sure it is apply to vm creation as well?
-- To view, visit http://gerrit.ovirt.org/3756 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com
Adam Litke has posted comments on this change.
Change subject: rest-api: Model VMs ......................................................................
Patch Set 6: (2 inline comments)
Addressed some of Gal's comments. About to push a new series.
.................................................... Commit Message Line 16: - Create a new VM and launch it Done
Line 32: POST /api/vms/<id>/nics/add - Add a NIC Done
-- To view, visit http://gerrit.ovirt.org/3756 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: rest-api: Model VMs ......................................................................
Patch Set 8: I would prefer that you didn't submit this
(1 inline comment)
.................................................... Commit Message Line 44: by the API. I'm afraid that I fail to think of a sane way to store non-running VMs in vdsm. In "sane" I mean that it cannot be host-specific (migration/ split brain woos) and modular enough to allow a central out-of-vdsm database, such as that of ovirt-Engine.
Without that, I do not see how we can step forward with #2, so my vote goes with #1.
-- To view, visit http://gerrit.ovirt.org/3756 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: rest-api: Model VMs ......................................................................
Patch Set 8: No score
Build Started http://jenkins.ovirt.info/job/vdsm_unit_tests_by_patch/176/
-- To view, visit http://gerrit.ovirt.org/3756 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: rest-api: Model VMs ......................................................................
Patch Set 8:
Build Successful
http://jenkins.ovirt.info/job/vdsm_unit_tests_by_patch/176/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/3756 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Adam Litke has abandoned this change.
Change subject: rest-api: Model VMs ......................................................................
Patch Set 8: Abandoned
-- To view, visit http://gerrit.ovirt.org/3756 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon Gerrit-Change-Id: Ibed650a0215e7d841f5af0dd5f111a3e4a27ecf1 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org