 
 #---------------------------------------------------------------------
 
-copy = $coroutine ({ vm, sr, name: nameLabel }) ->
+copy = $coroutine ({
+  compress,
+  name: nameLabel,
+  sr,
+  vm
+}) ->
   if vm.$poolId == sr.$poolId
     if vm.power_state is 'Running'
       yield checkPermissionsForSnapshot.call(this, vm)


checkPermissionsForSnapshot = (vm) -> (
  permissions = []
  $forEach(vm.$VBDs, (vbdId) =>
    vbd = @getObject(vbdId, 'VBD')
    vdiId = vbd.VDI


  return @getXAPI(vm).cloneVm(vm.ref, {
    nameLabel: name,
    fast: not full_copy
  }).then((vm) -> vm.$id)

clone.params = {
  id: { type: 'string' }
