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

Error: couldn't retrieve IP address of domain #149

Closed
MarkYSA opened this issue Jun 24, 2023 · 4 comments · Fixed by #150
Closed

Error: couldn't retrieve IP address of domain #149

MarkYSA opened this issue Jun 24, 2023 · 4 comments · Fixed by #150
Labels
bug Something isn't working

Comments

@MarkYSA
Copy link

MarkYSA commented Jun 24, 2023

Hi,

I'm using default NAT sample config and receive such error during setup


│ Error: couldn't retrieve IP address of domain id: 02bcae0c-2ceb-4658-aa88-36746361bd65. Please check following:
│ 1) is the domain running proplerly?
│ 2) has the network interface an IP address?
│ 3) Networking issues on your libvirt setup?
│ 4) is DHCP enabled on this Domain's network?
│ 5) if you use bridge network, the domain should have the pkg qemu-agent installed
│ IMPORTANT: This error is not a terraform libvirt-provider error, but an error caused by your KVM/libvirt infrastructure configuration/setup
│ timeout while waiting for state to become 'all-addresses-obtained' (last state: 'waiting-addresses', timeout: 5m0s)

│ with module.host_localhost.module.master_module["1"].libvirt_domain.vm_domain,
│ on modules/vm/vm.tf line 72, in resource "libvirt_domain" "vm_domain":
│ 72: resource "libvirt_domain" "vm_domain" {



│ Error: terraform apply failed: exit status 1

But host is accessible via IP:

root@###:~/kubitect# ping 192.168.113.10
PING 192.168.113.10 (192.168.113.10) 56(84) bytes of data.
64 bytes from 192.168.113.10: icmp_seq=1 ttl=64 time=0.301 ms

I have Debian 12

@MusicDin
Copy link
Owner

Hi @MarkYSA,

that is really odd. I was not able to reproduce the issue, but ran into the similar issue with CentOS Stream 9. Could you please provide the Kubitect config file?

@MusicDin MusicDin added the need info This issue requires more info label Jun 26, 2023
@MarkYSA
Copy link
Author

MarkYSA commented Jun 27, 2023

@MusicDin Thank you for you reply!

Sure, here is it:

hosts:
  - name: localhost
    connection:
      type: local

cluster:
  name: k8s-cluster
  network:
    mode: nat
    cidr: 192.168.113.0/24
    dhcp:
      enabled: false
  nodeTemplate:
    user: k8s
    updateOnBoot: false
    ssh:
      addToKnownHosts: true
    os:
      distro: ubuntu22
  nodes:
    master:
      default:
        ram: 6
        cpu: 4
        mainDiskSize: 20
      instances:
        - id: 1
          ip: 192.168.113.10

kubernetes:
  version: v1.26.6
  networkPlugin: calico

Also I noticed that command virsh net-dhcp-leases k8s-cluster-network returns nothing. Looks like VM does not received IP from dhcp server. Maybe some misconfiguration in terraform on new libvirt (I mean on new OSs)?

@MusicDin
Copy link
Owner

MusicDin commented Jun 27, 2023

Hi @MarkYSA, thanks for providing the configuration file.

I can confirm that when static IP addresses are set in NAT mode, libvirt does not register them, which causes the above issue.

@MusicDin MusicDin added bug Something isn't working and removed need info This issue requires more info labels Jun 27, 2023
@MusicDin
Copy link
Owner

MusicDin commented Jun 30, 2023

Hi @MarkYSA,

This has been fixed in v3.2.1. Let me know if you encounter any other issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants