-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JENKINS-62939: Use latest for getting console output if Nitro #707
Conversation
Hello. When As the result, if "Host Key Verification Strategy" is "check-new-hard", the instance will be launched and terminated repeatedly. I guess it is necessary to modify to repeat |
Do you have the logs of what is happening? |
Thanks for the reply. The following log was repeated. (This job was working fine before the EC2 plugin was upgraded) Log
When I tested the result of Test codeimport com.amazonaws.services.ec2.AmazonEC2;
import com.amazonaws.services.ec2.AmazonEC2ClientBuilder;
import com.amazonaws.services.ec2.model.GetConsoleOutputRequest;
import com.amazonaws.services.ec2.model.GetConsoleOutputResult;
public class App {
public static void main(String[] args) {
final String instanceId = args[0];
final String output = new App().getConsoleOutput(instanceId);
System.out.println(output);
System.out.println();
}
private String getConsoleOutput(final String instanceId) {
final AmazonEC2 ec2 = AmazonEC2ClientBuilder.defaultClient();
final GetConsoleOutputRequest request = new GetConsoleOutputRequest(instanceId);
request.setLatest(true);
final GetConsoleOutputResult result = ec2.getConsoleOutput(request);
return result.getDecodedOutput();
}
} |
Added check for if hypervisor is Nitro and if so add latest to getConsoleOutput to decrease the time for when
console output can be parsed and ssh host key can be validated.