計算節點中無報錯無法同步resource provider
報錯信息為
2019-05-05 10:21:24.738 28481 WARNING nova.scheduler.client.report [req-8745f172-a018-403d-8519-4146e856abe1 - - - - -] Unable to refresh my resource provider record
2019-05-05 10:22:26.392 28481 INFO nova.scheduler.client.report [req-8745f172-a018-403d-8519-4146e856abe1 - - - - -] [req-a1784036-3080-4495-be08-4b8fa289db09] Another thread already created a resource provider with the UUID 29a49143-2efd-4881-90c7-ea95fc346d75. Grabbing that record from the placement API.
原因是部署完計算節點並同步數據庫以后,修改過計算節點的主機名或者刪除過nova service里的compute服務,重新同步以后服務能啟動但是日志會報此種錯誤 導致無法進行虛機熱遷移等錯誤;遷移時無法找到可用宿主機
解決辦法 :
進入數據庫
use nova_api;
select * from resource_providers where name like 'pc-zjhazrapp22.zj.chinamobile.com'; (pc-zjhazrapp22.zj.chinamobile.com 此處替換為計算節點宿主機名稱)
執行后會得到一個uuid 為現在使用的resource_provider id 一定和日志里報的不一致;
use nova;
select deleted_at,host from compute_nodes where uuid='29a49143-2efd-4881-90c7-ea95fc346d75'; (此處uuid為上面日志中報出來的uuid)
執行命令后,顯示為空 證明現在使用的uuid沒有關聯可用宿主機
確認以上情況后,執行修改命令解決問題