@Override
 public IMedium apply(IMedium medium) {
   checkNotNull(medium.getChildren());
   if (medium.getDeviceType().equals(DeviceType.HardDisk)) {
     for (IMedium child : medium.getChildren()) {
       IProgress deletion = child.deleteStorage();
       deletion.waitForCompletion(-1);
     }
   }
   return medium;
 }
 @Override
 public boolean apply(IMedium medium) {
   for (StorageController controller : vmSpec.getControllers()) {
     if (controller.getHardDisk(medium.getName()).isAutoDelete()) return true;
   }
   return false;
 }