源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2021-05-12 11:06 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:kvm安装和删除虚拟机的方法
[b]什么是 KVM ?[/b] KVM 是指基于 Linux 内核的虚拟机(Kernel-based Virtual Machine)。 2006 年 10 月,由以色列的Qumranet 组织开发的一种新的“虚拟机”实现方案。 2007 年 2 月发布的 Linux 2.6.20 内核第一次包含了 KVM 。增加 KVM 到 Linux 内核是 Linux 发展的一个重要里程碑,这也是第一个整合到 Linux 主线内核的虚拟化技术。 KVM 在标准的 Linux 内核中增加了虚拟技术,从而我们可以通过优化的内核来使用虚拟技术。在 KVM 模型中,每一个虚拟机都是一个由 Linux 调度程序管理的标准进程,你可以在用户空间启动客户机操作系统。 [b]安装kvm [/b]
[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 ]
[b]删除前:[/b]
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
[b]删除后:[/b]
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]# 
[b]总结[/b] 以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部