     limits.disk += size
 
     return $assign({}, vdi, {
-      device: vdi.userdevice ? vdi.device ? vdi.position,
+      device: ++highestDevice,
       size,
       SR: sr._xapiId,
       type: vdi.type

endsWith = require 'lodash/endsWith'
escapeStringRegexp = require 'escape-string-regexp'
eventToPromise = require 'event-to-promise'
merge = require 'lodash/merge'
sortBy = require 'lodash/sortBy'
startsWith = require 'lodash/startsWith'

    items: {
      type: 'object'
      properties: {
        size: { type: ['integer', 'string'] }
        SR: { type: 'string' }
        type: { type: 'string' }
