AWS documentation says "For Windows instances, the instance console output displays the last three system event log errors."
So thats obviously wrong. When I run "get system log" on one of my EC2 instances from the web console i see
2017/05/23 21:43:15Z: EC2ConfigMonitorState: 0
2017/05/23 21:43:15Z: Windows sysprep configuration complete.
2017/05/23 21:43:16Z: AMI Origin Version: 2016.12.14
2017/05/23 21:43:16Z: AMI Origin Name: Windows_Server-2012-R2_RTM-English-64Bit-Base
2017/05/23 21:43:16Z: OS: Microsoft Windows NT 6.3.9600
2017/05/23 21:43:16Z: OsVersion: 6.3
2017/05/23 21:43:16Z: OsProductName: Windows Server 2012 R2 Standard
2017/05/23 21:43:16Z: Language: en-US
2017/05/23 21:43:16Z: TimeZone: Coordinated Universal Time
2017/05/23 21:43:16Z: Offset: UTC 00:00:00
2017/05/23 21:43:16Z: EC2 Agent: Ec2Config service v4.1.1396
2017/05/23 21:43:16Z: Driver: AWS PV Network Device v7.4.3.0
2017/05/23 21:43:16Z: Driver: AWS PV Storage Host Adapter v7.4.3.0
2017/05/23 21:43:17Z: Message: Waiting for meta-data accessibility...
2017/05/23 21:43:17Z: Message: Meta-data is now available.
....
2017/05/23 21:43:26Z: KMS: Server:169.254.169.251; Attempt:1
2017/05/23 21:43:26Z: Message: Product activation was successful
2017/05/23 21:43:26Z: Message: Windows is Ready to useii
Thats not a windows event log and its not just the "last 3 errors". Where is the output Im looking at located on the instance and why does the documentation say it should be error system event logs when it is not?
I ran into the same issue and got the same result. So if you look at
C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Scripts\Get-ConsolePort.ps1 that is where you see that error on line 174.
Now if you look at the above if statement causing that you will see this line of code
I am 90% sure AWSAcpiSpcrReader.exe is used with the huge
at the end of each file and is used to validate that it is an allowed thing.
I am trying to copy the block into my user data but I think it will probably be too large so. It may be that if I import from S3 I can put the sig block there but I'm not sure. I am not a powershell person so we'll see.
HAHAHAHAHHA IT WORKED!! 2020/06/11 02:17:14Z: Message: Windows is Ready to use
2020/06/11 02:17:24Z: Message: OMGOMGOMG
Now, it is possible that block is generated every time the instance is built so we may have to somehow grab that block and import it to the userdata script. Or maybe when a new release is made. Unknown. Point is, the sig may change.
Excellent question. I have been struggling for months with seeing anything useful in that log for new Windows instances so I had to dig in. I'd like to post status messages there from provisioning scripts.
This is output from a serial console. I think Amazon set it up to be sort of like a Linux console, or maybe it's some ancient part of Windows. EC2Launch writes to it via a COM port.
You can see some examples by reading the code in _C:\ProgramData\Amazon\EC2-Windows\Launch\Module_ on a newer Windows instance.
An example that does effectively write during boot for some of the instances I have handy C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\SendWindowsIsReady.ps1
There's another script that's supposed to copy errors from the System event log to it, C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\SendEventLogs.ps1 ... I think that must be what the "last three system event log errors" documentation is referring to. But I've never been able to get that to show anything I wanted to show like progress of my userdata script.
I'm having a lot of trouble writing anything to the console. Maybe it's only accessible during boot or something. I'm trying things like,
but I get this error from
Open-SerialPort
:From the EC2 panel select your EC2
Navigate in Action options => select Instance settings => get system logs.
There you can find logs of your system.