All Projects → evcloud → evcloud

evcloud / evcloud

Licence: other
EVCloud是一个基于ceph和libvirt的轻量级云主机管理平台,实用稳定,维护简易

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to evcloud

virtnbdbackup
Backup utiliy for Libvirt / qemu / kvm supporting incremental and differencial backups.
Stars: ✭ 62 (+40.91%)
Mutual labels:  virtual-machine, kvm, libvirt
Multipass
Multipass orchestrates virtual Ubuntu instances
Stars: ✭ 3,978 (+8940.91%)
Mutual labels:  virtual-machine, libvirt
birsh
virsh replacement in bash
Stars: ✭ 14 (-68.18%)
Mutual labels:  virtual-machine, kvm
Kvmtop
A monitoring tool for black box virtual machines from KVM hypervisor level
Stars: ✭ 51 (+15.91%)
Mutual labels:  virtual-machine, kvm
Ravada
Remote Virtual Desktops Manager
Stars: ✭ 253 (+475%)
Mutual labels:  kvm, libvirt
wiser
🐎 Extremely minimal vmm for linux written in C. Hopefully someday will spin linux-vm for you.
Stars: ✭ 249 (+465.91%)
Mutual labels:  virtual-machine, kvm
Runtime
OCI (Open Containers Initiative) compatible runtime using Virtual Machines
Stars: ✭ 588 (+1236.36%)
Mutual labels:  virtual-machine, kvm
Node Libvirt
libvirt bindings for google v8 javascript engine (nodejs addon)
Stars: ✭ 162 (+268.18%)
Mutual labels:  kvm, libvirt
Macos Simple Kvm
Tools to set up a quick macOS VM in QEMU, accelerated by KVM.
Stars: ✭ 11,732 (+26563.64%)
Mutual labels:  virtual-machine, kvm
Qemu Images
A collection of disk images and virtual machines that can be used by the QEMU emulator
Stars: ✭ 145 (+229.55%)
Mutual labels:  virtual-machine, kvm
vagrant-travisci-libvrt
Example project showing how to run Vagrant on TravisCI using libvrt & KVM
Stars: ✭ 25 (-43.18%)
Mutual labels:  kvm, libvirt
Kvm Install Vm
Bash script to build local virtual machines using KVM/libvirt and cloud-init.
Stars: ✭ 248 (+463.64%)
Mutual labels:  kvm, libvirt
Kimchi
An HTML5 management interface for KVM guests
Stars: ✭ 2,773 (+6202.27%)
Mutual labels:  kvm, libvirt
Virtlyst
Web interface to manage virtual machines with libvirt
Stars: ✭ 167 (+279.55%)
Mutual labels:  kvm, libvirt
Runtime
Kata Containers version 1.x runtime (for version 2.x see https://github.com/kata-containers/kata-containers).
Stars: ✭ 2,103 (+4679.55%)
Mutual labels:  virtual-machine, kvm
Cc Oci Runtime
OCI (Open Containers Initiative) compatible runtime for Intel® Architecture
Stars: ✭ 418 (+850%)
Mutual labels:  virtual-machine, kvm
Karesansui
Karesansui is an open-source virtualization management application made in Japan.
Stars: ✭ 97 (+120.45%)
Mutual labels:  kvm, libvirt
Terrible
An Ansible playbook that apply the principle of the Infrastructure as Code on a QEMU/KVM environment.
Stars: ✭ 161 (+265.91%)
Mutual labels:  kvm, libvirt
Kata Containers
Kata Containers version 2.x repository. Kata Containers is an open source project and community working to build a standard implementation of lightweight Virtual Machines (VMs) that feel and perform like containers, but provide the workload isolation and security advantages of VMs. https://katacontainers.io/
Stars: ✭ 1,053 (+2293.18%)
Mutual labels:  virtual-machine, kvm
Kvm Vmi
KVM-based Virtual Machine Introspection
Stars: ✭ 153 (+247.73%)
Mutual labels:  virtual-machine, kvm

关于EVCloud

EVCloud是一个轻量级云主机管理平台,追求功能实用,运行稳定,维护简单。 主要技术栈:CEPH、MariaDB、Django、libvirt。

展示

image image image image image

环境搭建(CentOS9)

1 安装python和Git

请自行安装python3.9和Git。 使用Git拉取代码:

git clone https://github.com/evcloud/evcloud.git

2 安装python运行环境

(1) 使用python虚拟环境

使用pip命令安装pipenv。

pip3 install pipenv

在代码工程根目录下,即文件Pipfile同目录下运行命令:

pipenv install

(2) 使用系统python环境

在代码工程根目录下,即文件requirements.txt同目录下运行命令:
pip3 install -r requirements.txt

如果通过pip安装过程中安装libvirt-python失败,使用下面命令安装。

dnf uninstall python3-libvirt.x86_64

# 如果使用了虚拟python环境,libvirt_python复制到你的虚拟python环境
cp /usr/lib64/python3.9/site-packages/libvirt* /root/.local/share/virtualenvs/evcloud-b1zsp8qp/lib/python3.9/site-packages/ -r

3 安全敏感信息配置文件

安全信息配置demo文件security_demo.py修改文件名为security.py,根据自己情况完成配置。

4 数据库安装

请自行安装mysql数据库,根据自己的情况修改security.py文件中数据库的配置项。

DATABASES = {
  'default': {
      'ENGINE': 'django.db.backends.mysql',  # 数据库引擎
      'NAME': 'xxx',  # 数据的库名,事先要创建之
      'HOST': '127.0.0.1',  # 主机
      'PORT': '3306',  # 数据库使用的端口
      'USER': 'xxx',  # 数据库用户名
      'PASSWORD': 'xxx',  # 密码
      'OPTIONS': {'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"}
  },
}

5 CEPH依赖库安装

根据自己ceph版本安装对应版本的包,与ceph的通信默认使用官方librados的python包python3-rados,python3-rbd的rpm包安装成功后,python包会自动安装到 系统python3第三方扩展包路径下(/usr/lib64/python3.9/site-packages/)。
使用python虚拟环境的,需要手动把路径下的python包文件rados和rbd复制到你的虚拟python环境*/site-packages/下。

dnf install librados-devel.x86_64 -y
dnf install python3-rados.x86_64 -y
dnf install python3-rbd.x86_64 -y

# 如果使用了虚拟python环境,rados*和rbd*复制到你的虚拟python环境
cp /usr/lib64/python3.9/site-packages/rados* /root/.local/share/virtualenvs/evcloud-b1zsp8qp/lib/python3.9/site-packages/ -r    
cp /usr/lib64/python3.9/site-packages/rbd* /root/.local/share/virtualenvs/evcloud-b1zsp8qp/lib/python3.9/site-packages/ -r

6 运行服务

如果使用python虚拟环境,先激活python虚拟环境

pipenv shell

数据库迁移,在项目根目录下运行如下命令完成数据库迁移。

python3 manage.py migrate

运行web服务

python3 manage.py runserver 0:80

如果一切正常,打开浏览器输入url(主机IP, 如:127.0.0.1)即可查看站点;

7 远程console服务(NoVNC和Spice)

安装websockify

pip3 install websockify

替换websockify的token插件,使用项目中自定义的token插件,根据自己环境修改以下命令中的PROJECT_PATH和PYTHON_PATH:

ln -s PROJECT_PATH/novnc/token_plugin_mysql/token_plugin_mysql.py PYTHON_PATH/python3.9/site-packages/websockify/token_plugins.py

WEB console客户端noVNC(https://github.com/novnc/noVNC)和 spice-html5(https://gitlab.freedesktop.org/spice/spice-html5) 在项目目录static/console下。

启动websockify服务 运行01run_novnc.sh脚本,或直接执行命令:

websockify 0.0.0.0:84 --daemon --web=/home/uwsgi/evcloud/static/console --token-plugin=TokenMysql --token-source='mysql'

请对应设置项目配置文件settings.py中参数NOVNC_SERVER_PORT的值。

8 nginx

使用nginx时,可以参考django_site目录下nginx_evcloud.conf文件。

后台管理和配置

1 系统镜像和硬盘

虚拟机系统镜像和虚拟硬盘使用Ceph的rbd块存储;
前提条件:要求已经在后台添加了一个分中心,添加了ceph集群配置和存储系统镜像的ceph存储池pool;
要添加一个系统镜像,首先添加一个对应系统镜像内的操作系统类型的虚拟机的xml模板,以一个镜像为Linux系统(如CentOS、ubuntu等)virtio驱动xml模板为例, 模板中的形如"{xxx}"的内容是各对应配置的占位符,在创建虚拟机时会填充用户选择的配置参数。

<domain type='kvm'>
  <name>{name}</name>
  <uuid>{uuid}</uuid>
  <memory unit='MiB'>{mem}</memory>
  <currentMemory unit='MiB'>{mem}</currentMemory>
  <vcpu placement='static'>{vcpu}</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='allow'>Haswell</model>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='network' device='disk'>
      <driver name='qemu'/>
      <auth username='admin'>
        <secret type='ceph' uuid='{ceph_uuid}'/>
      </auth>
      <source protocol='rbd' name='{ceph_pool}/{diskname}'>
        {ceph_hosts_xml}
      </source>
      <target dev='vda' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='{mac}'/>
      <source bridge='{bridge}'/>
      <model type='virtio'/>
      <boot order='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>   
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='3'/>
    </redirdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>

系统镜像rbd(需要自己制作)需要导入ceph对应的pool中,然后就可以在后台添加系统镜像记录了。

2 网络

需要自己为所有宿主机搭建DHCP服务;
首先在后台添加子网vlan,然后在首页导航栏点击“网络”进入网络页面中批量添加对应valn网段的ip,然后可以导出vlan所有IP的DHCP服务配置文件;

3 宿主机

首先后台添加一个宿主机组,然后添加一个宿主机记录; 宿主机上需要自行搭建KVM+libvirtd环境, 通过libvirt api以qemu+ssh的方式访问宿主机,需要把部署EVCloud的主机的ssk公钥添加到 宿主机~/.ssh/authorized_keys文件中。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].