关于虚拟化(virtualization)的一些知识

2023-05-16

什么是虚拟化(virtualization)

首先是wiki上面对于虚拟化的定义

In computing, virtualization refers to the act of creating a virtual (rather than actual) version of something, including virtual computer hardware platforms, storage devices, and computer network resources.
Virtualization began in the 1960s, as a method of logically dividing the system resources provided by mainframe computers between different applications. Since then, the meaning of the term has broadened.
from https://en.wikipedia.org/wiki/Virtualization

如今的虚拟化,wiki百科上面被分为几个种类,主要有以下三种:

  • 硬件虚拟化(Hardware Virtualization)
  • Desktop virtualization
  • Nested virtualization

硬件虚拟化

硬件虚拟化。其核心定义是创建一个能够像真的操作系统一样活动的虚拟机(virtual machine)。先引入两个名词host和guest,简单的含义就是创建虚拟机的是host,被创建则是guest。还有一个常常听到的hypervisor,指的是能够创建虚拟机的软件或者硬件。

常用的硬件虚拟化方法有两类

  • 全虚拟化(full virtualization)
  • 半虚拟化(para-virtualization)

另外会写文章详细说明。

wiki中还提到,硬件虚拟化可以被看作是企业IT总体趋势的一部分,其中包括自主计算,IT环境可以基于感知活动管理自己的场景,以及计算机处理能力被视为客户可以根据需要付费。虚拟化的通常目标是集中管理任务,同时提高可伸缩性和整体硬件资源利用率。通过虚拟化,多个操作系统可以在单个中央处理单元(CPU)上并行运行。这种并行性往往会降低开销成本,不同于多任务处理,即涉及在同一个操作系统上运行多个程序。使用虚拟化,企业可以更好地管理操作系统和应用程序的更新和快速更改服务而不会中断用户的操作。 “最终,虚拟化显着提高了组织中资源和应用程序的效率和可用性,而不依赖于导致资源利用不足的“一台服务器,一台应用程序“的旧模型,而是动态地应用虚拟资源来满足业务需求。

快照(snapshot)

硬件虚拟化中的快照,可以简单的认为是一种增量备份(incremental backup)。快照的存在使得虚拟机获得了暂时保存和恢复自己某一时刻状态的能力。
每当进行快照时,会对虚拟机的存储设备等(大多情况下是对存储设备)进行文件备份,备份后创建的新文件作为虚拟机的new layer来继续存储之后写入的数据。同时为了支持快照的恢复,也需要能够忽略或者去除某个(某几个)最新的layer。

这里用qemu的snapshot为例:

The idea is to be able to issue a command to QEMU via the monitor or QMP, which causes QEMU to create a new snapshot image with the original image as the backing file, mounted read-only. This will allow the original image file to be backed up.
Roll-back to a previous version requires one to boot from the previous backing file, at which point the snapshot file becomes invalid. Unfortunately there is no way to detect that a backing file has been booted, making it important for administrators to take care to not rely on snapshot files being valid after a roll-back.
The snapshot image will have to be in a format which support backing files, ie QCOW2 and QED, however the original image can be of any supported format. Ie. it is possible to make a QCOW2 snapshot of a RAW image, or a QED snapshot of a QED image.
from https://wiki.qemu.org/Features/Snapshots

关于Qcow2特性的一些总结

这里的back file的设计支持了快照的恢复,同时通过read only的特点,保证的镜像文件不会被污染,快照的可靠性也在这里得到了保证,侧面应证了快照是一种增量备份的手段。

迁移(migration)

快照能够通过hypervisor移动到另外的host上,虚拟机会被暂停、做快照,然后移动然后到新的host上继续运行,这就是迁移。如果这个虚拟机的快照之前有定期的同步的话,那么这个迁移的过程会非常的快,也给了host进入维护状态的机会。

故障转移(failover)

这个概念和迁移类似,但是区别在于,故障转移指的是host在宕机或者出现了不能支持虚拟机运行状态后,虚拟机将保持备份服务器上面最后一个已知状态而不是当前状态。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

关于虚拟化(virtualization)的一些知识 的相关文章

随机推荐