projectcalico / calico

Cloud native networking and network security
https://docs.tigera.io/calico/latest/about/
Apache License 2.0
6.03k stars 1.34k forks source link

hcnnetwork get weird when change windows timezone #9359

Open thdrnsdk opened 1 month ago

thdrnsdk commented 1 month ago

hcnnetwork get weird when change os's timezone

If the calico Windows container restarts without rebooting after the OS timezone is changed there is a mismatch between the last boottime used in node-start.ps1 and the stored lasttime, so logic to delete the HNS network is performed. (https://github.com/projectcalico/calico/blob/master/node/windows-packaging/CalicoWindows/node/node-service.ps1#L76)

In normal cases, Remove-HNSNetwork would not be performed, but the timezone changes, lastboottime changes, and the corresponding logic is performed when calico container restart

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

Your Environment

coutinhop commented 3 weeks ago

@thdrnsdk could you give some more detail on the issue you're having? That logic to clean up HNS networks if a reboot is detected only happens on calico-node startup, and things will be restored to a working state in the end. A mis-detection of a reboot is unfortunate, but I fail to see how that's more than an inconvenience. Could you please elaborate your scenario?

thdrnsdk commented 3 weeks ago

when i was changed os timezone (for example from kst to utc), after than not reboot the server. in that state, if calico pod was restarted then always not equl storedboottime and last boottime so not after the node is rebooted, but simply restarting the pod, but all hnsnetworks are deleted.

https://github.com/projectcalico/calico/blob/master/node/windows-packaging/CalicoWindows/node/node-service.ps1#L55

for example 2024-10-18T03:01:45.2270501+09:00 stdout F StoredLastBootTime 6/13/2024 4:39:15 PM, CurrentLastBootTime 6/13/2024 7:39:15 AM