- Newest
- Most votes
- Most comments
The issues you're experiencing after switching from EC2Launch v1 to EC2Launch v2 are likely related to the differences in how these versions handle instance configuration and sysprep processes. Here are some potential causes and solutions to consider:
-
Configuration migration: When migrating from EC2Launch v1 to v2, not all configurations are automatically transferred. The migration tool doesn't detect scheduled tasks linked to EC2Launch v1 scripts, so you may need to manually configure these in EC2Launch v2. Review your agent-config.yml file and ensure all necessary tasks are properly set up.
-
Sysprep process: The sysprep process in EC2Launch v2 might be handling some aspects differently than v1. This could affect how your instance is prepared for imaging. Make sure you're using the correct sysprep command for v2: "EC2Launch.exe sysprep".
-
Computer name setting: Your approach to setting the computer name has changed. While using the setHostName task in the config file is correct for EC2Launch v2, ensure that this change isn't causing any unexpected side effects. The reboot after setting the hostname might be interfering with other setup processes.
-
User data execution timing: In EC2Launch v2, the timing of user data execution has changed. It now runs during the PostReady stage, and the exact timing depends on the format of your user data (YAML 1.0, YAML 1.1, or XML). Ensure your user data is in the correct format and running at the appropriate time.
-
IIS configuration: The lack of IIS logs suggests that IIS might not be fully initialized or configured correctly after the sysprep process. Review your IIS setup process in the user data script to ensure it's compatible with the EC2Launch v2 workflow.
-
Encryption key issues: The Event ID 5061 relates to cryptographic operations, specifically the sealing of keys. This could indicate that there's an issue with how system or user keys are being handled after the sysprep process. This might be related to how EC2Launch v2 prepares the instance for imaging.
To troubleshoot:
- Review and update your agent-config.yml file to ensure all necessary tasks are properly configured for EC2Launch v2.
- Check the EC2Launch v2 logs (located in C:\ProgramData\Amazon\EC2Launch\log) for any error messages or unexpected behavior.
- Verify that your user data script is running at the correct time and completing all necessary setup steps.
- Consider temporarily disabling the setHostName task to see if it's causing any conflicts.
- Ensure that your IIS setup process is compatible with the EC2Launch v2 workflow.
- Investigate the cryptographic issues indicated by Event ID 5061, possibly by reviewing system security policies and how they're applied during the sysprep process.
If these steps don't resolve the issue, you may need to engage with AWS support for more in-depth troubleshooting, as there could be complex interactions between EC2Launch v2, your custom setup process, and Windows system configurations.
Sources
Migrate to EC2Launch v2 for Windows instances - Amazon Elastic Compute Cloud
Troubleshoot issues with the EC2Launch v2 agent - Amazon Elastic Compute Cloud
Use the EC2Launch v2 agent to perform tasks during EC2 Windows instance launch - Amazon Elastic Compute Cloud
Windows Service administration for EC2Launch v2 and EC2Config agents - Amazon Elastic Compute Cloud
I indicated in my original post that I wasn't sure whether or not changing the machine name had anything to do with it. Now I am sure. It doesn't.
I tried removing my edit of the config file, so the machine name would not be changed. And it's failing in exactly the same way. Still getting the failed event id 5061's in the Security log. Still getting no inetpub\Logs. It doesn't matter that the website code can't figure out which DB to connect to based on the system name -- it looks like the website code just isn't running.
Relevant content
- asked a year ago
- asked 6 months ago
- asked a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 months ago
What happens when you try and connect to the website? What errors? What happens when going direct vs cloudfront?