airshipit / treasuremap

Reference Airship manifests, CICD, and reference architecture.
http://openstack.org
Apache License 2.0
52 stars 39 forks source link

shipyard Redeploy Server is not cleaning old server details. #203

Closed nagajagan closed 2 years ago

nagajagan commented 2 years ago

Describe the bug Openstack compute node was deleted and redeployed with same hostname using shipyard redeploy server command. VM creation on the compute host failed. This issues didn't occur for all the computes redeployed but 1 out of 3.

Steps To Reproduce Redeploy a server (openstack compute) using shipyard redeploy server and try to bring up a VM on the compute.

Expected behavior Server should be redeployed and should be able to host VMs

Environment

Actual Behavior While creating a VM the compute "No valid host was found" error, nova scheduler failed to find the hostname due to improper DB cleanup in msql old data are not removed and updated with new resources provider id.

Work Around Login to Maria DB server:

  1. mysql -u root -p
  2. use nova;
  3. select id,created_at,deleted_at,uuid,host from compute_nodes; # find the duplicate id,uuid which is deleted compute
  4. select * from pci_devices where id=10;
  5. delete from pci_devices where id=10
  6. delete from compute_nodes where uuid='2bef4b2d-2056-4209-b355-844620d9a457'
  7. use nova_api;
  8. select * from resource_provider; Note: update the "set uuid" from the nova compute_nodes table for newly created compute node UUID, "where name and uuid" check and update from nova_api resource_provider table.
  9. update resource_providers set uuid='f34dfde2-bb5d-41a5-9467-96fac00e5f22' where name='ngxpr002c003.att-ngxp.bete.ericy.com' and uuid='ce55a771-ef3b-4b3e-8169-da19a849b3c8';
nagajagan commented 2 years ago

This issue is addressed by cleaning up the database as mentioned above.