openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
154 stars 131 forks source link

NTPServers are hard-coded for eth0 #223

Closed leiyu-bytedance closed 2 years ago

leiyu-bytedance commented 3 years ago

Describe the bug bmcweb is getting and patching NTPServers only from "/xyz/openbmc_project/network/eth0" object.

See

The code is using the hard-coded /xyz/openbmc_project/network/eth0 DBus object to get and set the NTP servers.

So a BMC using a different ethernet device will have a broken NTP config on Redfish.

Probably we should config a global config for NTP servers?

gtmills commented 2 years ago

Was added here: https://github.com/openbmc/bmcweb/commit/20e6ea5dbfaa04f4298116281ddfb997847189ce @raviteja-b FYI

lxwinspur commented 2 years ago

I hit the same error, we are using eth1 instead of eth0. and when we run the setNTP method to asynchronous NTP, we can not receive any data, it will return timeout.

If we change /xyz/openbmc_project/network/eth0 to /xyz/openbmc_project/network/eth1 manually, it works fine.

edtanous commented 2 years ago

Ideally this should be using the mapper to look up the NTP interface. A gerrit review would be welcome to fix this.

lxwinspur commented 2 years ago

Fix this issue by: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/4734

edtanous commented 2 years ago

Fixed on master. Please reopen if you're still having issues.