VirtualMachine vm = profile.getVirtualMachine();
State state = vm.getState();
s_logger.debug("Cleaning up resources for the vm " + vm + " in " + state + " state");
try {
if (state == State.Starting) {
Step step = work.getStep();
if (step == Step.Starting && !cleanUpEvenIfUnableToStop) {
s_logger.warn("Unable to cleanup vm " + vm + "; work state is incorrect: " + step);
return false;
}