Libvirt 遷移主機名

Libvirt 遷移主機名

我已經使用以下主機名稱設定了兩個 libvirt 節點:

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

這些名稱在公共 DNS 中宣告並可解析(公用 IP)。

當我嘗試將訪客從一台主機遷移到另一台主機時:

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

當我嘗試即時遷移時,錯誤是相同的。

我知道這不是完全相同的錯誤,但我嘗試了以下建議這一頁。我的 DNS 已經正常工作,因此我嘗試透過在/etc/hosts兩台主機上新增項目來強制解析,但這不起作用。

以下解決方法有效:

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

我嘗試手動定義migration_host/etc/libvirt/qemu.conf但出現錯誤:

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

我錯過了什麼嗎?

答案1

設定檔語法錯誤:migration_host 不能是本機的位址:mycompany-hv-01.example.tld

這意味著 libvirt 嘗試解析“mycompany-hv-01.example.tld”並發現它解析為 127.0.0.1

這可以說是 libvirt 中的一個錯誤,因為只有遷移來源主機需要能夠將該位址解析為非本機主機 IP 位址。如果您配置 qemu.conf 的主機將其解析為 127.0.0.1 就可以了

相關內容