CloudStack运维经验(不断更新)

如何登陆系统虚拟机

系统虚拟机默认密码:root/6m1ll10n


无法上传模板

         Global Setting中,将secstorage.allowed.internal.sites中添加上传模板所在机器的CIDR,比如上传模板机器的IP10.4.45.36,则填入10.4.45.36/32,重启CloudStack

         由于CS只支持HTTP方式的上传,需要在上传模板的机器安装HFS,然后添加需要上传的模板,将访问的URL在浏览器中输入,如果从浏览器中可以下载,表明URL是可用的。


虚拟机删除以后依然存在

         CloudStack中为了防止虚拟机误删,默认在删除后保存一天,即86400s。在Global Setting中,将expunge.delay修改为想要保存的时间,如果不考虑误删,想即刻删除,只要将expunge.delay设置为1即可。

 

出错后如何查看日志

         # vi /var/log/management/


CloudStack创建主存储失败(SR已经被使用)

         创建主存储时,可能会发生创建存储pool失败(SR已经被使用,重装CloudStack management后可能发生此问题),错误提示如下:
 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

失败原因通常是因为已经在host里创建过CS,到重装之前UUID09b3515e-447e-406f-869a-239386d5fe90host里删除c9c0319f-33f0-3494-9ada-4d7a2f1dafd4SR,然后再创建主存储就没有问题了。


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.enabled Enables/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.enabled Enable/disable template cleanup activity, only take effect when overall 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 数据库密码
 

你可能感兴趣的:(CloudStack)