Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-20810

Nova service deletion succeeds despite existing instances, causing "Duplicate entry" error on redeployment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Undefined Undefined
    • None
    • rhos-18.0.10 FR 3
    • openstack-nova
    • None
    • True
    • Hide

      I cannot reproduce.

      Show
      I cannot reproduce.
    • False
    • ?
    • rhos-workloads-compute
    • None
    • Moderate

      When removing and then redeploying a compute node, the process fails due to a pymysql.err.IntegrityError: (1062, "Duplicate entry ...") in the Nova database.

      This issue occurs because the nova-compute service deletion succeeds even when there are instances still present on the host. The service deletion API call removes the host mapping and the service and resource provider records from Placement, but it does not delete the compute_node object from the database. This leaves an orphaned compute_nodes record.

      When the compute node is subsequently reprovisioned, Nova attempts to create a new compute_nodes record, which conflicts with the orphaned record and violates the database's unique constraint, leading to the "Duplicate entry" error.

      To Reproduce Steps to reproduce the behavior:

      1. Deploy a compute node and launch an instance on it.
      2. Disable and delete the nova-compute service for that node.
      3. Observe that the service deletion succeeds, despite the presence of an instance.
      4. Attempt to redeploy the same compute node.

      Expected behavior

      Screenshots

      •  

      Device Info (please complete the following information):

        •  

      Bug impact

      • This is a bug in the service deletion logic. The check for existing instances is not functioning as expected, which leads to an inconsistent state in the Nova database and prevents the successful redeployment of compute nodes. This creates a significant operational issue for anyone needing to perform maintenance or hardware replacement on compute nodes.

      Known workaround

      • Manually delete the orphaned compute_nodes record from the database?

      Additional context

      • <your text here>
      • ...

              rh-ee-bgibizer Balazs Gibizer
              bdobreli@redhat.com Bohdan Dobrelia
              rhos-workloads-compute
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: