Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9167683
  • 博文数量: 1669
  • 博客积分: 16831
  • 博客等级: 上将
  • 技术积分: 12594
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 07:23
个人简介

柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!

文章分类

全部博文(1669)

文章存档

2023年(4)

2022年(1)

2021年(10)

2020年(24)

2019年(4)

2018年(19)

2017年(66)

2016年(60)

2015年(49)

2014年(201)

2013年(221)

2012年(638)

2011年(372)

分类: 云计算

2014-06-09 09:40:42

CloudStack运维经验分享

时间:2014-03-11    来源:服务器之家    投稿:root    点击:96
如何登陆系统虚拟机

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

无法上传模板

         在Global Setting中,将secstorage.allowed.internal.sites中添加上传模板所在机器的CIDR,比如上传模板机器的IP为10.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,到重装之前UUID为09b3515e-447e-406f-869a-239386d5fe90的host里删除c9c0319f-33f0-3494-9ada-4d7a2f1dafd4的SR,然后再创建主存储就没有问题了。

CloudStack创建系统虚拟机无法启动

异常信息如下:

2013-07-08 14:57:45,079 WARN  [.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 数据库密码

阅读(687) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~