We moved this page to our Documentation Portal. You can find the latest updates here. |
Issue
My virtual machine says that its IP address is already in use.
Environment
OnApp 5.x,6.x
IPv4
Resolution
You can track down which VM is using that IP address if you can find the MAC address of its NIC. This can be done by using arping
on the control panel server. For example:
arping -c 1 121.122.123.124
Then, you can login to the mysql database and use this query, replacing the MAC address with the one you found:
select * from virtual_machines where id in (select virtual_machine_id from network_interfaces where mac_address='00:16:3E:E3:B3:50');
This should return the virtual machine with that NIC. If that query does not return a helpful information for you, it is possible that the IP address was added manually, outside of the OnApp.
Additional Info
The table name changed in 5.4+, so you need to use networking_network_interfaces instead in those environments.
You can replace the ;
at the end MySQL queries with \G
to make larger tables more readable in console output.
The following query returns the IPs currently assigned to more than one virtual machine:
select id,inet_ntoa(address) as "Duplicated IPs",updated_at,user_id,hypervisor_id from ip_addresses where id in (select ip_address_id from ip_address_usages where virtual_machine_id is not null and unassigned_at is null group by ip_address_id having count(*) > 1);