0

I've set up two libvirt nodes with the following hostnames:

  • mycompany-hv-01.example.tld
  • mycompany-hv-02.example.tld

The names are declared in a public DNS and resolvable (public IPs).

When I try to migrate a guest from one host to the other:

root@mycompany-hv-02:~# virsh migrate prout qemu+ssh://mycompany-hv-01.example.tld/system --offline --persistent
error: internal error: hostname on destination resolved to localhost, but migration requires an FQDN

The error is the same when I try a live migration.

I know this is not exactly the same error, but I tried the advices on this page. My DNS are already working, so I tried to force resolution by adding entries to my /etc/hosts on both hosts, but that doesn't work.

The following workaround works:

virsh migrate prout qemu+ssh://mycompany-hv-02.example.tld/system tcp://mycompany-hv-02.example.tld --offline --persistent

I tried to manually define migration_host in /etc/libvirt/qemu.conf but I got the error:

configuration file syntax error: migration_host must not be the address of the local machine: mycompany-hv-01.example.tld

Do I miss something?

1

configuration file syntax error: migration_host must not be the address of the local machine: mycompany-hv-01.example.tld

This means that libvirt tried to resolve "mycompany-hv-01.example.tld" and found that it resolves to 127.0.0.1

This is arguably a bug in libvirt, because only the migration source host needs to be able to resolve that address to a non-localhost IP address. It is fine if the host where you configured qemu.conf has it resolving to 127.0.0.1

  • Well, dig mycompany-hv-01.example.tld gives the public IP of the host, so I don't know why it says it resolves to 127.0.0.1 – Raspbeguy Jan 21 at 7:30
  • Most likely is that /etc/hosts on the host itself has a line mapping it to 127.0.0.1. IOW, other hosts would resolve to its public IP correctly, but this host would resolve to its own loopback addr. – DanielB Jan 21 at 9:50
  • You're right, I had the following line in my /etc/hosts : 127.0.1.1 mycompany-hv-01 mycompany-hv-01.example.tld on both hosts. But I commented it out, and it's still the same error (event after restarting libvirt). – Raspbeguy Jan 21 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.