 
   return true
 
-exports.diskAdd.permission = 'admin'
-exports.diskAdd.params = {
-  id: { type: 'string' }
+exports.addDisk.permission = 'admin'
+exports.addDisk.params = {
+  bootable: {
+    type: 'boolean'
+    optional: true
+  }
+  vm: { type: 'string' }
   name: { type: 'string' }
+  position: { type: 'string' }
   size: { type: 'string' }
-  SR: { type: 'string' }
-  position: { type: 'string' }
-}
+  sr: { type: 'string' }
+}


  return true

exports.diskAttach.permission = 'admin'
exports.diskAttach.params = {
  id: { type: 'string' }
  vdi: { type: 'string' }
  position: { type: 'string' }
  mode: { type: 'string' }
}

exports.diskAdd = ({id, name, size, SR, position}) ->
  try
    VM = @getObject id, 'VM'
    SR = @getObject SR, 'SR'
  catch
    @throw 'NO_SUCH_OBJECT'


    mode: 'RW'
    type: 'Disk'
    userdevice: position
    bootable: bootable ? true
    empty: false
    other_config: {}
    qos_algorithm_type: ''
    qos_algorithm_params: {}
