[wallaby][nova] Change Time Zone

Sean Mooney smooney at redhat.com
Thu Jun 3 13:02:03 UTC 2021


On Thu, 2021-06-03 at 17:01 +0500, Malik Obaid wrote:
> Hi,
> 
> I am using Openstack Wallaby release on Ubuntu 20.04.
> 
> When I try to list openstack compute services the time zone in 'Updated At'
> column is in UTC.
i suspect that that is based on the default timzone of the server where the conductor is running or perhaps the individual services.
nova does not have any configuration for this and the updated_at time filed is generally provded by the NovaPersistentObject mixin
https://github.com/openstack/nova/blob/master/nova/objects/base.py#L134-L149

for the compute nodes table its set by 
https://github.com/openstack/nova/blob/da57eebc9e1ab7e48d4c4ef6ec1eeba80d867d81/nova/db/sqlalchemy/api.py#L737-L738
and we are converting explitly to utc ltaher here
https://github.com/openstack/nova/blob/da57eebc9e1ab7e48d4c4ef6ec1eeba80d867d81/nova/db/sqlalchemy/api.py#L302-L318

while i have not explictly found where the compute service record update_at is set i would guess it a deliberate design descisn to only store
data information in utc format and leave it to the clinets to convert to local timezones if desired.
i think that is proably the correct approch to take. although i guess you could confvert it at the api potentially though im not sure that would
genrelaly be a good impromenbt to make



> root at controller-khi01 ~(keystone)# openstack compute service list
> +----+----------------+------------------+----------+---------+-------+----------------------------+
> > ID | Binary         | Host             | Zone     | Status  | State |
> Updated At                 |
> +----+----------------+------------------+----------+---------+-------+----------------------------+
> >  4 | nova-conductor | controller-khi01 | internal | enabled | up    |
> 2021-06-03T11:59:59.000000 |
> >  5 | nova-scheduler | controller-khi01 | internal | enabled | up    |
> 2021-06-03T12:00:08.000000 |
> >  8 | nova-compute   | kvm03-a1-khi01   | nova     | enabled | up    |
> 2021-06-03T12:00:02.000000 |
> >  9 | nova-compute   | kvm01-a1-khi01   | nova     | enabled | up    |
> 2021-06-03T12:00:02.000000 |
> +----+----------------+------------------+----------+---------+-------+----------------------------+
> 
> I want to change it to some other time zone. Is there a way to do it?
not that i am aware no.
> I would really appreciate any input in this regard.
> 
> Thank you.
> 
> Regards,
> Malik Obaid





More information about the openstack-discuss mailing list