Uploaded image for project: 'Migration Toolkit for Virtualization'
  1. Migration Toolkit for Virtualization
  2. MTV-2418

[2.7] Static route's gateway is passed as the default gateway during migration

XMLWordPrintable

    • Critical
    • Customer Reported

      Description of problem:

      Windows VM have a static route, configured as below:

      Persistent Routes:   
      Network Address      Netmask          Gateway Address      Metric
      192.168.1.0                255.255.255.0  10.74.239.4                90             <== static route
      0.0.0.0                        0.0.0.0               10.74.239.254          Default      <== default g/w

      With this conf, forklift inventory shows 2 gateway IP for the device:

       

          "guestIpStacks": [
            {
              "device": "0",
              "gateway": "10.74.239.254",    <== Default gateway
              "dns": [
                "fec0:0:0:ffff::1",
                "fec0:0:0:ffff::2",
                "fec0:0:0:ffff::3"
              ]
            },
            {
              "device": "0",
              "gateway": "10.74.239.4",    <== static route gateway
              "dns": [
                "fec0:0:0:ffff::1",
                "fec0:0:0:ffff::2",
                "fec0:0:0:ffff::3"
              ]
            },

       

      Following is the data from the VMware Mob, we have the destination n/w under "network", with default route marked as "0.0.0.0", but forklift is not considering this and marking both IP address as gateway IP of the interface.

      gateway NetIpRouteConfigInfoGateway
      Name Type Value
      device string "0"
      ipAddress string "10.74.239.254"
      network string "0.0.0.0"
      prefixLength int 0
      Name Type Value
      gateway NetIpRouteConfigInfoGateway
      Name Type Value
      device string "0"
      ipAddress string "10.74.239.4"
      network string "192.168.1.0"
      prefixLength int 24
       

      For retrieving the gateway IP and to pass it to v2v, the code iterates over GuestIpStacks [1], matching only on the "device" field. Since there are two gateway IPs, it ends up setting the last one in the list, ie 10.74.239.4 here as a gateway IP.

      10.74.239.4 is passed to the v2v:

       

      /usr/libexec/virt-v2v-in-place -v -x -i libvirtxml --root first --mac 00:50:56:86:8b:30:ip:10.74.234.211,10.74.239.4,21,fec0:0:0:ffff::1,fec0:0:0:ffff::2,fec0:0:0:ffff::3 /mnt/v2v/input.xml

       

      v2v logs:

       

      Running the virt-v2v-inspector with args:  [-v -x -if raw -i disk -O /var/tmp/v2v/inspection.xml --root first --mac 00:50:56:86:8b:30:ip:10.74.234.211,10.74.239.4,21,fec0:0:0:ffff::1,fec0:0:0:ffff::2,fec0:0:0:ffff::3 /var/tmp/v2v/nijin-win-2019-sda]

       

      ipconfig o/p after migration

       

      Ethernet adapter Ethernet Instance 0:
      Connection-specific DNS Suffix . :
      IPv6 Address. . :2620:52:0:4a80:aa40:bef9:736a:89cc
      Link-local IPv6 Address . . .: fe80::2904:e3dc:42b1:f62f%5
      IPv4 Address....... ... : 10.74.234.211
      Subnet Mask . .:255.255.248.0
      Default Gateway. ........ : fe80::96f7:ad00:968e:fc40%5
                                  fe80::200:5eff: fe00:201%5
                                  10.74.239.4                 <===
      

       

      Version-Release number of selected component (if applicable):

      Migration Toolkit for Virtualization Operator   2.8.1

      How reproducible:

      Always 
      

      Steps to Reproduce:

      1. Created a static route on the VM:
      
      route -p ADD 192.168.1.0 MASK 255.255.255.0 10.74.239.4 METRIC 90
      
      2. Restart the VM, check in the forklift inventory if it's now showing both the gateway IP address.
      
      3. Migrate this VM to OpenShift Virtualization. Ensure that "preserve static ip" option is enabled.
      
      4. After migration, check the default gateway of the VM, it will be the static route gateway. 

      Actual results:

      Static route gateway is passed as default gateway while doing migration

      Expected results:

      Correct default gateway should be configured on the VM.

       [1]https://github.com/kubev2v/forklift/blob/461e2c0d0c7a9415496e3575fc4a7afc99e206f8/pkg/controller/plan/adapter/vsphere/builder.go#L281  

      Additional info:

       

        1. image-2025-04-23-19-25-13-436.png
          30 kB
          Martin Necas
        2. image-2025-04-23-19-17-40-751.png
          61 kB
          Martin Necas
        3. image-2025-04-23-19-16-06-886.png
          29 kB
          Martin Necas
        4. image-2025-04-23-19-07-50-108.png
          7 kB
          Martin Necas
        5. image-2025-04-23-19-02-59-254.png
          23 kB
          Martin Necas
        6. image-2025-04-23-19-01-04-857.png
          5 kB
          Martin Necas
        7. image-2025-04-23-19-00-33-174.png
          7 kB
          Martin Necas
        8. image-2025-04-23-18-59-04-567.png
          14 kB
          Martin Necas
        9. image-2025-04-23-18-50-26-558.png
          6 kB
          Martin Necas
        10. image-2025-04-23-18-48-57-646.png
          7 kB
          Martin Necas
        11. image-2025-04-23-18-46-03-030.png
          5 kB
          Martin Necas
        12. image-2025-04-23-18-45-05-943.png
          10 kB
          Martin Necas
        13. image-2025-04-23-18-20-40-967.png
          6 kB
          Martin Necas
        14. image-2025-04-23-18-20-04-191.png
          8 kB
          Martin Necas

              yzamir@redhat.com Yaacov Zamir
              rhn-support-nashok Nijin Ashok
              Chenli Hu Chenli Hu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: