-
Notifications
You must be signed in to change notification settings - Fork 137
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
Firecracker incorrect clock #1869
Comments
can confirm what you're seeing; we'll take a look as for boot_args I wasn't aware we were actually honoring those but I guess we are in some cases |
Thanks! For completeness, I also tried with firecracker 1.3.3 and the latest cloud-hypervisor w/ the same result. |
@jeromegn while not sure where that date-time comes from and why (both fc and ch), but if you want to test/use ntp klib, you need to have the application running for a bit longer, since it takes about 53-54 seconds for the ntp klib to collect samples and apply the clock changes. From tests some time ago, on my env tests,
|
@rinor interesting. I don't think I tried the cloud-hypervisor + ntp combo. Even if that works, ~1 minute to become time-synced is way too long. During that time, no TLS handshakes can happen (or maybe no TLS handshakes using certificates only valid after a date later than August 16th 2021). I did notice a freeze when using firecracker, but didn't link that to ntp. |
Nanos can run on platforms where the RTC peripheral is read-only (e.g. riscv-virt), is not initialized with the system time from the host (e.g. cloud-hypervisor), or is not available at all (e.g. AWS Firecracker). This change set allows the system time to be retrieved during boot from an alternative source (e.g. the wall clock time made available by the paravirtualized clock), and allows changing the system time even when the RTC peripheral is unavailable (in this case, the time update will not persist across a VM reset). The register_platform_clock_now() function now takes an additional parameter with the value of the offset between the system time and the monotonic time: if such offset is available (i.e. non-zero), it is used to initialize the rtc_offset field of the VDSO structure, otherwise the kernel falls back to trying to derive the offset from the RTC time. On platforms with the pvclock peripheral, the RTC offset is available via the wall clock time. The x86 RTC driver is being amended to be able to handle cases where the RTC is not available: in these cases, rtc_gettimeofday() returns 0, and rtc_settimeofday() is a no-op. Closes #1869
#1873 fixes the incorrect clock issue on both Firecracker and cloud-hypervisor, and also fixes the kernel freeze when using Firecracker with the ntp klib. If anyone wants to try it out without waiting for it to be merged in the master branch, you can do so by adding the
|
Thank you! I should be able to continue my research into nanos with this. I'll try it out later today. If there's no debugging server available, would there be a way to output verbose logs at runtime (especially boot time) from the nanos kernel? Somewhat like the Concerning boot args: I added the trust_cpu one, but wasn't sure it would do anything. The rest of the args was taken from the ops docs for firecracker. |
Nanos supports various tracing options to output verbose logs at runtime, see https://docs.ops.city/ops/configuration and specifically the trace, ltrace and NoTrace sections. But most of this output results from the interaction between the kernel and the user program, so does not cover what happens during boot before the user program begins execution. To get verbose logs at boot time one has to recompile the kernel after adding Line 30 in 2e9393b
|
That made me wonder if there's support for vsock devices? I thought there wasn't, but I noticed there's 1 reference to "VSOCK" in this codebase. However, trying to bind w/ a AF_VSOCK family socket does not work. Maybe I'm just missing a vsock device config in the boot arg? |
No, vsock devices are not supported yet. |
I'm not sure how to debug this, there aren't many docs about firecracker usage, but the clock is very wrong when using firecracker.
It appears to be stuck on Aug 16th 2021, on boot. I can't figure out why exactly. Firecracker supports KVM clock (pv), but I don't know if nanos is detecting it.
Using the C program defined here: #357 (comment)
I get:
fc.json
ops.json
I'm only trying the
ntp
klib as an attempt to fix it, but that doesn't help either.A few questions:
boot_args
for the kernel?The text was updated successfully, but these errors were encountered: