部署KVM虚拟化平台

一、YUM安装KVM

yum groupinstall -y "GNOME Desktop" qemu-kvm qemu-kvm-tools virt-install qemu-img bridge-utils libvirt virt-manager

ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

验证

cat /proc/cpuinfo | grep vmx

lsmod | grep kvm

systemctl start libvirtd

systemctl enable libvirtd

二、设置KVM网络

vim /etc/sysconfig/network-scripts/ifcfg-ens33

...

BRIDGE=br0

vim /etc/sysconfig/network-scripts/ifcfg-br0

TYPE=Bridge

NAME=br0

DEVICE=br0

ONBOOT=yes

IPADDR=192.168.107.200

NETMASK=255.255.255.0

GATEWAY=192.168.107.2

systemctl restart network

三、KVM管理

virt-manager

virsh -h

ls /etc/libvirt/qemu

virsh list -all

virsh shutdown test01

virsh start test01

virsh destroy test01

virsh create /etc/libvirt/qemu/test01.xml

virsh suspend test01

virsh resume test01

virsh autostart test01

virsh dumpxml test01 > /etc/libvirt/qemu/test02.xml

virsh undefine test01

virsh define test01.xml

virsh edit test01

文件管理

qemu-img info /data_kvm/store/test01.qcow2

qemu-img convert -f raw -O qcow2 /data_kvm/store/test01.img /data_kvm/store/test01.qcow2

virsh edit test01

yum -y install libguestfs-tools-c

virt-edit -a /data_kvm/store/test01.qcow2 /etc/resolv.conf

virt-df -h test01

virt-clone -o test01 -n test02 -f /data_kvm/store/test02.qcow2

快照

virsh snapshot-create test01

virsh snapshot-current test01

virsh snapshot-list test01

virsh snapshot-revert test01 1503494464

virsh snapshot-delete test01 1503494464

相关推荐
未济4 天前
linux 配置环境变量
linux
傲世仙尊4 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
虎头金猫4 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
_艾伦 耶格尔.5 天前
进程间通信
linux
AI职业加油站5 天前
AI智能体应用工程师证书:政策红利下的职业新风口
大数据·运维·人工智能·学习·职场发展
Liuqy-055 天前
Linux IO编程——静态库、动态库
linux
此冬歌咏5 天前
K8s 节点故障实战:优雅驱逐 31 秒,硬故障 331 秒,以及那个永远 Pending 的 Pod
运维·k8s
彧azz5 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅5 天前
linux(8) 软硬链接
linux·运维·服务器
Wang's Blog5 天前
Java 项目实战: 外卖平台-文件下载与ServletOutputStream回写浏览器
服务器·项目开发