CloudStack SSVM啟動條件源碼閱讀與問題解決方法:
在CloudStack建立zone的時候,經常遇到SSVM不啟動,或者根本就沒有SSVM的情況,分析CloudStack日志,會發現有“Zone 1 is not ready to launch secondary storage VM yet”打印,意思是zone還未準備好啟動SSVM。
通過查詢CloudStack源代碼,發現啟動SSVM前有如下檢查:
獲取Zone里的template。
select a.* from vm_template a, host h where h.type = 'Routing' and h.data_center_id = 1 and a.type = 'System' and a.hypervisor_type = h.hypervisor_type limit 1;
如果沒有獲取到,會打印如下警告:
Warn: Zone host is ready, but secondary storage vm template 3 is not ready on secondary storage: 1
解決辦法:檢查system template是否已經下載完成(注意,要下載自己環境的hypervisor的system template)。
獲取zone的二級存儲。
select * from host where type = 'SecondaryStorage' and data_center_id = 1; # host id is 3
如果沒有獲取到,會打印如下警告:
Warn: No secondary storage available in zone 1, wait until it is ready to launch secondary storage vm
解決辦法:為zone 1建立secondary storage pool。
獲取template和host的關聯。
select * from template_host_ref where host_id = 3 and template_id = 1 and download_state = 'DOWNLOADED'; # host id and template id is query by before.
如果沒有獲取到,會打印如下警告:
Warn: Zone host is ready, but secondary storage vm template 3 is not ready on secondary storage: 1
如果secondary storage是NFS,可以通過mount來檢查secondary storage是否能夠正常工作,如果secondary storage沒有問題,則只能等待CloudStack自動關聯上。
獲得host的主存儲。
SELECT p.data_center_id, count(ph.host_id) count FROM storage_pool p, storage_pool_host_ref ph WHERE p.id = ph.pool_id AND p.data_center_id = 1 GROUP by p.data_center_id;
主存儲數量需要大于0,如果等于0,會打印如下警告:
Warn: Primary storage is not ready, wait until it is ready to launch secondary storage vm
沒有問題后,CS會打?。篫one 1 is ready to launch secondary storage VM。 CS將會啟動 start secondary storage VM工作。
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
新聞熱點
疑難解答
圖片精選