-
Notifications
You must be signed in to change notification settings - Fork 296
CP-308545 Add host.timezone #6758
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
CP-308545 Add host.timezone #6758
Conversation
|
use examples: python sdk APIs print(session.xenapi.host.get_timezone(host_ref))
session.xenapi.host.set_timezone(host_ref, 'Europe/London')
print(session.xenapi.host.get_timezone(host_ref))
try:
session.xenapi.host.set_timezone(host_ref, 'Europe/Londom')
except Exception as e:
print(e)
print(session.xenapi.host.list_timezones(host_ref))output: xe commands |
1064533 to
5e3f968
Compare
5e3f968 to
4ef9bcc
Compare
| ~ssh_enabled_timeout ~ssh_expiry ~console_idle_timeout ~ssh_auto_mode | ||
| ~max_cstate:"" ~secure_boot ~ntp_mode:`ntp_mode_dhcp ~ntp_custom_servers:[] | ||
| ~ntp_enabled:false ; | ||
| ~ntp_enabled:false ~timezone:"UTC" ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Not related with this PR)
Just to confirm: the timezone should be reserved when a host joins a pool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For pool join case, the new-joined host will keep its own timezone. For example, coordinator is 'UTC', host A is 'Asia/Shanghai' before join. Then hostA joins the pool and reboot, the hostA dbsync will set its timezone field to 'Asia/Shanghai' according to the real setting on host.
The test result
# xe host-list params=uuid,timezone
uuid ( RO) : f910aa46-0e52-4a86-8bdf-634ea894c32a
timezone ( RW): UTC
uuid ( RO) : ff2efb83-326a-4842-8b98-8e2efef32d3c
timezone ( RW): Asia/Shanghai
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For pool join, the host will first be added to the pool database using this function, with UTC as timezone. Then xapi will restart and dbsync will update it to the real timezone.
ocaml/idl/datamodel_host.ml
Outdated
| ~params: | ||
| [ | ||
| (Ref _host, "self", "The host") | ||
| ; (String, "value", "The timezone to set, e.g., 'Europe/London'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about to get it clear as:
The time zone identifier as defined in the IANA Time Zone Database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
New filed: host.timezone APIs: host.set_timezone, host.get_timezone, host.list_timezones Signed-off-by: Changlei Li <changlei.li@cloud.com>
4ef9bcc to
5f0e5cd
Compare
Signed-off-by: Changlei Li <changlei.li@cloud.com>
5f0e5cd to
f677ea7
Compare
4a67e13
into
xapi-project:feature/config-ntp-timezone-maxcstate
Uh oh!
There was an error while loading. Please reload this page.