rbd clone
ceph brd的克隆所采用的是COW,叫做copy on write,也就是常说的“写时复制”。克隆是指基于快照创建的克隆只创建了映射到源的逻辑,还没有给克隆分配真实的物理空间。当对克隆的镜像执行写操作时,系统才会真正的给克隆的镜像分配物理空间。当对克隆的镜像没有写而只是读的时候,那么读取的时被克隆的快照。因此,从快照克隆的镜像是依赖于快照的,一旦快照被删除则这个克隆的镜像也就毁了,所以需要保护这个快照。如果想要克隆独立存在,不依赖于快照,需要对克隆和快照做一个合并(flattern)。
rbd copy & rbd clone
https://docs.ceph.com/docs/nautilus/man/8/rbd/
ceph N版出现了rbd copy和rbd deep copy,区别在于,deep copy会拷贝源镜像的快照,而copy不会
cp (src-image-spec | src-snap-spec) dest-image-spec
Copy the content of a src-image into the newly created dest-image. dest-image will have the same size, object size, and image format as src-image.
deep cp (src-image-spec | src-snap-spec) dest-image-spec
Deep copy the content of a src-image into the newly created dest-image. Dest-image will have the same size, object size, image format, and snapshots as src-image.
![](https://img.haomeiwen.com/i13005853/6d0fce800598dc32.png)
网友评论