当前位置:网站首页>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 编码
边栏推荐
- 正则表达式
- 多线程常见锁的策略
- 软件测试用里篇
- 网络故障排查:Ping和Tracert命令
- jmeter简介
- Selenium knowledge points
- Multi threaded CAS, synchronized lock principle, JUC and deadlock
- Non photorealistic rendering (NPR) paper understanding and reproduction (unity) - stylized highlights for cartoon rendering and animation
- bug分类及缺陷和csv文件测试
- 多线程的知识补充
猜你喜欢

5g's past and present life -- a brief introduction to the development of mobile communication

Joint query of database

Summary of Internet simple protocol

Tangent space and TBN matrix

Install Wireshark correctly

Robot navigation implementation

正确安装wireshark

Knowledge supplement of multithreading

DNS domain name resolution service

ULCL功能--5GC
随机推荐
学习软件测试时需要配备的运行环境需求搭建
PLL of IP core
PXE efficient batch network installation
ROS node name duplicate
Thesis writing (harvest)
Knowledge supplement of multithreading
哈希表简介
Automated Deployment Project
网络故障排查:用户VLAN下用户无法收到组播报文故障(IGMP Snooping)
网络故障排查:Ping和Tracert命令
多线程常见锁的策略
接口测试流程及面试问题
单元集成(接⼝)测试
Unit integration (grounding) test
远程访问及控制
C language - dynamic memory management
Selenium knowledge points
多线程的知识补充
This is my blog
二叉树——搜索树