WebVirtMgr 介绍

    WebVirtMgr采用几乎纯Python开发,其前端是基于Python的Django,后端是基于Libvirt的Python接口,将日常kvm的管理操作变的更加的可视化。

WebVirtMgr 特点

  • 操作简单,易于使用
  • 通过libvirt的API接口对kvm进行管理
  • 提供对虚拟机生命周期管理

WebVirtMgr 功能

宿主机管理支持以下功能

  • CPU利用率
  • 内存利用率
  • 网络资源池管理
  • 存储资源池管理
  • 虚拟机镜像
  • 虚拟机克隆
  • 快照管理
  • 日志管理
  • 虚机迁移

虚拟机管理支持以下功能

  • CPU利用率
  • 内存利用率
  • 光盘管理
  • 关/开/暂停虚拟机
  • 安装虚拟机
  • VNC console连接
  • 创建快照
 

WebVirtMgr 管理工具安装

一 webvirtmgr管理服务器配置

1 install  epel 源,git,gcc等软件
sudo yum -y install http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo yum -y install git python-pip libvirt-python libxml2-python python-websockify supervisor nginx
 
2 Install python requirements and setup Django environment
git clone git://github.com/retspen/webvirtmgr.git
cd webvirtmgr
sudo pip install -r requirements.txt
./manage.py syncdb
./manage.py collectstatic    ---配置数据库的账号
 
创建一个超级用户:
./manage.py createsuperuser   --配置webvirtmgr 登录账号
 
3 配置nginx
cd ..
sudo mv webvirtmgr /var/www/
 
在 /etc/nginx/conf.d/下 创建webvirtmgr.conf 文件:
 vim /etc/nginx/conf.d/webvirtmgr.conf
server {
    listen 80 default_server;
 
    server_name $hostname;
    #access_log /var/log/nginx/webvirtmgr_access_log; 
 
    location /static/ {
        root /var/www/webvirtmgr/webvirtmgr; # or /srv instead of /var
        expires max;
    }
 
    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_connect_timeout 600;
        proxy_read_timeout 600;
        proxy_send_timeout 600;
        client_max_body_size 1024M; # Set higher depending on your needs 
    }
}
 
在nginx主配置文件中的http域内添加下面的配置
sudo vim /etc/nginx/nginx.conf
include /etc/nginx/conf.d/*.conf;
 
将default.conf重命名
mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak
 
重启nginx:
sudo service nginx restart   或者    /etc/init.d/nginx restart
 
selinux 设置:
将selinux 关闭
setenforce 0
vim /etc/selinux/config 
SELINUX=disabled
 
或不关闭selinux但需添加下面的策略
/usr/sbin/setsebool httpd_can_network_connect true
4 配置 Supervisor 
sudo  chkconfig supervisord on
 
在/etc/supervisord.conf末尾加入下面的配置:
vim /etc/supervisord.conf
 
[program:webvirtmgr]
command=/usr/bin/python /var/www/webvirtmgr/manage.py run_gunicorn -c /var/www/webvirtmgr/conf/gunicorn.conf.py
directory=/var/www/webvirtmgr
autostart=true
autorestart=true
logfile=/var/log/supervisor/webvirtmgr.log
log_stderr=true
user=nginx
 
[program:webvirtmgr-console]
command=/usr/bin/python /var/www/webvirtmgr/console/webvirtmgr-console
directory=/var/www/webvirtmgr
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/webvirtmgr-console.log
redirect_stderr=true
user=nginx
 
重启supervisord
sudo service supervisord restart
 
--------到这里webvirtmgr配置完成-----
 

二 webvirtmgr服务器(服务端)与kvm服务器(客服端)连接配置

1)webvirtmgr与kvm之间使用ssh方式连接管理
 
1 在webvirtmgr服务器(服务端)上:
 cd /home/
 mkdir nginx
 chown nginx.nginx nginx/
 chmod 700 nginx/ -R
 su - nginx -s /bin/bash
ssh-keygen   ---期间输入yes后直接回车,回车
 touch ~/.ssh/config && echo -e "StrictHostKeyChecking=no\nUserKnownHostsFile=/dev/null" >> ~/.ssh/config
 chmod 0600 ~/.ssh/config
 
2 在kvm(客服端)服务器上配置webvirt用户
 useradd webvirtmgr
 echo "123456" | passwd --stdin webvirtmgr
groupadd libvirt
 usermod -G libvirt -a webvirtmgr
3 在webvirtmgr服务器(服务端)上,将ssh-key上传到kvm服务器上
su - nginx -s /bin/bash
ssh-copy-id   webvirtmgr@192.168.0.23
 
4 在kvm(客服端)服务器上配置 libvirt ssh授权
 
vim /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
[Remote libvirt SSH access]
Identity=unix-user:webvirtmgr
Action=org.libvirt.unix.manage
ResultAny=yes
ResultInactive=yes
ResultActive=yes
 
chown -R webvirtmgr.webvirtmgr /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
 
重启 libvirtd 服务
/etc/init.d/libvirtd restart
 
2)webvirtmgr与kvm之间使用tcp方式连接管理
1)Libvirtd服务监听配置
修改/etc/sysconfig/libvirtd文件,去掉下面一行的注释,使Libvirt服务处于监听状态:
vim /etc/sysconfig/libvirtd
LIBVIRTD_ARGS="--listen"
2)配置Libvirt服务
配置Libvirt服务,允许通过tcp方式通讯,修改/etc/libvirt/libvirtd.conf:
#允许tcp监听
listen_tcp = 1
#开放tcp端口
tcp_port = "16509"
#监听地址修改为0.0.0.0
listen_addr = "0.0.0.0"
#配置tcp通过sasl认证
auth_tcp = sasl
#取消CA认证功能
listen_tls = 0
启动服务:
service libvirtd start
3)创建libvirt管理用户
saslpasswd2 -a libvirt admin
 
--------------------------------------------------------------------------------
webvirtmgr使用手册请关注:KVM WEB管理工具—WebVirtMgr(二)日常配置

KVM web管理工具——WebVirtMgr(一)的更多相关文章

  1. 快速搭建 kvm web 管理工具 WebVirtMgr

    作者:SRE运维博客 博客地址: https://www.cnsre.cn/ 文章地址:https://www.cnsre.cn/posts/211117937177/ 相关话题:https://ww ...

  2. KVM WEB管理工具webvirtmgr安装和使用

    生产环境的KVM宿主机越来越多,需要对宿主机的状态进行调控.这里用webvirtmgr进行管理.图形化的WEB,让人能更方便的查看kvm 宿主机的情况和操作 1 安装支持的软件源 yum -y ins ...

  3. KVM WEB管理工具——WebVirtMgr(二)日常配置

    配置宿主机 1.登录WebVirtMgr管理平台 2.添加宿主机 选择首页的WebVirtMgr -->Addd Connection 选择“SSH链接“,设置Label,IP,用户 注意:La ...

  4. KVM web管理工具——WebVirtMgr

    系统环境: [root@kvm-admin ~]# cat /etc/redhat-release CentOS Linux release (Core) 关闭防火墙.selinux [root@kv ...

  5. KVM Web管理平台 WebVirtMgr

    WebVirtMgr介绍 WebVirtMgr是一个KVM管理平台,让kvm管理变得更为可视化,对中小型kvm应用场景带来了更多方便.WebVirtMgr采用几乎纯Python开发,其前端是基于Pyt ...

  6. 虚拟化技术之kvm WEB管理工具kimchi

    在前面的博客中,我们介绍了kvm的各种工具,有基于图形管理的virt-manager.有基于命令行管理的virt-install .qemu-kvm.virsh等等:今天我们来介绍一款基于web界面的 ...

  7. KVM网页管理工具WebVirtMgr部署

    KVM-WebVirtMgr 0ther https://github.com/retspen/webvirtmgr/wiki System Optimization(Only CentOS6.X) ...

  8. kvm-web管理工具webvirtmgr

    前言: 使用开源的虚拟化技术,对公司自有的少数服务器进行虚拟化,在满足业务需求的同时,并未增加投入,同时也避免了使用云主机的不便,技术层面,kvm是开源的虚拟化产品,虚拟化性能出众,更重要的是免费!! ...

  9. KVM管理工具 WebVirtMgr

    WEB管理工具 WebVirtMgr WebVirtMgr是一个基于libvirt的Web界面,用于管理虚拟机.它允许您创建和配置新域,并调整域的资源分配.VNC查看器为来宾域提供完整的图形控制台.K ...

随机推荐

  1. Notepad++ 插件之 TextFX (安装及作用)

    <安装:打开 notepad++  插件 -> Plugin Manager -> Show Plugin Manager -> available ->选中 TextF ...

  2. 在VS2010 中使用subversion 进行代码的分支与合并

    在实际开发总,遇到了这种情况: 开发版本1,开发版本2 ,更新产品时要求1在前,2在后. 但是因为时间要求,必须2个版本同时开发.这时就想到了在svn的版本分支合并. 创建分支之前,首先把当前版本代码 ...

  3. Xcode DeviceSupport

    问题:Could not locate device support files. This iPhone 6s is running iOS 12.1 (16B5059d), which may n ...

  4. UICollectionViewCell「居左显示」

    UICollectionViewCell「居左显示」 准备: 1.UICollectionView Left Aligned Layout 一款UICollectionView居左显示的约束点击下载_ ...

  5. 通过xshell在linux上安装redis3.0.0

    通过xshell在linux上安装redis3.0.0 0)首先要安装环境:yum install gcc-c++ 1)通过xftp6将redis安装包上传到linux:解压缩:tar -xvfz r ...

  6. 使用Ansible实现nginx+keepalived高可用负载均衡自动化部署

    本篇文章记录通过Ansible自动化部署nginx的负载均衡高可用,前端代理使用nginx+keepalived,端web server使用3台nginx用于负载效果的体现,结构图如下: 部署前准备工 ...

  7. 【c学习-13】

    /*库函数 1:数学函数库:math.h abs():绝对值; acos(),asin(),atan():cos,sin,tan的倒数 exp():指数的次幂 pow(x,y):x的y次幂 log() ...

  8. jQuery 使用问题

    attr('checked', 'checked')调用多次仅第一次生效 使用attr()获取这些属性的返回值为String类型,如果被选中(或禁用)就返回checked.selected或disab ...

  9. 如何用 npm 同时执行两条监听命令

    在日常项目中启动项目 需要启动项目可能需要不止一条命令 这就很麻烦 要开启两个bash 很麻烦 终于找到了比较好的解决方案 例如我的: npm run dev //启动项目项目 npm run jso ...

  10. 批处理,%~d0 cd %~dp0 代表什么意思

    批处理,%~d0 cd %~dp0 代表什么意思   ~dp0 “d”为Drive的缩写,即为驱动器,磁盘.“p”为Path缩写,即为路径,目录cd是转到这个目录,不过我觉得cd /d %~dp0 还 ...