// -> send reboot requests for each found VM
for (EC2Instance vm : vms) {
if (vm.getState().equalsIgnoreCase( "Destroyed" )) continue;
CloudStackUserVm resp = getApi().rebootVirtualMachine(vm.getId());
if (logger.isDebugEnabled())
logger.debug("Rebooting VM " + resp.getId() + " job " + resp.getJobId());
}
// -> if some specified VMs where not found we have to tell the caller
if (instanceSet.length != vms.length)
throw new EC2ServiceException(ClientError.InvalidAMIID_NotFound, "One or more instanceIds do not exist, other instances rebooted.");