   )
 
   xapiExistingVdis = existingDisks and map(existingDisks, (vdi, device) =>
-
     if vdi.size?
       size = parseSize(vdi.size)
       diskSizesByDevice[device] = size

      sr = @getObject(vdi.$SR)
      objectIds.push(sr.id)

    return {
      size,
      $SR: sr and sr._xapiId,
      type: vdi.type
    }
  )

  forEach(diskSizesByDevice, (size) => limits.disk += size)

$assign = require 'lodash.assign'
$debug = (require 'debug') 'xo:api:vm'
$filter = require 'lodash.filter'
$findIndex = require 'lodash.findindex'
