【KVM-1】软件虚拟化和硬件虚拟化类型

前言

大家好,我是秋意零。

今天介绍的内容是虚拟化技术以及软件虚拟化和硬件虚拟化。

👿 简介

  • 🏠 个人主页秋意零
  • 🔥 账号:全平台同名, 秋意零 账号创作者、 云社区 创建者
  • 🧑 个人介绍:在校期间参与众多云计算相关比赛,如:🌟 “省赛”、“国赛”,并斩获多项奖项荣誉证书
  • 🎉 目前状况:24 届毕业生,拿到一家私有云(IAAS)公司 offer,目前已在实习
  • 💕欢迎大家:欢迎大家一起学习云计算,走向年薪 30 万
  • 💕推广:CSDN 主页左侧,是个人扣扣群推广。方便大家技术交流、技术博客互助

一、什么是虚拟化?

虚拟化是将我们现实中的计算机硬件资源进行切割,将切割的部分进行使用,这部分的资源被称为虚拟资源。

图中左侧是传统应用方式、右侧是虚拟化应用方式。可以看到右侧是通过Virtual Machine Monitor(VMM)虚拟机监控器,也称为Hypervisor层,就是利用它来达到虚拟化引入的软件层。它向下掌控实际的物理资源(相当于原本的操作系统) ,向上呈现给虚拟机N份逻辑的资源。为了做到这一点,就需要将虚拟机对物理资源的访问“偷梁换柱”一-截取并重定向,让虚拟机误以为自己是在独享物理资源。虚拟机监控器运行的实际物理环境,称为宿主机;其上虚拟出来的逻辑主机,称为客户机。

二、软件虚拟化和硬件虚拟化

软件虚拟化,是通过软件模拟来实现VMM层,通过纯软件的环境来模拟执行虚拟机里的指令。

2.1 软件虚拟化

软件虚拟化技术,通过VMM中间层软件与硬件翻译来实现虚拟化。

最纯粹的软件虚拟化实现当属QEMU。在没有启用硬件虚拟化辅助的时候,它通过软件的二进制翻译仿真出目标平台(计算资源)呈现给虚拟机,虚拟机的每一条目标平台(计算资源)指令都会被QEMU截取,并翻译成宿主机平台的指令,然后交给实际的物理平台执行。由于每一条都需要这么操作一下,其虚拟化性能是比较差的,同时其软件复杂度也大大增加。但好处是可以呈现各种平台给虚拟机,只要其二进制翻译支持。

2.2 硬件虚拟化

硬件虚拟化技术,就是硬件本身支持虚拟化。

硬件虚拟化技术就是指计算机硬件本身提供能力让虚拟机指令独立执行,而不需要 (严格来说是不完全需要) VMM截获重定向。

在x86架构中,它提供一个略微受限制的硬件运行环境供虚拟机运行 (non-root mode),在一般情况下,虚拟机在此受限环境中运行与在宿主机系统运行没有什么两样,不需要像软件虚拟化那样每条指令都先翻译再执行,而VMM运行在root mode,拥有完整的硬件访问控制权限。

可以看到,硬件虚拟化技术性能已经接近于宿主机系统,并且这个过程可以使VMM的软件架构大大简化。

Intel从2005年就开始在其x86 CPU中加入硬件虚拟化的支持Intel Virtualization Technology,简称Intel VT。到目前为止,在所有的Intel CPU中,都可以看到Intel VT的身影。

总结

虚拟化技术可以说是云计算的本质,通过虚拟化技术,我们就可以向使用水电一样使用计算机资源,按需所取、按量收费。

软件虚拟化和硬件虚拟化的区别是,软件虚拟化是通过软件翻译实现的虚拟化,硬件虚拟化是硬件本身支持的虚拟化技术。所有对比性能硬件虚拟化技术更好,因为中间少了一个翻译。

In 1998, VMware figured out how to virtualize the x86 platform, once thought to be impossible, and created the market for x86 virtualization. The solution was a combination of binary translation and direct execution on the processor that allowed multiple guest OSes to run in full isolation on the same computer with readily affordable virtualization overhead. The savings that tens of thousands of companies have generated from the deployment of this technology is further driving the rapid adoption of virtualized computing from the desktop to the data center. As new vendors enter the space and attempt to differentiate their products, many are creating confusion with their marketing claims and terminology. For example, while hardware assist is a valuable technique that will mature and expand the envelope of workloads that can be virtualized, paravirtualization is not an entirely new technology that offers an “order of magnitude” greater performance. While this is a complex and rapidly evolving space, the technologies employed can be readily explained to help companies understand their options and choose a path forward. This white paper attempts to clarify the various techniques used to virtualize x86 hardware, the strengths and weaknesses of each, and VMware’s community approach to develop and employ the most effective of the emerging virtualization techniques. Figure 1 provides a summary timeline of x86 virtualization technologies from VMware’s binary translation to the recent application of kernel paravirtualization and hardware-assisted virtualization.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

秋意零

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值