Bug 1927785

Summary: Network mapping should be validated before migration
Product: Migration Toolkit for Virtualization Reporter: Ilanit Stein <istein>
Component: GeneralAssignee: Jeff Ortel <jortel>
Status: CLOSED ERRATA QA Contact: Maayan Hadasi <mguetta>
Severity: medium Docs Contact: Avital Pinnick <apinnick>
Priority: medium    
Version: 2.0.0CC: fdupont, mguetta
Target Milestone: ---Keywords: FutureFeature
Target Release: 2.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-10 17:11:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ilanit Stein 2021-02-11 14:12:54 UTC
Description of problem:
Migration should fail for a Migration plan that was set via API with 
"wrong network mapping":
1. No network mapping section
2. Source network doesn't exist.
3. Source network exist on the VMware, but is not the network the migrated VM is attached to.

Comment 1 Fabien Dupont 2021-04-07 11:26:15 UTC
I think that cases 2 and 3 are not issues :

2. The mapping can cover network that don't exist and it will not fail the migration, since no VM is attached to a non existing network.
3. The mapping can cover more networks than is needed. The extra mapping won't be used during the migration. And another plan can use the same mapping, with VMs connected to the "extra" networks.

In case #1, there's already a validation and the "map" attribute is required. Moving to ON_QA to verify that.

Comment 2 Maayan Hadasi 2021-04-20 09:47:58 UTC
Verified as fixed
MTV version: 2.0.0-17 / iib:66911


$ cat << EOF | oc apply -f -
> ---
> apiVersion: forklift.konveyor.io/v1alpha1
> kind: Plan
> metadata: 
>   name: plan-no-network
>   namespace: openshift-rhmtv
> spec:
>   map:
>     storage: 
>       name: iscsi-nfs
>       namespace: openshift-rhmtv
>   provider: 
>     destination: 
>       name: host
>       namespace: openshift-rhmtv
>     source: 
>       name: node-05
>       namespace: openshift-rhmtv
>   targetNamespace: openshift-rhmtv
>   vms: 
>     - id: vm-715
> EOF
The Plan "plan-no-network" is invalid: spec.map.network: Required value

Comment 5 errata-xmlrpc 2021-06-10 17:11:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (MTV 2.0.0 images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2021:2381