OpenStack 無法新增、刪除實例,instance-XXXXXXXX could not be found
今日回來看機器時,發現沒有辦法新增實例了,透過WEB儀表板得知,我昨天新增的一個實例竟然還在"建造"當中,整個心是涼掉了一半......
(突然想到,昨天離開機器時之前,新建了幾個虛擬機器,該不會是因為參數設錯,所以沒等它創建完畢便直接下刪除指令有關吧......)
輸入指令:
# euca-describe-availability-zones verbose
回報:
AVAILABILITYZONE nova available
AVAILABILITYZONE |- OpenStackServer1
AVAILABILITYZONE | |- nova-consoleauth enabled :-) 2012-06-21 10:30:49
AVAILABILITYZONE | |- nova-compute enabled XXX 2012-06-21 10:30:45
AVAILABILITYZONE | |- nova-scheduler enabled :-) 2012-06-21 10:30:44
AVAILABILITYZONE | |- nova-network enabled :-) 2012-06-21 10:30:44
AVAILABILITYZONE | |- nova-cert enabled :-) 2012-06-21 10:30:50
.
.
.
.
發現 nova-compute 沒有順利運行,於是按照過往經驗,想說重啟 NTP也許就會自己修的好,便輸入指令:
# sudo /etc/init.d/ntp restart
接著重啟 NOVA各組件,靜待個幾秒鐘,再回頭看各組件狀態........
唉,nova-compute還是一樣 XXX,WEB瀏覽器裡,出問題的 instance依舊是建造中,就算透過WEB,選擇了刪除也沒用,透過 EUCA指令下達刪除命令也沒用,無奈之下只好去看LOG檔。
# nano /var/log/nova/nova-compute.log
發現了警告訊息:
.
.
.
.
2012-06-21 17:29:48 WARNING nova.compute.manager [req-68187ebd-4888-4806-905a-bc6bcc8ac461 None None] trying to reboot a non-running instance: 590be2d7-df10-45ee-a56c-1085aa696b5f (state: 8 expected: 1)
2012-06-21 17:29:48 INFO nova.virt.libvirt.connection [-] [instance: 3ad7fb88-0bf7-4614-8243-8dd1bbc8022d] Instance running successfully.
2012-06-21 17:29:49 CRITICAL nova [-] Instance instance-00000015 could not be found.
.
.
.
.
重新啟動機器後,再試了幾個辦法,依舊不行,無奈之下只好GOOGLE了。
然後發現沒有一個人的問題是跟我的狀況一樣的阿!!!!!!!!!!!!!!!!!!!!!!!
但至少我得知了 nova-compute 會啟不來,是因為有實例狀態處在不穩定的狀況下。
最後找到國外有人直接修改 MYSQL 資料庫,把錯誤的狀態修復回來(或是說,讓OPENSTACK以為系統已經正常了),讓系統繼續正常運行。
===============================
I remember having a similar problem not long ago. You don't need to delete the entry from the "instance" table, just set "deleted=1" in this entry:
update instance set deleted=1 where id=XXX;
With XXX being the id of the entry you want to change.
That is just my "quick&dirty" solution, I'm not sure whether that's all nova changes in the db when it deletes an instance. For example I noticed that if you're instance had a floating ip you'll also need to modify that entry, so that the floating ip is available once more.
========= https://answers.launchpad.net/nova/+question/196822
於是我登入 PHPMYADMIN,選擇 NOVA 資料庫,修改 interface 資料表,搜尋出狀況的實例名稱,把不正常的欄位內容,都比照已刪除的欄位內容修改,最後儲存。(先前實例占用的浮動IP也要檢查一下:資料表 fixed_ips )
此時回到 WEB儀表版,已沒有刪不掉的實例了,實例的新增、刪除也皆以正常!
但此方法應該只是權宜之計,究竟那還在刪除的實例仍存在嗎?是的話又該如何解決呢?
留言
張貼留言