Windows VM instance cannot synchronize timezone with the STX host system.

Bug #1931535 reported by chendongqi
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
StarlingX
Invalid
Low
zhipeng liu

Bug Description

Brief Description
-----------------
Modify the host timezone, upload the windows image, update the metadata "os_type=windows"(domain xml clock offset='localtime'). Create a windows VM, turn off the automatic synchronization time in the windows VM, then turn off the windows VM, turn on the VM, the VM time is inconsistent with the host time.

for example:

system modify --timezone=Asia/Shanghai
[sysadmin@controller-0 ~(keystone_admin)]$ date
Thu Jun 10 14:50:39 CST 2021

VM time: 6:50:39

Modify the host time zone to shanghai, the host display time is UTC+8. But the windows VM display time is UTC time。
According to "https://libvirt.org/formatdomain.html" description:
"The guest clock will be synchronized to the host's configured timezone when booted, if any."
The time displayed in the windows VM should be consistent with the timezone of the host

Severity
--------
Major

Steps to Reproduce
------------------
1.Modify host timezone
2.Upload windows image and modify metadata "os_type=windows"
3.Create windows VM and close the time synchronization internet
4.Turn off VM, turn on VM

Expected Behavior
------------------

The time displayed in the windows VM should be consistent with the timezone of the host

Actual Behavior
----------------

The time displayed in the windows VM is inconsistent with the timezone of the host

Reproducibility
---------------

reproducible

System Configuration
--------------------

Multi-node

Branch/Pull Time/Commit
-----------------------
release 5.0.0

chendongqi (chen-dq)
summary: - Windows instance get error host time
+ Windows VM instance cannot synchronize timezone with the STX host
+ system.
Revision history for this message
chendongqi (chen-dq) wrote :

Microsoft Windows images Download:

https://cloudbase.it/windows-cloud-images/

Revision history for this message
zhao.shuai (zhao.shuai.neusoft) wrote :

The basic reasons for this ticket are as follows:
After StarlingX containerized Openstack, It did not synchronize the time zone between the container and the STX host.
Please refer to the following link for the cause of the problem:
https://serverfault.com/questions/1012542/docker-container-time-2-hours-behind-when-tz-cest

Revision history for this message
zhao.shuai (zhao.shuai.neusoft) wrote :

We made a temporary modification to the local file:
stx-openstack-1.0-78-centos-stable-latest\charts\libvirt-0.1.0\libvirt\templates\daemonset-libvirt.yaml.
The modification method is as follows:
          lifecycle:
            postStart:
              exec:
                command:
                  - bash
                  - -c
                  - |-
                    rm -f /etc/localtime
                    ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
After modification, re-upload stx-openstack-1.0-78-centos-stable-latest.tgz in STX system and apply.
The time displayed in the windows VM is consistent with the host time zone, and the correct time display is still maintained after restarting.

The reasonable method we currently analyze is:
...
      containers:
        - name: libvirt
          lifecycle:
            postStart:
              exec:
                command:
                  - bash
                  - -c
                  - |-
                    rm -f /etc/localtime
          volumeMounts:
            - mountPath: /etc/localtime
              name: localtime
              readOnly: true
...
      volumes:
        - name: localtime
          hostPath:
            path: /etc/localtime
we don'n know if the community can provide a more efficient modification method.
Thank you so much.

Revision history for this message
Austin Sun (sunausti) wrote :

@zhipeng, can this override this option?

Changed in starlingx:
assignee: nobody → zhipeng liu (zhipengs)
Revision history for this message
zhipeng liu (zhipengs) wrote :

We could not override this option.
The timezone is set by default and you need to change it manually.

Why did you turn off the automatic synchronization time in the windows VM?

Revision history for this message
chendongqi (chen-dq) wrote :

One possible situation is that the windows VM cannot access the internet network

Ghada Khalil (gkhalil)
tags: added: stx.distro.openstack
Austin Sun (sunausti)
Changed in starlingx:
importance: Undecided → Low
Revision history for this message
Thales Elero Cervi (tcervi) wrote :

Is this still an issue?
For now will reject it due to inactivity.

Changed in starlingx:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.