当前位置:网站首页>KVM command set management virtual machine
KVM command set management virtual machine
2022-07-27 06:38:00 【Conquer bugs】
One ,KVM Basic commands
1. View command help
virsh -h2. see KVM The directory where the configuration files are stored
ls /etc/libvirt/qemu/3. View virtual machine status
virsh list --all4. Shut down and power on the virtual machine
virsh shutdown centos7
virsh destroy centos75. Force the instance system to power off
virsh destroy centos76. Start the virtual machine system instance through the configuration file
virsh create /etc/libvirt/qemu/contos7.xml
virsh list --all7. Suspend virtual machine
virsh suspend centos7
virsh list --all8. Restore virtual machine
virsh resume centos7
virsh list --all9. Configure the virtual machine to start automatically with the host
virsh autostart centos710. Export virtual machine configuration
virsh dumpxml centos7 > /etc/libvirt/qemu/centos7-2.xml11. Delete and add virtual machine
virsh shutdown centos7
virsh undefine centos7
Redefining virtual machines
cd /etc/libvirt/qemu
mv centos7-2.xml centos7.xml
virsh define centos7.xml
virsh list --all12. Modify virtual machine configuration information
vim /etc/libvirt/qemu/centos7.xml
virsh edit centos7Two ,KVM file management
1. View the current disk format
qemu-img info /data_kvm/store/centos7.qcow22. adopt qemu-img Command to convert disk file format , take centos7 The virtual machine raw Format disk conversion to qcow2 Format
virsh shutdown centos7
qemu-img convert -f raw -O qcow2 /data_kvm/store/centos7.img /data_kvm/store/centos7.qcow2
modify centos7 Of xml Disk type and disk file name in the configuration file
virsh edit centos73. virt-cat, similar cat command
vist-cat -a /data_kvm/store/centos7.qcow2 /etc/sysconfig/grub4.virt-edit, Edit the file , Usage and vim Agreement
virt-edit -a /data_kvm/store/centos7.qcow2 /etc/resolv.conf5.virt-df The command is used to view virtual machine disk information
vist -df -h centos73、 ... and , Clone virtual machine
1. View virtual machine status
virsh list --all2. from centos7 clone centos7-2
virt-clon -o centos7 -n centos7-2 -f /data_kvm/store/centos7.qcown23. View virtual machine status
virsh list --all4. Start virtual machine
virsh start centos7Four , Virtual machine snapshot
1. Yes centos7 Create a snapshot
virsh snapshot-create centos72. View virtual machine snapshot version information
virsh snapshot-current centos73. View snapshot information
virsh snapshot-list centos74. Restore the virtual machine state to { Number }
virsh snapshot-revert centos7 code 5. Delete snapshot
virs snapshot-delete centos7 code
边栏推荐
猜你喜欢

Shell programming specifications and variables

IP core summary

Stress performance test of website based on AB tool under Apache

Ram of IP core

数据库在终端的增删改查

QGIS series (1) -qgis (server APACHE) win10 installation

Wireshark packet modification -- adding or modifying message fields (2)

多线程的相关知识

Multi coordinate transformation

shell脚本之函数调用
随机推荐
单元集成(接⼝)测试
DNS故障分析优化
Source code compilation and installation LNMP and discuz Forum
数据库的索引和事务(重点)
Programming learning records - Lesson 7 [functions]
TF coordinate transformation
数据库的约束以及设计
Geonode GeoServer win10 installation tutorial (personal test)
反射器中getattr,hasattr,delattr,setattr的使用
Kaggle calls the custom module method
PXE efficient batch network installation
shell函数
Some experience of learning technology and theoretical knowledge
Markdown文档常用字体及颜色设置
Basic knowledge of English: Rules for using attributives Part 2
Interpretation of unity desktop version 7.6
Introduction to hash table
哈希表简介
iptables防火墙
Wireshark packet modification -- adding or modifying message fields (2)