Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network interface not UP after migration #1354

Open
cloudcafetech opened this issue Feb 15, 2025 · 5 comments
Open

Network interface not UP after migration #1354

cloudcafetech opened this issue Feb 15, 2025 · 5 comments

Comments

@cloudcafetech
Copy link

cloudcafetech commented Feb 15, 2025

I migrate Ubuntu VM from VMware to Kubevirt using forklift, migration went well but in kubevirt migrated VM network interface did not UP.

Source (Vmware) VM:

Image

Destination (Kubevirt) VM:

Image

Plan:

apiVersion: forklift.konveyor.io/v1beta1
kind: Plan
metadata:
  name: vm-mig-plan
  namespace: konveyor-forklift
spec:
  preserveStaticIPs: true
  archived: false
  description: ''
  map:
    network:
      name: vmware-network-map
      namespace: konveyor-forklift
    storage:
      name: vmware-storage-map
      namespace: konveyor-forklift
  provider:
    destination:
      name: host
      namespace: konveyor-forklift
    source:
      name: vsphere-provider
      namespace: konveyor-forklift
  targetNamespace: virtualmachines
  vms:
    - hooks: []
      name: vw-jumphost
  warm: false
@mnecas
Copy link
Member

mnecas commented Feb 17, 2025

Hi, seeing that the device name changed after migration, the netplan did not bring up the interface.
We do have a script to inject udev rules and rename the interface to the original name but it's focused on the static IPs.
Think we could reuse it for this case.

@cloudcafetech
Copy link
Author

cloudcafetech commented Feb 17, 2025

@mnecas Thanks for pointing me interface change.

script to inject udev rules and rename the interface to the original name

Can you please share script which will inject udev rules and rename the interface to the original name and how to use.

@mnecas
Copy link
Member

mnecas commented Mar 6, 2025

Sorry for the late response, you can find the script here https://github.com/kubev2v/forklift/blob/main/pkg/virt-v2v/customize/scripts/rhel/run/network_config_util.sh
We would need to run it even with DHCP I'll need to double-check if it would cause some problems.

@mnecas
Copy link
Member

mnecas commented Mar 6, 2025

Ah after reading the code, we do it also for the DHCP but that script is missing the cloud.cfg so all we need to do is to update the script to look at the cloud init configs and create the udev rules from it.

Scratch that ^. Not sure if this is possible because we can't map the devices without the static IPs. We could add the cloud init config with static IP but not sure about DHCP.

As workaround you could try to inject a udev rules yourself before the migration starts this way it will preserve the interface name after migration.
https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/consistent-network-interface-device-naming_configuring-and-managing-networking#network-interface-naming-schemes_consistent-network-interface-device-naming

@cloudcafetech
Copy link
Author

@mnecas Thanks.

Can you help me one more thing though its not V2V migration but its live migration inside cluster.

I am using Kubevirt along with Multus & whereabouts.

My network attachment definition as follows

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: bridge-whereabouts
  namespace: virtualmachines
spec:
  config: '{
      "cniVersion": "0.3.1",
      "name": "bridge-whereabouts",
      "type": "bridge",
      "bridge": "br0",
      "promiscMode": true,       
      "ipam": {
        "type": "whereabouts",
        "range": "192.168.0.0/24",
        "range_start": "192.168.0.20",
        "range_end": "192.168.0.50",
        "gateway": "192.168.0.1",
        "routes": [
          { "dst": "0.0.0.0/0" }
        ]
      }
    }'

After successful migration all good except IP change from 192.168.0.20 to 192.168.0.21

Image

I want keep same IP (192.168.0.20) when VM launch first time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants