CentOS 7 安装SolusVM 开心版被控实现KVM虚拟机开设和noVNC配置

  • A+
所属分类:SolusVM

做对母机系统安装的时候或者安装好之后需要对存储盘做设置,需要给出一个有空间的VG
下图是我的系统空间分配

[root@DT_Node-DWHD.com ~]# fdisk  -l|awk '$1~/\/dev/||$2~/\/dev/'
磁盘 /dev/sda:1000.2 GB, 1000204886016 字节,1953525168 个扇区
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200  1953523711   975712256   8e  Linux LVM
磁盘 /dev/mapper/LBVG-root:53.7 GB, 53687091200 字节,104857600 个扇区
磁盘 /dev/mapper/LBVG-swap:4294 MB, 4294967296 字节,8388608 个扇区
[root@DT_Node-DWHD.com ~]# df -hP
文件系统               容量  已用  可用 已用% 挂载点
devtmpfs               7.8G     0  7.8G    0% /dev
tmpfs                  7.9G     0  7.9G    0% /dev/shm
tmpfs                  7.9G  8.7M  7.9G    1% /run
tmpfs                  7.9G     0  7.9G    0% /sys/fs/cgroup
/dev/mapper/LBVG-root   50G  2.0G   49G    4% /
/dev/sda1             1014M  176M  839M   18% /boot
tmpfs                  1.6G     0  1.6G    0% /run/user/0
[root@DT_Node-DWHD.com ~]# 
[root@DT_Node-DWHD.com ~]# pvs
  PV         VG   Fmt  Attr PSize    PFree   
  /dev/sda2  LBVG lvm2 a--  <930.51g <876.51g
[root@DT_Node-DWHD.com ~]# vgs
  VG   #PV #LV #SN Attr   VSize    VFree   
  LBVG   1   2   0 wz--n- <930.51g <876.51g
[root@DT_Node-DWHD.com ~]# lvs
  LV   VG   Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root LBVG -wi-ao---- 50.00g                                                    
  swap LBVG -wi-ao----  4.00g                                                    
[root@DT_Node-DWHD.com ~]# 

CentOS 7 安装SolusVM 开心版被控实现KVM虚拟机开设和noVNC配置

系统上需要安装bridge-utils软件包,因为后面建立的kvm虚拟机需要记住虚拟网桥来上网的

yum install -y bridge-utils

系统需要开启内核转发

sysctl -w net.ipv4.ip_forward=1
echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf 

配置网桥
CentOS 7 安装SolusVM 开心版被控实现KVM虚拟机开设和noVNC配置
CentOS 7 安装SolusVM 开心版被控实现KVM虚拟机开设和noVNC配置

[root@www ~]# grep -v '#' /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:24:ec:f1:96:21
ONBOOT=yes
BRIDGE=br0
TYPE=Ethernet
NAME=eth0
[root@www ~]# grep -v '#' /etc/sysconfig/network-scripts/ifcfg-br0 
DEVICE=br0
NAME=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
DEFROUTE=yes
GATEWAY=103.113.9.129
NETMASK=255.255.255.128
IPADDR=103.113.9.170
[root@www ~]# 
IP_MAC=78:45:c4:fa:d6:b6 && \
sed -i 's/^/#/' /etc/sysconfig/network-scripts/ifcfg-eth0 && \
echo -e "\nDEVICE=eth0\nHWADDR=$IP_MAC\nNBOOT=yes\nBRIDGE=br0\nTYPE=Ethernet\nNAME=eth0" >> /etc/sysconfig/network-scripts/ifcfg-eth0 && \
echo -e "DEVICE=br0\nNAME=br0\nTYPE=Bridge\nBOOTPROTO=static\nONBOOT=yes\nDEFROUTE=yes" > /etc/sysconfig/network-scripts/ifcfg-br0 && \
echo -e "IPADDR=$(ip addr | awk '$1=="inet" && $NF!="lo"{print $2;exit}'|sed -r 's/\/[0-9]{1,}$//')" >> /etc/sysconfig/network-scripts/ifcfg-br0 && \
echo -e "GATEWAY=$(ip r |awk '/default/{print $3;exit}')" >> /etc/sysconfig/network-scripts/ifcfg-br0 && \
echo -e "$(ipcalc -m `ip addr | awk '$1=="inet" && $NF!="lo"{print $2;exit}'`)\n" >> /etc/sysconfig/network-scripts/ifcfg-br0 && \
echo -e "DNS1=139.99.18.82\nDNS2=139.99.18.83\nDNS3=139.99.115.58" >> /etc/sysconfig/network-scripts/ifcfg-br0 

配置好了 重启下系统让网络生效
CentOS 7 安装SolusVM 开心版被控实现KVM虚拟机开设和noVNC配置

SolusVM被控开心版的安装

wget https://files.soluslabs.com/install.sh -O install.sh && sh install.sh

CentOS 7 安装SolusVM 开心版被控实现KVM虚拟机开设和noVNC配置

安装完了,我们要把这些信息记录下来,后面去做主控被控对接的时候需要
CentOS 7 安装SolusVM 开心版被控实现KVM虚拟机开设和noVNC配置

设置被控节点的hostname

[root@DT_Node-DWHD.com ~]# for i in static pretty transient; do hostnamectl set-hostname solusvm-hk003.dwhd.org --$i; done
[root@DT_Node-DWHD.com ~]# hostname
solusvm-hk003.dwhd.org
[root@DT_Node-DWHD.com ~]# 

为了后面的noVNC我们这里顺道配置下被控节点的证书

[root@DT_Node-DWHD.com ~]# cat /usr/local/solusvm/includes/nvnc/cert.pem
cat: /usr/local/solusvm/includes/nvnc/cert.pem: 没有那个文件或目录
[root@DT_Node-DWHD.com ~]# vi /usr/local/solusvm/includes/nvnc/cert.pem
[root@DT_Node-DWHD.com ~]# cp /usr/local/solusvm/data/config.ini.example /usr/local/solusvm/data/config.ini
[root@DT_Node-DWHD.com ~]# cat >> /usr/local/solusvm/data/config.ini <<-EOF

[NOVNC]
;; Set this to true if you want noVNC to access the websocket with the remote servers hostname. All the hostnames must resolve correctly. Default (false) is to use the ip address of the remote server
use_remote_hostname = true

;; Set this to true if you want the socket on the host to forward packets across the public network
socket_dest_public = false
EOF

配置完了我们需要让7706端口监听,不然还是用不了noVNC

service svmstack-nginx restart && \
sh /scripts/websocket-stop && \
php /usr/local/solusvm/includes/wsocket.php

CentOS 7 安装SolusVM 开心版被控实现KVM虚拟机开设和noVNC配置

解决 CentOS 7 Kvm不支持Windows的方法

sed -i '/^\[/a exclude=libguestfs* perl-Sys-Guestfs*' /etc/yum.repos.d/CentOS-Base.repo
wget http://libguestfs.solusvm.com/centos/libguestfs-plesk.repo -O /etc/yum.repos.d/libguestfs-plesk.repo
yum install -y libguestfs*.plesk
lookback

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: