Source:
protected boolean canDoAction() { VM vm = getVm(); if (vm == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (!validateObject(vm.getStaticData())) { return false; } if (!canRunActionOnNonManagedVm()) { return false; } RunVmValidator runVmValidator = getRunVmValidator(); if (!runVmValidator.canRunVm( getReturnValue().getCanDoActionMessages(), getStoragePool(), getRunVdssList(), getVdsWhiteList(), getPredefinedVdsIdToRunOn(), getVdsGroup())) { return false; } if (!validate(runVmValidator.validateNetworkInterfaces())) { return false; } if (getParameters().getVmPayload() != null) { if (checkPayload(getParameters().getVmPayload(), getParameters().getDiskPath()) && !StringUtils.isEmpty(getParameters().getFloppyPath()) && getParameters().getVmPayload().getType() == VmDeviceType.FLOPPY) { return failCanDoAction(VdcBllMessages.VMPAYLOAD_FLOPPY_EXCEEDED); } getVm().setVmPayload(getParameters().getVmPayload()); } if (!checkRngDeviceClusterCompatibility()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_RNG_SOURCE_NOT_SUPPORTED); } if (isRunAsStateless()) { return validateSpaceRequirements(); } if (getParameters().getInitializationType() != null) { if (getParameters().getInitializationType() == InitializationType.Sysprep && getParameters().getVmPayload() != null && getParameters().getVmPayload().getType() == VmDeviceType.FLOPPY) { return failCanDoAction(VdcBllMessages.VMPAYLOAD_FLOPPY_WITH_SYSPREP); } else if (getParameters().getInitializationType() == InitializationType.Sysprep && getParameters().getVmPayload() != null && getParameters().getVmPayload().getType() == VmDeviceType.CDROM) { return failCanDoAction(VdcBllMessages.VMPAYLOAD_CDROM_WITH_CLOUD_INIT); } } return true; }

Target:
protected boolean canDoAction() { VM vm = getVm(); if (vm == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (!validateObject(vm.getStaticData())) { return false; } if (!canRunActionOnNonManagedVm()) { return false; } RunVmValidator runVmValidator = getRunVmValidator(); if (!runVmValidator.canRunVm( getReturnValue().getCanDoActionMessages(), getStoragePool(), getRunVdssList(), getVdsWhiteList(), getPredefinedVdsIdToRunOn(), getVdsGroup())) { return false; } if (!validate(runVmValidator.validateNetworkInterfaces())) { return false; } if (getParameters().getVmPayload() != null) { if (checkPayload(getParameters().getVmPayload(), getParameters().getDiskPath()) && !StringUtils.isEmpty(getParameters().getFloppyPath()) && getParameters().getVmPayload().getDeviceType() == VmDeviceType.FLOPPY) { return failCanDoAction(VdcBllMessages.VMPAYLOAD_FLOPPY_EXCEEDED); } getVm().setVmPayload(getParameters().getVmPayload()); } if (!checkRngDeviceClusterCompatibility()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_RNG_SOURCE_NOT_SUPPORTED); } if (isRunAsStateless()) { return validateSpaceRequirements(); } if (getParameters().getInitializationType() != null) { if (getParameters().getInitializationType() == InitializationType.Sysprep && getParameters().getVmPayload() != null && getParameters().getVmPayload().getDeviceType() == VmDeviceType.FLOPPY) { return failCanDoAction(VdcBllMessages.VMPAYLOAD_FLOPPY_WITH_SYSPREP); } else if (getParameters().getInitializationType() == InitializationType.CloudInit && getParameters().getVmPayload() != null && getParameters().getVmPayload().getDeviceType() == VmDeviceType.CDROM) { return failCanDoAction(VdcBllMessages.VMPAYLOAD_CDROM_WITH_CLOUD_INIT); } } return true; }