kubevirt / kubevirt

Kubernetes Virtualization API and runtime in order to define and manage virtual machines.
https://kubevirt.io
Apache License 2.0
5.58k stars 1.33k forks source link

vms cannot obtain ip addr #12602

Open OAMchronicle opened 2 months ago

OAMchronicle commented 2 months ago

What happened: A clear and concise description of what the bug is. networks use default pod, interfaces mode use bridge. When I successfully created the VMs and then deleted and recreated them, the VMs could not obtain the IP address

What you expected to happen: A clear and concise description of what you expected to happen. When I delete and then recreate the VMs, I can obtain the IP address

How to reproduce it (as minimally and precisely as possible): Steps to reproduce the behavior.

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: debian-vm-2
spec:
  running: true
  template:
    metadata:
      labels:
        kubevirt.io/domain: debian-vm-2
    spec:
      domain:
        devices:
          disks:
            - name: containerdisk
              disk:
                bus: virtio
            - name: cloudinitdisk
              disk:
                bus: virtio
                  #            - name: vmboot
                  #              disk:
                  #                bus: scsi
                  #              shareable: true
          filesystems:
            - name: vmboot
              virtiofs: {}
          interfaces:
          - name: default
            bridge: {}
        resources:
          requests:
            cpu: 1
            memory: 2G
      networks:
      - name: default
        pod: {}
      volumes:
        - name: containerdisk
          persistentVolumeClaim:
            claimName: debian
        - name: vmboot
          persistentVolumeClaim:
            claimName: test-boot
        - name: cloudinitdisk
          cloudInitNoCloud:
            userData: |-
              #cloud-config
              ssh_pwauth: True
              chpasswd:
                expire: False
              users:
                - default
                - name: root
                  lock_passwd: false
                  hashed_passwd: $6$rounds=4096$RheREhE.SgLmJvHp$uy/ufIQWc39LDxDuaIOrRn6PDPrl5nnm5tWzQKqqBa7uEjX3WIzgqpB1l5McvJJoT9paSXJnGjugeypyxNUx30

After creating the VMs according to the above file, delete the VMs and then recreate them

Additional context: Add any other context about the problem here. kubevirt: 1.2.0 kubernetes: 1.27.16 cni:(I tried using both, but neither of them worked) calico: 3.25.0 cilium: 1.15.8

Environment:

OAMchronicle commented 2 months ago

https://github.com/kubevirt/kubevirt/issues/1646 I see similar problems, but they haven't really been solved. But it's manually set. This is not a reasonable solution