   memory: { type: 'integer', optional: true }
 }
 
-exports.restart = $coroutine ({vm, force}) ->
+set.resolve = {
+  VM: ['id', 'VM'],
+}
+
+exports.set = set
+
+#---------------------------------------------------------------------
+
+restart = $coroutine ({vm, force}) ->
   xapi = @getXAPI(vm)
 
   try

  $wait xapi.call 'VBD.insert', cdDriveRef, vdi.ref

  return true
exports.insertCd.params = {
  id: { type: 'string' }
  cd_id: { type: 'string' }
  force: { type: 'boolean' }
}
exports.insertCd.resolve = {
  vm: ['id', 'VM'],
  vdi: ['cd_id', 'VDI'],
}

exports.migrate = $coroutine ({vm, host}) ->
  unless $isVMRunning vm
    @throw 'INVALID_PARAMS', 'The VM can only be migrated when running'


    type: 'boolean'
  }
}

delete_.resolve = {
  vm: ['id', ['VM', 'VM-snapshot']]
}

exports.delete = delete_

#---------------------------------------------------------------------

ejectCd = $coroutine ({vm}) ->
  xapi = @getXAPI vm

  # Finds the CD drive.
