生产环境的 KVM 宿主机越来越多,需要对宿主机的状态进行调控。这里用 webvirtmgr 进行管理。图形化的 WEB,让人能更方便的查看 kvm 宿主机的情况和操作。
Install
安装支持的软件源
yum install -y epel-release
安装相关软件
yum -y install git python-pip libvirt-python libxml2-python python-websockify supervisor nginx
从 git-hub 中下载相关的 webvirtmgr 代码
cd /usr/local/src/
git clone git://github.com/retspen/webvirtmgr.git
安装 webvirtmgr
cd webvirtmgr/
pip install -r requirements.txt
安装数据库
yum install python-sqlite2
对 django 进行环境配置
./manage.py syncdb
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): admin
Email address: luchuanjia@msn.com
Password:*********
Password (again):*********
./manage.py collectstatic #生成配置文件
./manage.py createsuperuser #添加管理员账号
拷贝 web 到 相关目录
cd ..
rm -rf /var/www
mkdir -pv /var/www
cp -Rv webvirtmgr /var/www/webvirtmgr
设置 ssh
ssh-keygen
ssh-copy-id 192.168.2.32
ssh 192.168.2.32 -L localhost:8000:localhost:8000 -L localhost:6080:localhost:6080