Skip to content

Commit

Permalink
MTV-1555 | Fix virt-v2v with new name
Browse files Browse the repository at this point in the history
Issue:
The MTV specifies the `-on` argument in the wrong place
/usr/bin/virt-v2v [...] -- epassaroMigrate-2 -on epassaromigrate-2

Fix:
/usr/bin/virt-v2v [...] -on newname -- oldname

Signed-off-by: Martin Necas <[email protected]>
  • Loading branch information
mnecas committed Oct 4, 2024
1 parent e3dbc9a commit bd1606b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions virt-v2v/cmd/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ func virtV2vBuildCommand() (args []string, err error) {
args = append(args, "-i", "ova", os.Getenv("V2V_diskPath"))
}

// When converting VM with name that do not meet DNS1123 RFC requirements,
// it should be changed to supported one to ensure the conversion does not fail.
if utils.CheckEnvVariablesSet("V2V_NewName") {
args = append(args, "-on", os.Getenv("V2V_NewName"))
}

return args, nil
}

Expand All @@ -158,6 +152,12 @@ func virtV2vVsphereArgs() (args []string, err error) {
)
}

// When converting VM with name that do not meet DNS1123 RFC requirements,
// it should be changed to supported one to ensure the conversion does not fail.
if utils.CheckEnvVariablesSet("V2V_NewName") {
args = append(args, "-on", os.Getenv("V2V_NewName"))
}

args = append(args, "--", os.Getenv("V2V_vmName"))
return args, nil
}
Expand Down

0 comments on commit bd1606b

Please sign in to comment.