当前位置:网站首页>Detailed explanation of KVM common commands
Detailed explanation of KVM common commands
2022-06-28 03:52:00 【Life is in a hurry】
Today I will continue to introduce Linux Operation and maintenance related knowledge , The main content of this paper is KVM Common commands .
This article takes centos7-1、centos7-2 Take a virtual machine , Introduce the common KVM The order is as follows :
1、 Virtual machine view
Carry out orders :
virsh list
You can view the virtual machines that have been opened .
Carry out orders :
virsh list --all
You can view all virtual machines ( Including opened and unopened )
Carry out orders :
virsh version
You can see virsh Version of
The execution result of the above command is as follows :
Virtual machine startup and shutdown
Carry out orders :
virsh start centos7-1
You can open the virtual machine .
Carry out orders :
virsh shutdown centos7-1
You can shut down the virtual machine .
Carry out orders :
virsh destroy centos7-1
You can forcibly shut down the virtual machine , It's equivalent to forced power failure , This method is often used when the virtual machine cannot shut down normally .
3、 Virtual machine configuration file export
Carry out orders :
virsh dumpxml centos7-2 > /tmp/centos7-2.xml
You can export the configuration file of the virtual machine to /tmp/ Under the table of contents , And named it centos7-2.xml, The execution result of this command is as follows :
4、 Virtual machine suspend and restore
Carry out orders :
virsh suspend centos7-1
You can suspend the virtual machine .
Carry out orders :
virsh resume centos7-1
The virtual machine can be restored .
5、 Virtual machine session link
Carry out orders :
virsh console centos7-1
6、 Virtual machine revocation and recovery
Carry out orders :
virsh undefine centos7-2
You can remove the virtual machine from the virtual machine manager , The configuration file of the virtual machine will be deleted , But the virtual machine disk file was not deleted , Therefore, the virtual machine can also recover , But the premise is that the configuration file of the virtual machine has been exported and backed up .
Carry out orders :
virsh define /tmp/centos7-2.xml
You can restore the deleted virtual machine .
7、 Virtual machine self startup and self startup revocation
Carry out orders :
virsh autostart centos7-1
It can make the virtual machine self start at the beginning .
Carry out orders :
virsh autostart --disable centos7-1
边栏推荐
猜你喜欢
随机推荐
What is the difference between slice and array in go question bank 12?
谈云原生,不得不谈的容器
【毕业季】研究生の毕业总结
友链须知
可扩展存储系统(上)
Does the applet input box flash?
数据库系列之MySQL和TiDB中慢日志分析
A Preliminary Study of Blackbody radiation
可扩展系统的“9不”原则和“5个”衡量维度
Circular sliding auto adsorption UI tool that monkeys can use
事件委托的原理
物体上下漂浮工具
Execution plan in MySQL of database Series
Sublime text 3 basic configuration tutorial
多线程与高并发四:VarHandle与强软弱虚引用和ThreadLocal
Documentation issues
How to automatically add author, time, etc. to eclipse
力扣每日一题-第29天-1491.去掉最低工资和最高工资后的平均工资
数据库系列之MySQL中的分页查询优化
Paging query optimization in MySQL of database Series









