克隆图像在用作卷时被展平是否危险?

huangapple go评论99阅读模式
英文:

Is it dangerous for a cloned image to be flattened while being used as a volume?

问题

我目前正在学习关于Ceph的知识。

我在官方文档中发现了一个有趣的功能,称为"flatten",我有一个关于这个功能的问题,所以我在这里提问。

假设Openstack的Cinder服务使用Ceph作为后端存储,我看到克隆镜像可以在用作卷时被"flatten"。

在数据被写入卷的同时"flatten",不会导致数据损坏吗?

我想知道"flatten"是否是一个完全安全的功能。

如果是安全的,能告诉我证据吗?

感谢阅读问题。 克隆图像在用作卷时被展平是否危险?

英文:

I am currently learning about Ceph.

I found an interesting feature called flatten in the official documentation, and I have a question about this feature, so I'm asking.

Assuming that Openstack's Cinder service uses Ceph as backend storage, I have seen that clone images can be flattened while being used as volumes.

Doesn't it happen that data is corrupted if flattened while data is actively being written to the volume?

I'm wondering if flatten is a completely safe feature.

If it's safe, may I know the proof?

Thanks for reading the question. 克隆图像在用作卷时被展平是否危险?

答案1

得分: 0

是的,可以在实时图像上执行展开操作,而且这不是一项危险的操作。

至于为什么需要研究Ceph如何存储块卷、如何创建快照和克隆,以及为什么展开克隆是有用的(它将克隆图像与其父快照解耦),这些主题都是相互关联的,都在此处进行了讨论。

简短版的解释是,当卷的克隆被创建时,Ceph会引用父级中除了在父级和克隆之间不同的分配单元之外的所有数据的分配单元。这被称为写时复制(copy on write),在存在许多黄金镜像的克隆(例如Ubuntu 22.04的副本)的任何地方都能节省大量空间。展开操作会创建这些常见卷块的单独副本,专门用于克隆,从而解耦了父级和克隆。如果希望删除父级卷,这是有用的。

英文:

Yes, flattening can be performed on a live image and it is not a dangerous operation.

As to why, you need to study how Ceph stores block volumes, how snapshots and clones are created, and why flattening of clones is useful (it de-couples a cloned image from its parent snapshot). These topics are all interconnected, and are covered here.

The short version is that as clones of a volume are created, Ceph references allocation units in the parent for all data except those allocation units that differ between the parent and the clone. This is called COW (copy on write), and saves a lot of space wherever many clones of a golden image are present (e.g. copies of Ubuntu 22.04). Flattening creates a separate copy of these common volume blocks that is dedicated to the clone, decoupling parent and clone. This is useful if one wishes to delete the parent volume.

huangapple
  • 本文由 发表于 2023年6月19日 13:41:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/76503879.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定