-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export Nydus images as block devices by using NBD #1139
Conversation
Refine v6 related code and add two fields to meta info. Signed-off-by: Jiang Liu <[email protected]>
Load the mapped_blkaddr field for each data blob, later it will be used compose a RAFS v6 image into a block device. Signed-off-by: Jiang Liu <[email protected]>
Add common code to compose a block device from a RAFS image, which then can used exposed through nbd/ublk/virtio-blk/vhost-user-blk etc. Signed-off-by: Jiang Liu <[email protected]>
Compose a block device from a RAFSv6 image, so all metadata/data content can be accessed by block address. The EROFS fs driver can be used to directly mount the block device. It depends on the blob_cache subsystem and can be used to implement nbd/ublk/virtio-blk/vhost-user-blk servers. Signed-off-by: Jiang Liu <[email protected]>
Implement NbdService which cooperates with the Linux nbd driver to expose RAFSv6 images as block devices. To simplify the implementation, the NbdService will directly talk with the nbd driver, instead of following a typical nbd-server and nbd-client architecture. Signed-off-by: Jiang Liu <[email protected]>
Add subcommand nbd to export nydus images as block devices through NBD. Signed-off-by: Jiang Liu <[email protected]>
@jiangliu , a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/54562 |
@hsiangkao , the title has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/54563 |
@hsiangkao , The CI test is completed, please check result:
Sorry, your test job failed. Please get the details in the link. |
Add method to load BlobCacheConfigV2 from configuration file. Signed-off-by: Jiang Liu <[email protected]>
@jiangliu , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/54565 |
@jiangliu , The CI test is completed, please check result:
Congratulations, your test job passed! |
Please follow the step to test block-nbd: cargo build --features block-nbd |
Tested-by: Jia Zhu <[email protected]> |
In order to support mounting multi-blobs container image as a single block device, add flattened block device feature for EROFS. In this mode, all meta/data contents will be mapped into one block space. User could compose a block device(by nbd/ublk/virtio-blk/ vhost-user-blk) from multiple sources and mount the block device by EROFS directly. It can reduce the number of block devices used, and it's also benefits in both VM file passthrough and distributed storage scenarios. You can test this using the method mentioned by: dragonflyoss/nydus#1139 1. Compose a (nbd)block device from multi-blobs. 2. Mount EROFS on mntdir/. 3. Compare the md5sum between source dir and mntdir/. Later, we could also use it to refer original tar blobs. Signed-off-by: Jia Zhu <[email protected]> Signed-off-by: Xin Yin <[email protected]> Reviewed-by: Jingbo Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Gao Xiang: refine commit message and use erofs_pos(). ] Signed-off-by: Gao Xiang <[email protected]>
In order to support mounting multi-blobs container image as a single block device, add flattened block device feature for EROFS. In this mode, all meta/data contents will be mapped into one block space. User could compose a block device(by nbd/ublk/virtio-blk/ vhost-user-blk) from multiple sources and mount the block device by EROFS directly. It can reduce the number of block devices used, and it's also benefits in both VM file passthrough and distributed storage scenarios. You can test this using the method mentioned by: dragonflyoss/nydus#1139 1. Compose a (nbd)block device from multi-blobs. 2. Mount EROFS on mntdir/. 3. Compare the md5sum between source dir and mntdir/. Later, we could also use it to refer original tar blobs. Signed-off-by: Jia Zhu <[email protected]> Signed-off-by: Xin Yin <[email protected]> Reviewed-by: Jingbo Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Gao Xiang: refine commit message and use erofs_pos(). ] Signed-off-by: Gao Xiang <[email protected]>
In order to support mounting multi-blobs container image as a single block device, add flattened block device feature for EROFS. In this mode, all meta/data contents will be mapped into one block space. User could compose a block device(by nbd/ublk/virtio-blk/ vhost-user-blk) from multiple sources and mount the block device by EROFS directly. It can reduce the number of block devices used, and it's also benefits in both VM file passthrough and distributed storage scenarios. You can test this using the method mentioned by: dragonflyoss/nydus#1139 1. Compose a (nbd)block device from multi-blobs. 2. Mount EROFS on mntdir/. 3. Compare the md5sum between source dir and mntdir/. Later, we could also use it to refer original tar blobs. Signed-off-by: Jia Zhu <[email protected]> Signed-off-by: Xin Yin <[email protected]> Reviewed-by: Jingbo Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Gao Xiang: refine commit message and use erofs_pos(). ] Signed-off-by: Gao Xiang <[email protected]>
In order to support mounting multi-blobs container image as a single block device, add flattened block device feature for EROFS. In this mode, all meta/data contents will be mapped into one block space. User could compose a block device(by nbd/ublk/virtio-blk/ vhost-user-blk) from multiple sources and mount the block device by EROFS directly. It can reduce the number of block devices used, and it's also benefits in both VM file passthrough and distributed storage scenarios. You can test this using the method mentioned by: dragonflyoss/nydus#1139 1. Compose a (nbd)block device from multi-blobs. 2. Mount EROFS on mntdir/. 3. Compare the md5sum between source dir and mntdir/. Later, we could also use it to refer original tar blobs. Signed-off-by: Jia Zhu <[email protected]> Signed-off-by: Xin Yin <[email protected]> Reviewed-by: Jingbo Xu <[email protected]> Acked-by: Chao Yu <[email protected]> Tested-by: Jiang Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Gao Xiang: refine commit message and use erofs_pos(). ] Signed-off-by: Gao Xiang <[email protected]>
In order to support mounting multi-blobs container image as a single block device, add flattened block device feature for EROFS. In this mode, all meta/data contents will be mapped into one block space. User could compose a block device(by nbd/ublk/virtio-blk/ vhost-user-blk) from multiple sources and mount the block device by EROFS directly. It can reduce the number of block devices used, and it's also benefits in both VM file passthrough and distributed storage scenarios. You can test this using the method mentioned by: dragonflyoss/nydus#1139 1. Compose a (nbd)block device from multi-blobs. 2. Mount EROFS on mntdir/. 3. Compare the md5sum between source dir and mntdir/. Later, we could also use it to refer original tar blobs. Signed-off-by: Jia Zhu <[email protected]> Signed-off-by: Xin Yin <[email protected]> Reviewed-by: Jingbo Xu <[email protected]> Acked-by: Chao Yu <[email protected]> Tested-by: Jiang Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Gao Xiang: refine commit message and use erofs_pos(). ] Signed-off-by: Gao Xiang <[email protected]>
In order to support mounting multi-blobs container image as a single block device, add flattened block device feature for EROFS. In this mode, all meta/data contents will be mapped into one block space. User could compose a block device(by nbd/ublk/virtio-blk/ vhost-user-blk) from multiple sources and mount the block device by EROFS directly. It can reduce the number of block devices used, and it's also benefits in both VM file passthrough and distributed storage scenarios. You can test this using the method mentioned by: dragonflyoss/nydus#1139 1. Compose a (nbd)block device from multi-blobs. 2. Mount EROFS on mntdir/. 3. Compare the md5sum between source dir and mntdir/. Later, we could also use it to refer original tar blobs. Signed-off-by: Jia Zhu <[email protected]> Signed-off-by: Xin Yin <[email protected]> Reviewed-by: Jingbo Xu <[email protected]> Acked-by: Chao Yu <[email protected]> Tested-by: Jiang Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Gao Xiang: refine commit message and use erofs_pos(). ] Signed-off-by: Gao Xiang <[email protected]>
In order to support mounting multi-blobs container image as a single block device, add flattened block device feature for EROFS. In this mode, all meta/data contents will be mapped into one block space. User could compose a block device(by nbd/ublk/virtio-blk/ vhost-user-blk) from multiple sources and mount the block device by EROFS directly. It can reduce the number of block devices used, and it's also benefits in both VM file passthrough and distributed storage scenarios. You can test this using the method mentioned by: dragonflyoss/nydus#1139 1. Compose a (nbd)block device from multi-blobs. 2. Mount EROFS on mntdir/. 3. Compare the md5sum between source dir and mntdir/. Later, we could also use it to refer original tar blobs. Signed-off-by: Jia Zhu <[email protected]> Signed-off-by: Xin Yin <[email protected]> Reviewed-by: Jingbo Xu <[email protected]> Acked-by: Chao Yu <[email protected]> Tested-by: Jiang Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Gao Xiang: refine commit message and use erofs_pos(). ] Signed-off-by: Gao Xiang <[email protected]>
With recent enhancement to Linux EROFS filesystem, a Nydus image can be organized as a block device.
Then the block device can be exposed through NBD/ublk/virtio-blk/vhost-user-block etc.
This PR enhance nydus-service and nydus-image to export Nydus images as block devices through NBD.