Windows instances need timezone to be localtime

Bug #1231254 reported by Michael Still
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Michael Still
Grizzly
Fix Released
High
Michael Still

Bug Description

(This bug report is forked off from 1026621).

I'm sorry to hear you're having pain with Windows instances.
Unfortunately I don't know a lot about windows, but it sounds as though
if we could change the bios timezone for Windows instances to the
timezone of the compute node that would alleviate your issue. Is that
correct?

Looking at the code, each instance has an os_type field, which is
inherited from the image the instance is based off (there is an image
property called os_type). Xen expects this value to be "windows" for
windows instances. So, libvirt could do the same thing here and treat
the timezone for instances with os_type == "windows" differently.

I'm going to create a new bug to track this windows issue, so that I
can leave this bug focussed on the DHCP timeout issue. This isn't
because Windows is less important as a guest, but because I don't want
it to be missed in the DHCP discussion that's happening here.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/48385

Changed in nova:
status: Triaged → In Progress
Michael Still (mikal)
tags: added: havana-rc-potential
Revision history for this message
Shawn Duex (shawn-5) wrote :

Michael,

Thank you very much for picking this up and turning around a fix so quickly.

Have you considered a patch for this issue to Folsom and Grizzly? As far as I can tell the os_type is already available in glace for these versions.

Revision history for this message
Michael Still (mikal) wrote : Re: [Bug 1231254] Re: Windows instances need timezone to be localtime

No problem!

The process is once the patch has landed for Havana I can back port it to
the stable releases.

Cheers,
Michael
On 27/09/2013 7:41 AM, "Shawn Duex" <email address hidden> wrote:

> Michael,
>
> Thank you very much for picking this up and turning around a fix so
> quickly.
>
> Have you considered a patch for this issue to Folsom and Grizzly? As far
> as I can tell the os_type is already available in glace for these
> versions.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1231254
>
> Title:
> Windows instances need timezone to be localtime
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nova/+bug/1231254/+subscriptions
>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/48385
Committed: http://github.com/openstack/nova/commit/280a336a07006b2c998719f2f9033d43289ec7ef
Submitter: Jenkins
Branch: master

commit 280a336a07006b2c998719f2f9033d43289ec7ef
Author: Michael Still <email address hidden>
Date: Thu Sep 26 14:45:11 2013 +1000

    Windows instances require the timezone to be "localtime"

    This was relatively simple to fix, assuming that the image used
    to boot the windows instance has the os_type set to "windows".
    The use of os_type in this manner is consistent with the
    existing use in the Xen hypervisor driver.

    DocImpact: if you're booting windows instances, then you need to
    set the os_type image property in glance to "windows". Otherwise
    your instances will have their clock timezone set to UTC, which
    has unexpected side effects in windows.

    Change-Id: Id6759a290ed25c9add97ac61bb7d165b3fb908b2
    Closes-Bug: 1231254

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Michael Still (mikal) wrote :

@Shawn is it possible for you to confirm this fix works for you in trunk before I back port it to stable releases?

Revision history for this message
Shawn Duex (shawn-5) wrote :

@Michael,

We do not currently have an environment running trunk. However our cloud admin looked at your commit and ported it to our Folsom cloud. We then further validated the fix on Folsom and it is working as expected. Instances spawned from images with the os_type=windows metadata are created using localtime as the libvirt clock virtualization type.

Please let me know if you need an additional details

Revision history for this message
Michael Still (mikal) wrote : Re: [Bug 1231254] Re: Windows instances need timezone to be localtime

Awesome. I will work on the back port now then.

On Sat, Sep 28, 2013 at 9:41 AM, Shawn Duex <email address hidden> wrote:
> @Michael,
>
> We do not currently have an environment running trunk. However our cloud
> admin looked at your commit and ported it to our Folsom cloud. We then
> further validated the fix on Folsom and it is working as expected.
> Instances spawned from images with the os_type=windows metadata are
> created using localtime as the libvirt clock virtualization type.
>
> Please let me know if you need an additional details
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1231254
>
> Title:
> Windows instances need timezone to be localtime
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nova/+bug/1231254/+subscriptions

--
Rackspace Australia

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/48772

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/folsom)

Fix proposed to branch: stable/folsom
Review: https://review.openstack.org/48788

Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/grizzly)

Reviewed: https://review.openstack.org/48772
Committed: http://github.com/openstack/nova/commit/18de64748c645b32253901aa704c353e5705eadb
Submitter: Jenkins
Branch: stable/grizzly

commit 18de64748c645b32253901aa704c353e5705eadb
Author: Michael Still <email address hidden>
Date: Thu Sep 26 14:45:11 2013 +1000

    Windows instances require the timezone to be "localtime"

    This was relatively simple to fix, assuming that the image used
    to boot the windows instance has the os_type set to "windows".
    The use of os_type in this manner is consistent with the
    existing use in the Xen hypervisor driver.

    DocImpact: if you're booting windows instances, then you need to
    set the os_type image property in glance to "windows". Otherwise
    your instances will have their clock timezone set to UTC, which
    has unexpected side effects in windows.

    Change-Id: Id6759a290ed25c9add97ac61bb7d165b3fb908b2
    Closes-Bug: 1231254
    (cherry picked from commit 280a336a07006b2c998719f2f9033d43289ec7ef)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/folsom)

Reviewed: https://review.openstack.org/48788
Committed: http://github.com/openstack/nova/commit/6d3cf9010a45edb16f28b2582eafe35666381d1f
Submitter: Jenkins
Branch: stable/folsom

commit 6d3cf9010a45edb16f28b2582eafe35666381d1f
Author: Michael Still <email address hidden>
Date: Thu Sep 26 14:45:11 2013 +1000

    Windows instances require the timezone to be "localtime"

    This was relatively simple to fix, assuming that the image used
    to boot the windows instance has the os_type set to "windows".
    The use of os_type in this manner is consistent with the
    existing use in the Xen hypervisor driver.

    DocImpact: if you're booting windows instances, then you need to
    set the os_type image property in glance to "windows". Otherwise
    your instances will have their clock timezone set to UTC, which
    has unexpected side effects in windows.

    (cherry picked from commit 280a336a07006b2c998719f2f9033d43289ec7ef)
    (cherry picked from commit 18de64748c645b32253901aa704c353e5705eadb)

    Conflicts:
     nova/virt/libvirt/driver.py

    Note that the unit test had to be tweaked to work in the backport.
    There are no functional changes however.

    Change-Id: Id6759a290ed25c9add97ac61bb7d165b3fb908b2
    Closes-Bug: 1231254

Thierry Carrez (ttx)
Changed in nova:
milestone: havana-rc1 → 2013.2
Sean Dague (sdague)
no longer affects: nova/folsom
Revision history for this message
Nick (nicks-xiao) wrote :

In my environment (icehouse 2014.1.2) use the following can work well

# glance image-update 18ff395d-668a-40cf-ba89-6a3ba47a2a55 --property os_type='windows'

# nova --debug boot --flavor 10001 --block-device id=18ff395d-668a-40cf-ba89-6a3ba47a2a55,source=image,dest=volume,device=vda,size=1,bootindex=0,shutdown=remove --nic net-id=cdf34f23-6b9a-4e53-9dbb-16270e483b30 --meta os_type=windows ot-t1

# virsh dumpxml eeefe8b8-1ad6-4b75-aa7b-9412a9f3e3a1 | grep clock
  <clock offset='localtime'/>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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