当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Database migration
Learning - useful resources
STM32 peripheral SDIO and SD card configuration
可扩展存储系统(上)
Several ways of sharing printers in LAN
以自动化赋能转型,飞鹤乳业加速迈向数字化!
MySQL错误
开口式霍尔电流传感器如何助力直流配电改造?
TypeError: &# 039; module&# 03…
电子地图坐标系统研究整理
几个重要的物理概念
图片的懒加载和预加载
Extensible database (Part 2)
Resource management, high availability and automation (medium)
A solution to the inefficiency of setting debug mode in developing flask framework with pychar
Self use tool unity video player that monkeys can use
Simple implementation of cool GUI window based on WPF
大咖说·计算讲谈社|什么是东数西算要解决的核心问题?
WARN:  SQL  Error: …
可扩展系统的“9不”原则和“5个”衡量维度









