当前位置:网站首页>KVM命令集管理虚拟机
KVM命令集管理虚拟机
2022-07-27 05:22:00 【征服bug】
一,KVM基本命令
1.查看命令帮助
virsh -h2.查看KVM的配置文件存放目录
ls /etc/libvirt/qemu/3.查看虚拟机状态
virsh list --all4.虚拟机关机与开机
virsh shutdown centos7
virsh destroy centos75.强制实例系统关闭电源
virsh destroy centos76.通过配置文件启动虚拟机系统实例
virsh create /etc/libvirt/qemu/contos7.xml
virsh list --all7.挂起虚拟机
virsh suspend centos7
virsh list --all8.恢复虚拟机
virsh resume centos7
virsh list --all9.配置虚拟机伴随宿主机自动启动
virsh autostart centos710.导出虚拟机配置
virsh dumpxml centos7 > /etc/libvirt/qemu/centos7-2.xml11.虚拟机的删除与添加
virsh shutdown centos7
virsh undefine centos7
重新定义虚拟机
cd /etc/libvirt/qemu
mv centos7-2.xml centos7.xml
virsh define centos7.xml
virsh list --all12.修改虚拟机配置信息
vim /etc/libvirt/qemu/centos7.xml
virsh edit centos7二,KVM文件管理
1.查看当前磁盘格式
qemu-img info /data_kvm/store/centos7.qcow22.通过qemu-img命令转换磁盘文件格式,将centos7虚拟机的raw格式磁盘转换至qcow2格式
virsh shutdown centos7
qemu-img convert -f raw -O qcow2 /data_kvm/store/centos7.img /data_kvm/store/centos7.qcow2
修改centos7的xml配置文件中的磁盘类型与磁盘文件名
virsh edit centos73. virt-cat,类似cat命令
vist-cat -a /data_kvm/store/centos7.qcow2 /etc/sysconfig/grub4.virt-edit,编辑文件,用法与vim一致
virt-edit -a /data_kvm/store/centos7.qcow2 /etc/resolv.conf5.virt-df命令用于查看虚拟机磁盘信息
vist -df -h centos7三,克隆虚拟机
1.查看虚拟机状态
virsh list --all2.从centos7克隆centos7-2
virt-clon -o centos7 -n centos7-2 -f /data_kvm/store/centos7.qcown23.查看虚拟机状态
virsh list --all4.启动虚拟机
virsh start centos7四,虚拟机快照
1.对centos7创建快照
virsh snapshot-create centos72.查看虚拟机快照版本信息
virsh snapshot-current centos73.查看快照信息
virsh snapshot-list centos74.恢复虚拟机状态至{编号}
virsh snapshot-revert centos7 编码5.删除快照
virs snapshot-delete centos7 编码
边栏推荐
猜你喜欢

Unity shader overview

Random points in non overlapping rectangle (force deduction daily question)

DNS域名解析服务

源码编译安装LNMP和DISCUZ论坛

TF coordinate transformation

Tangent space and TBN matrix

ULCL功能--5GC

Remote sensing image recognition misclassification under multi class recognition

Non photorealistic rendering (NPR) paper understanding and reproduction (unity) - stylized highlights for cartoon rendering and animation

远程访问及控制
随机推荐
英语基础知识: 并列结构
Robot navigation
ROS distributed communication
DHCP原理与配置
Seven sorting details
多线程常见锁的策略
selenium知识点
Unity engine starts to migrate from mono to.Net coreclr
Ulcl function --5gc
Programming learning records - Lesson 7 [functions]
DNS域名解析服务
gradle的安装配置及使用
wireshark图形界面介绍
英语基础知识:修饰性的句子成分-上篇
Strategies for common locks in multithreading
This is my blog
文件内容的读写——数据流
源码编译安装LAMP和DISCUZ论坛
Automatic tracking
Three ways to get RPM packages using yum