[Libguestfs] [PATCH 1/1] windows: delay installation of qemu-ga MSI
Daniel P. Berrangé
berrange at redhat.com
Mon Mar 2 11:35:29 UTC 2020
On Mon, Mar 02, 2020 at 12:26:00PM +0100, Tomáš Golembiovský wrote:
> Instead of running firstboot script during early boot schedule a task
> delayed for 1-2 minute.
IIUC, you picked 119 seconds, so effectively 2 minutes. IOW, s/1-2/2/
> During the first boot, after virt-v2v conversion, Windows installs the
> drivers injected by virit-v2v. When this installation is finished
s/virit/virt/
> Windows enforces some kind of internal reboot. This unfortunately
> terminates any running firstboot scritps thus killing the installation
s/scritpts/scripts/
> of qemu-ga MSI.
IIUC, the expectation is that the Windows installation of the
drivers will be completed *before* this 2 minute delay occurs.
Windows will then reboot, and the delayed GA job will be run
after this reboot ?
The key question is how confident are we that the 2 minute
delay is sufficient ? Is there chance of still hitting the
problem if doing v2v on slow (ie HDD, not SSD) storage
for example ?
>
> Signed-off-by: Tomáš Golembiovský <tgolembi at redhat.com>
> ---
> v2v/convert_windows.ml | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
> index 0fda1d4e..0a146006 100644
> --- a/v2v/convert_windows.ml
> +++ b/v2v/convert_windows.ml
> @@ -429,14 +429,10 @@ popd
> List.iter (
> fun msi_path ->
> let fb_script = "\
> -echo Installing qemu-ga from " ^ msi_path ^ "
> -\"\\" ^ msi_path ^ "\" /norestart /qn /l+*vx \"%~dpn0.log\"
> -set elvl=!errorlevel!
> -echo Done installing qemu-ga error_level=!elvl!
> -if !elvl! == 0 (
> - echo Restarting Windows...
> - shutdown /r /f /c \"rebooted by firstboot script\"
> -)
> +echo Removing any previously scheduled qemu-ga installation
> +schtasks.exe /Delete /TN Firstboot-qemu-ga /F
> +echo Scheduling delayed installation of qemu-ga from " ^ msi_path ^ "
> +powershell.exe -command \"$d = (get-date).AddSeconds(119); schtasks.exe /Create /SC ONCE /ST $d.ToString('HH:mm') /SD $d.ToString('MM/dd/yyyy') /RU SYSTEM /TN Firstboot-qemu-ga /TR \\\"C:\\" ^ msi_path ^ " /forcerestart /qn /l+*vx C:\\" ^ msi_path ^ ".log\\\"\"
> " in
> Firstboot.add_firstboot_script g inspect.i_root
> ("install " ^ msi_path) fb_script;
> --
> 2.25.0
>
>
> _______________________________________________
> Libguestfs mailing list
> Libguestfs at redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs
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 :|
More information about the Libguestfs
mailing list