Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

KVM - Moving Guest To New Host - Cannot fix IP in Host

$
0
0
Hi All,

i am trying to move a VM from one host to another - this is just a test for now, to make sure I know how to do it later when required.

I have successfully moved the guest VHD (qcow2) over, and exported and imported the XML, so the VM appears on the new host, and boots up fine.

It gets an IP address (using DHCP).

However, when I try to fix its IP using the hosts 'default' network, I get the error:

Code:

error: XML error: Cannot use host name 'VM_Name' in network 'default'
where VM_Name is the hostname of the VM.

I am trying to do this, by running:

Code:

virsh net-edit default
The following is what appears in the editor (prior to me editing):

Code:

<network>
  <name>default</name>
  <uuid>92dfe069-1308-4029-8177-1259cd80c444</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:e3:4a:cf'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.200' end='192.168.122.249'/>
      <host mac='52:54:00:2a:b6:67' name='ZZ-Test-Debian-12-5-0-20240414' ip='192.168.122.179'/>
    </dhcp>
  </ip>
</network>

The 'ZZ-Test-Debian' VM is one I created in the new host after setting it up, and it works fine, along with getting its fixed IP as shown.

When I try to add this line (immediately below the one for the ZZ-Test-Debian guest):

Code:

<host mac='52:54:00:a3:ce:8c' name='VM_Name' ip='192.168.122.24'/>
when I write the change, and exit the editor, I then get the error as above:

Code:

error: XML error: Cannot use host name 'VM_Name' in network 'default'
Maybe I am missing something obvious, but the fixed IP (192.168.122.24) is outside the DHCP allocation range (192.168.122.200 to 192.168.122.249), the MAC address is correct, and changing the hostname does not seem to make any difference.

My guess is that something that came over from the source host / XML definition file, is causing the problem, but I am not sure what.

Any suggestions are welcome :-)

Thanks,

Alan.

Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>