Re: [Libguestfs] [PATCH v2v 0/5] convert: Find out if Windows guest is expecting BIOS localtime or UTC

2023-09-26 Thread Alice Frosi
On Mon, Sep 25, 2023 at 5:19 PM Daniel P. Berrangé 
wrote:

> On Mon, Sep 25, 2023 at 04:26:59PM +0200, Alice Frosi wrote:
> > Hi Rich,
> >
> > On Mon, Sep 25, 2023 at 4:10 PM Richard W.M. Jones 
> > wrote:
> >
> > > [Alice: See patch 2]
> > >
> >
> > I'm not 100% sure about the source of this work. However, we had in
> > KubeVirt people interested in using localtime with Windows [1]. Yes, I
> see
> > that you pointed to that PR in patch 2. The problem with that PR is the
> > migration. What happens if we migrate the VM to a host that is in another
> > timezone? Is it going to break the application running inside the VM?
>
> I would generally expect all hosts to be configured in the same timezone,
> for any given single cloud deployment.
>
> If you really are concerned about this problem though, libvirt lets you
> set this explicitly eg
>
>
>
>
I don't think we support this option in KubeVirt yet. It might be useful to
extend it. However, I'm not sure if it is the user's responsibility to
choose the TZ or if it should be decided by KubeVirt and not exposed to the
API.

Generally, I don't think we can always assume that all the node in the
cluster are in the same time zone. This could be signaled with some labels
and allow the VM to be scheduled only on the node with that label.


> With regards,
> Daniel
> --
> |: https://berrange.com  -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org-o-
> https://www.instagram.com/dberrange :|
>
>
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs


Re: [Libguestfs] [PATCH v2v 0/5] convert: Find out if Windows guest is expecting BIOS localtime or UTC

2023-09-25 Thread Richard W.M. Jones
On Mon, Sep 25, 2023 at 05:49:18PM +0200, Laszlo Ersek wrote:
> On 9/25/23 17:48, Laszlo Ersek wrote:
> > On 9/25/23 16:04, Richard W.M. Jones wrote:
> >> [Alice: See patch 2]
> >>
> >> [This patch is a bit rough, it could do with better commit messages
> >> and some tests.  Please test it to see if it solves the Windows
> >> conversion issue described in the thread below.]
> >>
> >> We currently do not set any  field in guest output.  Most
> >> Windows guests expect the BIOS to be set to localtime, whereas almost
> >> all Linux guests would expect it to be set to UTC.  It is also
> >> possible to configure a Windows guest to expect BIOS set to UTC.
> >>
> >> The default is usually BIOS set to UTC, so for many Windows guests
> >> this would be wrong.  This specifically may cause problems when
> >> scheduling qemu-ga installation, see the thread here:
> >>
> >> https://listman.redhat.com/archives/libguestfs/2023-September/thread.html#32556
> >>
> >> but could cause other general issues with time in the guest.
> >>
> >> One way to implement this would be to copy the source hypervisor
> >> information across; however I'm not confident this information is read
> >> correctly.  A better way is to read out what the guest is expecting
> >> from the Windows registry.  (For Linux we just assume BIOS is always
> >> UTC, since that's the default for almost any Linux guest which hasn't
> >> been dual-booted with Windows, which for VMs would be incredibly
> >> rare.)
> > 
> > I think the word "BIOS" is incorrectly used all over the series; I'd
> > rather say "RTC" / "real time clock".
> 
> ... meaning patch subject lines, commit message bodies, and code.

OK :-)

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



Re: [Libguestfs] [PATCH v2v 0/5] convert: Find out if Windows guest is expecting BIOS localtime or UTC

2023-09-25 Thread Laszlo Ersek
On 9/25/23 17:48, Laszlo Ersek wrote:
> On 9/25/23 16:04, Richard W.M. Jones wrote:
>> [Alice: See patch 2]
>>
>> [This patch is a bit rough, it could do with better commit messages
>> and some tests.  Please test it to see if it solves the Windows
>> conversion issue described in the thread below.]
>>
>> We currently do not set any  field in guest output.  Most
>> Windows guests expect the BIOS to be set to localtime, whereas almost
>> all Linux guests would expect it to be set to UTC.  It is also
>> possible to configure a Windows guest to expect BIOS set to UTC.
>>
>> The default is usually BIOS set to UTC, so for many Windows guests
>> this would be wrong.  This specifically may cause problems when
>> scheduling qemu-ga installation, see the thread here:
>>
>> https://listman.redhat.com/archives/libguestfs/2023-September/thread.html#32556
>>
>> but could cause other general issues with time in the guest.
>>
>> One way to implement this would be to copy the source hypervisor
>> information across; however I'm not confident this information is read
>> correctly.  A better way is to read out what the guest is expecting
>> from the Windows registry.  (For Linux we just assume BIOS is always
>> UTC, since that's the default for almost any Linux guest which hasn't
>> been dual-booted with Windows, which for VMs would be incredibly
>> rare.)
> 
> I think the word "BIOS" is incorrectly used all over the series; I'd
> rather say "RTC" / "real time clock".

... meaning patch subject lines, commit message bodies, and code.

___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



Re: [Libguestfs] [PATCH v2v 0/5] convert: Find out if Windows guest is expecting BIOS localtime or UTC

2023-09-25 Thread Laszlo Ersek
On 9/25/23 16:04, Richard W.M. Jones wrote:
> [Alice: See patch 2]
> 
> [This patch is a bit rough, it could do with better commit messages
> and some tests.  Please test it to see if it solves the Windows
> conversion issue described in the thread below.]
> 
> We currently do not set any  field in guest output.  Most
> Windows guests expect the BIOS to be set to localtime, whereas almost
> all Linux guests would expect it to be set to UTC.  It is also
> possible to configure a Windows guest to expect BIOS set to UTC.
> 
> The default is usually BIOS set to UTC, so for many Windows guests
> this would be wrong.  This specifically may cause problems when
> scheduling qemu-ga installation, see the thread here:
> 
> https://listman.redhat.com/archives/libguestfs/2023-September/thread.html#32556
> 
> but could cause other general issues with time in the guest.
> 
> One way to implement this would be to copy the source hypervisor
> information across; however I'm not confident this information is read
> correctly.  A better way is to read out what the guest is expecting
> from the Windows registry.  (For Linux we just assume BIOS is always
> UTC, since that's the default for almost any Linux guest which hasn't
> been dual-booted with Windows, which for VMs would be incredibly
> rare.)

I think the word "BIOS" is incorrectly used all over the series; I'd
rather say "RTC" / "real time clock".

Laszlo

___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



Re: [Libguestfs] [PATCH v2v 0/5] convert: Find out if Windows guest is expecting BIOS localtime or UTC

2023-09-25 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 04:26:59PM +0200, Alice Frosi wrote:
> Hi Rich,
> 
> On Mon, Sep 25, 2023 at 4:10 PM Richard W.M. Jones 
> wrote:
> 
> > [Alice: See patch 2]
> >
> 
> I'm not 100% sure about the source of this work. However, we had in
> KubeVirt people interested in using localtime with Windows [1]. Yes, I see
> that you pointed to that PR in patch 2. The problem with that PR is the
> migration. What happens if we migrate the VM to a host that is in another
> timezone? Is it going to break the application running inside the VM?

I would generally expect all hosts to be configured in the same timezone,
for any given single cloud deployment.

If you really are concerned about this problem though, libvirt lets you
set this explicitly eg

   

With regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs


Re: [Libguestfs] [PATCH v2v 0/5] convert: Find out if Windows guest is expecting BIOS localtime or UTC

2023-09-25 Thread Alice Frosi
Hi Rich,

On Mon, Sep 25, 2023 at 4:10 PM Richard W.M. Jones 
wrote:

> [Alice: See patch 2]
>

I'm not 100% sure about the source of this work. However, we had in
KubeVirt people interested in using localtime with Windows [1]. Yes, I see
that you pointed to that PR in patch 2. The problem with that PR is the
migration. What happens if we migrate the VM to a host that is in another
timezone? Is it going to break the application running inside the VM?

IMO, that was the major blocker of that PR. I initially suggested that we
either avoid migration as a first step or try to migrate only on nodes at
the same timezone,
Do you know if anyone has experience on this particular problem?

[1] https://github.com/kubevirt/kubevirt/pull/9587

Many thanks,
Alice
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs


Re: [Libguestfs] [PATCH v2v 0/5] convert: Find out if Windows guest is expecting BIOS localtime or UTC

2023-09-25 Thread Richard W.M. Jones
On Mon, Sep 25, 2023 at 04:26:59PM +0200, Alice Frosi wrote:
> Hi Rich,
> 
> On Mon, Sep 25, 2023 at 4:10 PM Richard W.M. Jones  wrote:
> 
> [Alice: See patch 2]
> 
>
> I'm not 100% sure about the source of this work. However, we had in
> KubeVirt people interested in using localtime with Windows [1]. Yes,
> I see that you pointed to that PR in patch 2. The problem with that
> PR is the migration. What happens if we migrate the VM to a host
> that is in another timezone? Is it going to break the application
> running inside the VM?

Does every Windows VM running in Kubevirt have its registry adjusted
so it expects the BIOS to be set to UTC?  (ie:
https://wiki.archlinux.org/title/System_time#UTC_in_Microsoft_Windows).
This is a non-standard setting, but I can't understand how Windows VMs
would have correct clocks if this were not the case.

BTW you could find out by running:

  $ virt-win-reg window.img 'HKLM\SYSTEM'

on some Kubevirt Windows VMs, and looking for:

  [\ControlSet001\Control\TimeZoneInformation]

in the output.  See if there is a key called "RealTimeIsUniversal" and
what it is set to.

If it is the case that this is always set for existing Kubevirt
guests, then virt-v2v would have to be changed so it also sets this
registry entry when the output is Kubevirt.

I agree that migration across timezones is highly problematic for the
BIOS = localtime situation.  I don't see any solution for that except
disallowing it.

> IMO, that was the major blocker of that PR. I initially suggested that we
> either avoid migration as a first step or try to migrate only on nodes at the
> same timezone,
> Do you know if anyone has experience on this particular problem?

I guess RHV must have encountered this before, but I don't know any
specifics.

Thanks,

Rich.

> [1] https://github.com/kubevirt/kubevirt/pull/9587
> 
> Many thanks,
> Alice

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs


[Libguestfs] [PATCH v2v 0/5] convert: Find out if Windows guest is expecting BIOS localtime or UTC

2023-09-25 Thread Richard W.M. Jones
[Alice: See patch 2]

[This patch is a bit rough, it could do with better commit messages
and some tests.  Please test it to see if it solves the Windows
conversion issue described in the thread below.]

We currently do not set any  field in guest output.  Most
Windows guests expect the BIOS to be set to localtime, whereas almost
all Linux guests would expect it to be set to UTC.  It is also
possible to configure a Windows guest to expect BIOS set to UTC.

The default is usually BIOS set to UTC, so for many Windows guests
this would be wrong.  This specifically may cause problems when
scheduling qemu-ga installation, see the thread here:

https://listman.redhat.com/archives/libguestfs/2023-September/thread.html#32556

but could cause other general issues with time in the guest.

One way to implement this would be to copy the source hypervisor
information across; however I'm not confident this information is read
correctly.  A better way is to read out what the guest is expecting
from the Windows registry.  (For Linux we just assume BIOS is always
UTC, since that's the default for almost any Linux guest which hasn't
been dual-booted with Windows, which for VMs would be incredibly
rare.)

Rich.


___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs