服务器 
首页 > 服务器 > 浏览文章

kvm安装和删除虚拟机的方法

(编辑:jimmy 日期: 2024/9/21 浏览:3 次 )

什么是 KVM "color: #ff0000">安装kvm 

[root@puppetserver soft]# yum install qemu-kvm libvirt python-virtinst bridge-utils
[root@puppetserver soft]# yum install kvm libvirt python-virtinst qemu-kvm virt-viewer bridge-utils
[root@puppetserver soft]# lsmod | grep kvm
kvm_intel  53484 0 
kvm   316506 1 kvm_intel

[root@puppetserver soft]# /etc/init.d/libvirtd start
Starting libvirtd daemon:     [ OK ]

删除前:

virsh # list --all
 Id Name    State
----------------------------------------------------
 3 test    running
 - test02    shut off
 - test03    shut off


[root@puppetnode01 ~]# cd /etc/libvirt/qemu
[root@puppetnode01 qemu]# ll
total 16
drwxr-xr-x 2 root root 4096 Oct 28 19:36 autostart
drwx------ 3 root root 4096 Oct 28 09:44 networks
-rw------- 1 root root 2965 Oct 28 16:41 test02.xml
-rw------- 1 root root 2961 Oct 28 17:15 test.xml

删除后:

virsh # destroy test03
error: Failed to destroy domain test03
error: Requested operation is not valid: domain is not running

virsh # undefine test03
Domain test03 has been undefined

virsh # undefine test02
Domain test02 has been undefined

virsh # destroy test
Domain test destroyed

virsh # list --all 
 Id Name    State
----------------------------------------------------
 - test    shut off

virsh # undefine test
Domain test has been undefined

virsh # list --all 
 Id Name    State
----------------------------------------------------

virsh # 


[root@puppetnode01 qemu]# ll
total 8
drwxr-xr-x 2 root root 4096 Oct 28 19:37 autostart
drwx------ 3 root root 4096 Oct 28 09:44 networks
[root@puppetnode01 qemu]# 

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。

上一篇:linux编程之pipe()函数详解
下一篇:CentOS 7 虚拟机无法开机问题的快速解决方法
微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。