 
   if resourceSet
     @addAcl(user.id, vm.id, 'admin').catch(noop)
-    xapi.xo.setData(xapiVm.$id, 'resourceSet', resourceSet).catch(noop)
+    yield xapi.xo.setData(xapiVm.$id, 'resourceSet', resourceSet).catch(noop)
 
   return vm.id
 

    }
  )

  xapiExistingVdis = existingDisks and map(existingDisks, (vdi) =>
    sr = @getObject(vdi.$SR)

    # FIXME: handle existing VDIs when not resized.
    if vdi.size
      size = parseSize(vdi.size)
      limits.disk += size

    objectIds.push(sr.id)


  else unless user.permission is 'admin'
    throw new Unauthorized()

  xapiVm = yield xapi.createVm(template._xapiId, {
    installRepository: installation && installation.repository,
    nameDescription: name_description,
