CloudStack创建主存储失败(SR已经被使用)
创建主存储时,可能会发生创建存储pool失败(SR已经被使用,重装CloudStackmanagement后可能发生此问题),错误提示如下:
Can not create storage pool through host 1 due to Catch Exception com.cloud.utils.exception.CloudRuntimeException, create StoragePool failed due to com.cloud.utils.exception.CloudRuntimeException: There is a SR using the same configuration server:10.217.5.192,serverpath:/home/export/primary for pool c9c0319f-33f0-3494-9ada-4d7a2f1dafd4on host:09b3515e-447e-406f-869a-239386d5fe90 on host:09b3515e-447e-406f-869a-239386d5fe90 pool: 10.217.5.192/home/export/primary
CloudStack创建系统虚拟机无法启动
异常信息如下:
2013-07-08 14:57:45,079 WARN [xen.resource.CitrixResourceBase] (DirectAgent-492:null) destoryVDIbyNameLabel failed due to there are 0 VDIs with name cloud-5b2d9320-4eee-460b-bda2-91d4041d1e48
2013-07-08 14:57:45,079 WARN [xen.resource.CitrixResourceBase] (DirectAgent-492:null) can not 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 on host:722ecf1e-53ea-4f04-a83c-1d798cd77de7 for template: nfs://10.4.55.227/export/secondary/template/tmpl/1/1/due to com.cloud.utils.exception.CloudRuntimeException: can not create vdi in sr 247648b0-f39b-340d-d9f0-142d36ae167f
com.cloud.utils.exception.CloudRuntimeException: can not create vdi 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.enabledEnables/disables the storage cleanup thread.true storage.cleanup.interval The interval (in seconds) to wait before running the storage cleanup thread. 86400 storage.template.cleanup.enabledEnable/disable template cleanup activity, only take effect when overall storage cleanup is enabledtrue
代码中对应StorageManagerImpl中的StorageGarbageCollector
CloudStack是默认每隔24小时将未使用的模板删除,未使用的意思就是说目前没有运行的虚拟机是基于此模板创建的,只要有运行的虚拟机是基于此模板创建的就不会删除,如果虚拟机卸载后,此模板没有对应的虚拟机了,那么过24小时就会删除。