首页 > 其他 > 详细

一键重置cloudstack 环境

时间:2014-01-24 03:25:41      阅读:552      评论:0      收藏:0      [点我收藏+]

步骤一:登录cloudstack服务

步骤二:新建cloudclean.sh 并添加如下内容,注意红色部分要根据你自己的部署环境做修改

#stop server
service cloudstack-management stop
service cloudstack-agent stop
#clean database
mysql -uroot -ppassword -e "drop database cloud;drop database cloud_usage;drop database cloudbridge;"
cloudstack-setup-databases cloud:password@localhost --deploy-as=root:passowrd
#clean storage
mkdir /mnt/primary -p
mount -t nfs localhost:/storage/primary /mnt/primary
rm -rf /mnt/primary/*
umount /mnt/primary
mkdir /mnt/secondary -p
mount -t nfs localhost:/storage/secondary /mnt/secondary
rm -rf /mnt/secondary/*
umount /mnt/secondary
#set template
mount -t nfs localhost:/storage/secondary /mnt/secondary
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary-f /root/systemvmtemplate-2013-07-12-master-xen.vhd.bz2  -h xenserver
umount /mnt/secondary
#start service
service cloudstack-management start
service cloudstack-agent start
#clean log
rm -f /var/log/cloudstack/management/*2014-*
echo ‘--------done-----------‘

步骤三:为文件赋权   chmod +x cloudclean.sh

步骤四: 执行  ./cloudclean.sh

往后每次要重置cloudstack 执行cloudclean.sh文件就可以了

一键重置cloudstack 环境

原文:http://blog.csdn.net/steelychen/article/details/18705753

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!