Correct and consistent NTP configuration is vital for the health and monitoring of a datacenter. Many systems default to getting time from underlying components, such as BIOS. This makes ensuring correct configuration from the ground up important for the systems higher in the dependancy chain.
UCS Manager time settings can be quickly and easily configured using UCSMSDK, even at scale.
If you’re unfamiliar with UCSMSDK have a look through this [intro post]({% post_url 2018-03-23-Intro-to-UCSMSDK %}) to get started.
This post assumes that you have already logged into UCS Manager using the sdk.
Setting the timezone
Setting the timezone configures the localized timezone. Depending on your organisation, this configuration may or may not be desired.
The timezone value is a string formated as <Country/City>, for example, I would use “Australia/Melbourne”. It’s important to note that there is no validation against the timezone string, “Australia/Foo” is accepted as valid so check your spelling.
|
|
Adding NTP Servers
After the timezone has been set, NTP servers will need to be added to UCS Manager. Run the code for each NTP server to be added, or consider using a function.
The configuration setting is not visible in the UCS Manager web UI, however it can be retrieved through programmatic interfaces.
|
|
Removing NTP Servers
Removal of an NTP server is similar to adding an NTP server.
|
|
Validation of configuration
Configurations are a lot like backups, if they haven’t been validated they don’t exist.
The function has an additional check to ensure that the description matches what’s expected. This can be helpful when using configuration files to configure the environment instead of once off scripts.
|
|
Summary
Configuration of NTP settings is a small but critical setting for a healthy environment. For UCS Manager, this can be acheived quickly and easily through the Python SDK.