天天看點

CloudStack運維經驗分享CloudStack運維經驗分享

CloudStack運維經驗分享

如何登陸系統虛拟機

系統虛拟機預設密碼:root/6m1ll10n

無法上傳模闆

         在GlobalSetting中,将secstorage.allowed.internal.sites中添加上傳模闆所在機器的CIDR,比如上傳模闆機器的IP為10.4.45.36,則填入10.4.45.36/32,重新開機CloudStack。

         由于CS隻支援HTTP方式的上傳,需要在上傳模闆的機器安裝HFS,然後添加需要上傳的模闆,将通路的URL在浏覽器中輸入,如果從浏覽器中可以下載下傳,表明URL是可用的。

虛拟機删除以後依然存在

        CloudStack中為了防止虛拟機誤删,預設在删除後儲存一天,即86400s。在GlobalSetting中,将expunge.delay修改為想要儲存的時間,如果不考慮誤删,想即刻删除,隻要将expunge.delay設定為1即可。

出錯後如何檢視日志

         # vi/var/log/management/

CloudStack建立主存儲失敗(SR已經被使用)

         建立主存儲時,可能會發生建立存儲pool失敗(SR已經被使用,重裝CloudStackmanagement後可能發生此問題),錯誤提示如下:

 Can not create storage pool through host 1 due to CatchExceptioncom.cloud.utils.exception.CloudRuntimeException, createStoragePool failed due tocom.cloud.utils.exception.CloudRuntimeException: There is a SRusing the same configuration server:10.217.5.192,serverpath:/home/export/primary for poolc9c0319f-33f0-3494-9ada-4d7a2f1dafd4onhost:09b3515e-447e-406f-869a-239386d5fe90 onhost:09b3515e-447e-406f-869a-239386d5fe90 pool:10.217.5.192/home/export/primary

失敗原因通常是因為已經在host裡建立過CS,到重裝之前UUID為09b3515e-447e-406f-869a-239386d5fe90的host裡删除c9c0319f-33f0-3494-9ada-4d7a2f1dafd4的SR,然後再建立主存儲就沒有問題了。

CloudStack建立系統虛拟機無法啟動

異常資訊如下:

2013-07-08 14:57:45,079 WARN [xen.resource.CitrixResourceBase] (DirectAgent-492:null)destoryVDIbyNameLabel failed due to there are 0 VDIs with namecloud-5b2d9320-4eee-460b-bda2-91d4041d1e48

2013-07-08 14:57:45,079 WARN [xen.resource.CitrixResourceBase] (DirectAgent-492:null) cannot create vdi in sr 247648b0-f39b-340d-d9f0-142d36ae167f

2013-07-08 14:57:45,079 WARN [xen.resource.CitrixResourceBase] (DirectAgent-492:null)Catch Exception com.cloud.utils.exception.CloudRuntimeException onhost:722ecf1e-53ea-4f04-a83c-1d798cd77de7 for template:nfs://10.4.55.227/export/secondary/template/tmpl/1/1/ due tocom.cloud.utils.exception.CloudRuntimeException: can not create vdiin sr 247648b0-f39b-340d-d9f0-142d36ae167f

com.cloud.utils.exception.CloudRuntimeException: can not createvdi in sr 247648b0-f39b-340d-d9f0-142d36ae167f

解決方案:

If the Management Server is RHEL or CentOS, copy vhd-util to/usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver.

If the Management Server is Ubuntu, copy vhd-util to/usr/lib/cloud/common/scripts/vm/hypervisor/xenserver.  

如果已經copy了,将vhd-util  copy到xenserver主機的/opt/xensource/bin/中

如何自動在一級存儲裡清理未使用的模闆

storage.cleanup.enabled Enables/disables thestorage cleanup thread. true
storage.cleanup.interval        The interval (in seconds) to wait before running the storagecleanupthread.          86400
storage.template.cleanup.enabled Enable/disable template cleanup activity, only take effect whenoverall storage cleanup is enabled true

代碼中對應StorageManagerImpl中的StorageGarbageCollector

CloudStack是預設每隔24小時将未使用的模闆删除,

未使用的意思就是說目前沒有運作的虛拟機是基于此模闆建立的,隻要有運作的虛拟機是基于此模闆建立的就不會删除,

如果虛拟機解除安裝後,此模闆沒有對應的虛拟機了,那麼過24小時就會删除。

系統虛拟機異常

有時經常出現二級存儲或者控制台莫名其妙無法使用,并且并沒有進行什麼操作,重新開機系統虛拟機也無法使用,這個應該是CloudStack的BUG,執行如下腳本重新開機系統虛拟機即可使用

nohup cloudstack-sysvmadm -d localhost -u cloud -p root -a >sysvm.log 2>&1 &

-d 資料庫使用者名

-p 資料庫密碼

轉載位址:http://www.server110.com/cloudstack/201403/7647.html

繼續閱讀