Change in vdsm[master]: rest-api: Model VMs

agl at us.ibm.com agl at us.ibm.com
Fri Apr 20 18:09:28 UTC 2012


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 at 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 at us.ibm.com>


More information about the vdsm-patches mailing list