From 235e3ea926bc1138b481f9200b1880f368cf0f27 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 18 Dec 2021 13:42:56 +0000 Subject: [PATCH] v2v: Swap over the output and conversion stages In old virt-v2v, we did (approximately, since the steps were not as clear): Input -> Convert -> Output -> Copy -> Finalize After modularizing virt-v2v we changed this to: Input -> Output -> Convert -> Copy -> Finalize However this has a (sort of) problem. For -o rhv-upload when we start the nbdkit rhv-upload-plugin machinery, it obtains a time-limited ticket from imageio. This ticket could expire if the conversion step takes longer than a certain time (60 seconds by default, may be increased in a future version of oVirt). I believe this is really a problem in imageio or that the rhv-upload-plugin should really renew this ticket automatically, but it does not, instead failing. (The ticket *is* renewed automatically whenever a request is sent to imageio, but in this case no requests are being sent). Anyway the easiest thing is to switch the ordering back to how it was in old virt-v2v (at top). It doesn't make a difference for any other output modes. Reported-by: Nir Soffer --- v2v/v2v.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/v2v/v2v.ml b/v2v/v2v.ml index a2414598..1db0c233 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -542,6 +542,11 @@ read the man page virt-v2v(1). exit 0 ); + (* Do the conversion. *) + with_open_out (tmpdir // "convert") (fun _ -> ()); + let inspect, target_meta = Convert.convert tmpdir conv_options source in + unlink (tmpdir // "convert"); + (* Start the output module (runs an NBD server in the background). *) let output_t = Output_module.setup tmpdir output_options source in @@ -551,11 +556,6 @@ read the man page virt-v2v(1). ignore (Sys.command cmd) ); - (* Do the conversion. *) - with_open_out (tmpdir // "convert") (fun _ -> ()); - let inspect, target_meta = Convert.convert tmpdir conv_options source in - unlink (tmpdir // "convert"); - (* Do the copy. *) with_open_out (tmpdir // "copy") (fun _ -> ()); -- 2.31.1