Skip to content

Don't allow adding an existing KVM host to another zone #13080

@vishesh92

Description

@vishesh92

problem

Adding an existing KVM host in zone A to another Zone B is currently allowed.
When it is added, the zone for the host changes and the zone is updated for the host. The host goes into the Alert.
The existing VMs on Zone A are still running on this host and are displayed as such in the UI.

This shouldn't be allowed. We should fail the request to add host, if the host already exists in the database.

versions

4.20 with KVM. Probably present since the beginning.

The steps to reproduce the bug

  1. Setup a host in Zone A
  2. Add the existing host in Zone B

What to do about it?

Before adding a host, we should validate if the host already exists in the database with same hostname or IP address and throw an error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions