From 36b19e62161d92177e0eb791d22e12e44dc248b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ne=C4=8Das?= Date: Mon, 23 Sep 2024 10:05:49 +0200 Subject: [PATCH] Fix warm migration windows static ip (#1066) Issue: The windows is missing the static IP address mapping. Fix: Add the `--mac` mapping so the virt-v2v-in-place flow. Signed-off-by: Martin Necas --- virt-v2v/cmd/entrypoint.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/virt-v2v/cmd/entrypoint.go b/virt-v2v/cmd/entrypoint.go index eaf3e328b..8bc88e76b 100644 --- a/virt-v2v/cmd/entrypoint.go +++ b/virt-v2v/cmd/entrypoint.go @@ -95,6 +95,11 @@ func runVirtV2vInPlace() error { } else { args = append(args, "first") } + if envStaticIPs := os.Getenv("V2V_staticIPs"); envStaticIPs != "" { + for _, macToIp := range strings.Split(envStaticIPs, "_") { + args = append(args, "--mac", macToIp) + } + } args = append(args, "/mnt/v2v/input.xml") v2vCmd := exec.Command("/usr/libexec/virt-v2v-in-place", args...) v2vCmd.Stdout = os.Stdout