     virtual_size: size
     type: 'user'
     SR: SR.ref
-    sharable : false
-    read_only : false
+    sharable: false
+    read_only: false
     other_config: {}
   }
 

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


  return true

exports.attachDisk.permission = 'admin'
exports.attachDisk.params = {
  bootable: {
    type: 'boolean'
    optional: true
  }
  mode: { type: 'string' }
  position: { type: 'string' }
  vdi: { type: 'string' }
  vm: { type: 'string' }
}

# FIXME: position should be optional and default to last.
# FIXME: if position is used, all other disks after this position
# should be shifted.
exports.addDisk = ({vm, name, size, sr, position, bootable}) ->
  try
    VM = @getObject vm, 'VM'
    SR = @getObject sr, 'SR'
  catch
    @throw 'NO_SUCH_OBJECT'

