Changing the IP Address of a Cloned Virtual Machine in oVirt

Cloning virtual machines is a common practice in virtualized environments. Administrators often create a clone of an existing server to speed up deployments, perform testing, or create development environments. However, one of the first issues encountered after cloning is network configuration.

When a cloned virtual machine starts with the same network settings as the original machine, IP conflicts can occur. This article explains how to properly assign a new IP address to a cloned virtual machine running in an oVirt environment.


Why IP Address Conflicts Occur After Cloning

When a virtual machine is cloned, the entire operating system is copied, including:

  • Network configuration files
  • Hostname settings
  • Static IP addresses
  • SSH keys
  • Application configurations

As a result, both the original VM and the cloned VM may attempt to use the same IP address on the network.

Typical symptoms include:

  • Network connectivity issues
  • Intermittent communication failures
  • Duplicate IP warnings
  • Inability to access one or both machines

Understanding oVirt Networking

oVirt manages virtual infrastructure, but the IP address itself is typically configured inside the guest operating system.

The virtualization platform provides:

  • Virtual network adapters
  • MAC addresses
  • Network attachment configuration

The operating system running inside the VM determines:

  • IP address
  • Gateway
  • DNS servers
  • Hostname

Therefore, changing the VM’s IP usually requires modifications inside the guest OS.


Step 1: Verify the Network Adapter

After cloning a VM:

  1. Open the oVirt Administration Portal.
  2. Navigate to the cloned virtual machine.
  3. Select Network Interfaces.
  4. Verify that:
    • The interface is connected.
    • A unique MAC address has been assigned.
    • The correct virtual network is selected.

Most cloning operations automatically generate a new MAC address, but it is worth verifying.


Step 2: Check the Current IP Address

Linux

ip addr show

or

ifconfig

Windows

Open Command Prompt:

ipconfig

If the IP address matches the original server, a change is required.


Step 3: Configure a New Static IP Address on Linux

Modern Linux Systems (NetworkManager)

List available connections:

nmcli connection show

Modify the IP address:

nmcli connection modify ens192 \
ipv4.addresses 192.168.1.50/24 \
ipv4.gateway 192.168.1.1 \
ipv4.method manual

Apply changes:

nmcli connection down ens192
nmcli connection up ens192

RHEL, Oracle Linux, Rocky Linux, AlmaLinux

Edit:

/etc/sysconfig/network-scripts/ifcfg-ens192

Example:

BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.50
PREFIX=24
GATEWAY=192.168.1.1
DNS1=8.8.8.8

Restart networking:

systemctl restart NetworkManager

Ubuntu Using Netplan

Edit:

/etc/netplan/01-netcfg.yaml

Example:

network:
  version: 2
  ethernets:
    ens160:
      dhcp4: no
      addresses:
        - 192.168.1.50/24
      gateway4: 192.168.1.1
      nameservers:
        addresses:
          - 8.8.8.8

Apply:

netplan apply

Step 4: Configure a New Static IP Address on Windows

  1. Open Control Panel
  2. Select Network and Internet
  3. Open Network and Sharing Center
  4. Click Change Adapter Settings
  5. Right-click the network adapter
  6. Select Properties
  7. Open Internet Protocol Version 4 (TCP/IPv4)
  8. Select:Use the following IP address
  9. Enter:
    • New IP Address
    • Subnet Mask
    • Default Gateway
    • DNS Servers
  10. Save the configuration.

Step 5: Update the Hostname

It is recommended to assign a unique hostname to the cloned server.

Linux

hostnamectl set-hostname server-clone

Verify:

hostnamectl

Windows

  1. Open System Properties
  2. Select Computer Name
  3. Click Change
  4. Enter a new hostname
  5. Restart the machine

Step 6: Verify Connectivity

After applying the new configuration:

Verify the IP:

ip addr

Test network connectivity:

ping 192.168.1.1

Test DNS:

ping google.com

Verify remote access:

ssh user@192.168.1.50

DHCP Alternative

If the environment uses DHCP, the cloned VM can automatically obtain a different IP address.

Linux:

dhclient -r
dhclient

Windows:

ipconfig /release
ipconfig /renew

The DHCP server will assign an available address from the configured pool.


Additional Considerations After Cloning

Besides changing the IP address, administrators should consider:

Regenerating SSH Keys

rm -f /etc/ssh/ssh_host_*
ssh-keygen -A

Updating DNS Records

Ensure DNS entries reflect the new hostname and IP address.

Updating Monitoring Systems

Add the new server to:

  • Monitoring platforms
  • Backup systems
  • Inventory tools
  • Configuration management platforms

Best Practices

  • Always assign a unique hostname after cloning.
  • Verify MAC addresses are unique.
  • Update static IP addresses before connecting the VM to production networks.
  • Document all cloned servers.
  • Test connectivity before handing the server over to users.

Conclusion

Cloning a virtual machine in oVirt significantly accelerates server deployment, but administrators must properly adjust network settings to avoid IP conflicts. The process typically involves assigning a new IP address, updating the hostname, verifying network connectivity, and ensuring supporting services such as DNS and monitoring systems are updated accordingly.

Following these steps ensures that cloned virtual machines operate independently and safely within the infrastructure.

 

This article is inspired by real-world challenges we tackle in our projects. If you're looking for expert solutions or need a team to bring your idea to life,

Let's talk!

    Please fill your details, and we will contact you back

      Please fill your details, and we will contact you back