Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2183466

Summary: User cannot determine cluster time zone
Product: Red Hat Enterprise Linux 9 Reporter: Simon Foucek <sfoucek>
Component: pacemakerAssignee: Ken Gaillot <kgaillot>
Status: CLOSED MIGRATED QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: medium    
Version: 9.2CC: cluster-maint, nwahl
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-22 20:07:41 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Simon Foucek 2023-03-31 09:18:55 UTC
Description of problem:
A user has a 2-node cluster with nodes X and Y. Node X is in time zone +0, node Y is in time zone +2. On node X it is currently 12:30, on node Y it is 14:30. The user creates a resource and for it a Location rule constraint with a certain time range(12-13).  The user has no way to know which time zone is considered the main time zone for the whole cluster and whether the rule will apply to the whole cluster or not.


Version-Release number of selected component (if applicable):

Pacemaker 2.1.5-7.el9



Steps to Reproduce:
>[root@virt-491 ~]# date
Fri Mar 31 09:11:03 AM UTC 2023
>[root@virt-486 ~]# date
Fri Mar 31 11:08:32 AM CEST 2023
>[root@virt-486 ~]# pcs resource create dummy ocf:heartbeat:Dummy
>[root@virt-486 ~]# pcs status
Cluster name: STSRHTS29864
Status of pacemakerd: 'Pacemaker is running' (last updated 2023-03-31 11:11:47 +02:00)
Cluster Summary:
  * Stack: corosync
  * Current DC: virt-486 (version 2.1.5-7.el9-a3f44794f94) - partition with quorum
  * Last updated: Fri Mar 31 11:11:48 2023
  * Last change:  Fri Mar 31 11:11:44 2023 by root via cibadmin on virt-486
  * 2 nodes configured
  * 3 resource instances configured

Node List:
  * Online: [ virt-486 virt-491 ]

Full List of Resources:
  * fence-virt-486	(stonith:fence_xvm):	 Started virt-486
  * fence-virt-491	(stonith:fence_xvm):	 Started virt-491
  * dummy	(ocf:heartbeat:Dummy):	 Started virt-486

Daemon Status:
  corosync: active/disabled
  pacemaker: active/disabled
  pcsd: active/enabled

>[root@virt-486 ~]# pcs constraint location dummy rule score=-INFINITY date-spec hours='9-10' 
>[root@virt-486 ~]# pcs status
Cluster name: STSRHTS29864
Status of pacemakerd: 'Pacemaker is running' (last updated 2023-03-31 11:13:50 +02:00)
Cluster Summary:
  * Stack: corosync
  * Current DC: virt-486 (version 2.1.5-7.el9-a3f44794f94) - partition with quorum
  * Last updated: Fri Mar 31 11:13:50 2023
  * Last change:  Fri Mar 31 11:13:48 2023 by root via cibadmin on virt-486
  * 2 nodes configured
  * 3 resource instances configured

Node List:
  * Online: [ virt-486 virt-491 ]

Full List of Resources:
  * fence-virt-486	(stonith:fence_xvm):	 Started virt-486
  * fence-virt-491	(stonith:fence_xvm):	 Started virt-491
  * dummy	(ocf:heartbeat:Dummy):	 Started virt-486

Daemon Status:
  corosync: active/disabled
  pacemaker: active/disabled
  pcsd: active/enabled

>[root@virt-486 ~]# pcs constraint location remove location-dummy
>[root@virt-486 ~]# pcs constraint location dummy rule score=-INFINITY date-spec hours='11-12' 
>[root@virt-486 ~]# pcs status
Cluster name: STSRHTS29864
Status of pacemakerd: 'Pacemaker is running' (last updated 2023-03-31 11:14:49 +02:00)
Cluster Summary:
  * Stack: corosync
  * Current DC: virt-486 (version 2.1.5-7.el9-a3f44794f94) - partition with quorum
  * Last updated: Fri Mar 31 11:14:49 2023
  * Last change:  Fri Mar 31 11:14:47 2023 by root via cibadmin on virt-486
  * 2 nodes configured
  * 3 resource instances configured

Node List:
  * Online: [ virt-486 virt-491 ]

Full List of Resources:
  * fence-virt-486	(stonith:fence_xvm):	 Started virt-486
  * fence-virt-491	(stonith:fence_xvm):	 Started virt-491
  * dummy	(ocf:heartbeat:Dummy):	 Stopped

Daemon Status:
  corosync: active/disabled
  pacemaker: active/disabled
  pcsd: active/enabled


Actual results:
It is not possible to find out which node is used to take the time for the whole cluster and this may imply strange behaviour in edge cases.

Expected results:

In the cluster it will be possible to find out what time zone/time is valid for the whole cluster. If this cannot be found out, it should at least be sufficiently specified and recommended to set a single time zone in the whole cluster and mention the possibility of the problem.

Comment 1 Reid Wahl 2023-03-31 10:00:52 UTC
The DC (designated controller) node runs the scheduler and evaluates the rules. The evaluation of date-based rules is based on the time on the DC. It looks as if the time used for evaluation is relative to the system's configured time zone, rather than based on UTC. I suspect this was chosen for convenience: many users will find it less error-prone to configure rules based on their local time zone.

So the result of the evaluation depends on which node is DC. There is no persistent "cluster-wide" time -- to the extent that there is such a thing, it's the time of the current DC.

One possible solution might be to add a new "time_zone" field to rules. Another might be to have a cluster-wide time zone property that overrides the system's time zone (via pe_working_set_t:now).

Comment 2 Simon Foucek 2023-03-31 10:56:00 UTC
If I understand the logic you describe, it would be best to add the possibility to set the TZ for DC, so it would not change when moving between nodes. The user could also see which TZ is set up for the cluster.

Comment 3 Reid Wahl 2023-04-03 08:10:25 UTC
(In reply to Simon Foucek from comment #2)
> If I understand the logic you describe, it would be best to add the
> possibility to set the TZ for DC, so it would not change when moving between
> nodes. The user could also see which TZ is set up for the cluster.

The way I'm thinking about it, the property would set the time zone for the whole cluster, not just for the DC. It wouldn't have to affect the system time -- only the time that Pacemaker uses.

That's probably also a lot easier to implement than another approach.

Comment 4 Simon Foucek 2023-04-03 08:21:22 UTC
That seems like a fine solution for me. I would also add the possibility of checking the property's current value.

Comment 6 RHEL Program Management 2023-09-22 20:05:14 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 7 RHEL Program Management 2023-09-22 20:07:41 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.