安装 webvirtmgr
Github 地址:https://github.com/retspen/webvirtmgr
1 配置 aliyun 仓库
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
2 安装依赖包
yum -y install git gcc python-devel python-pip libvirt-python libxml2-python python-websockify supervisor
3 安装 python 依赖库和 Django 环境
pip install numpy -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
PS: 这里会报错提示使用 Python >= 3.7,但是 Python3 执行后面的 manage.py 脚本时,又会报错。忽略此报错,就使用 Python2 也可以正常使用。
git clone git://github.com/retspen/webvirtmgr.git
cd webvirtmgr
pip install -r requirements.txt -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
4 初始化数据脚本
[root@webvirtmgr webvirtmgr]# ./manage.py syncdb
WARNING:root:No local_settings file found.
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table servers_compute
Creating table instance_instance
Creating table create_flavor
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: admin@admin.com
Password:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 6 object(s) from 1 fixture(s)