containerized-data-importer/doc/clone-block-datavolume.md
Edu Gómez Escandell f3d0060353
Update DataVolume doc references from the 'pvc' API to the 'storage' API (#3244)
* Docs: Replace instances of pvc with storage

All instances of DataVolume > Spec > PVC have been replaced with storage,
except for two cases in datavolumes.md:
- Data Volumes>Target Storage/PVC>PVC
    https://github.com/kubevirt/containerized-data-importer/blob/338bafe/doc/datavolumes.md#pvc
- Data Volumes>Source>PVC source
    https://github.com/kubevirt/containerized-data-importer/blob/338bafe/doc/datavolumes.md#pvc-source

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Docs: Replace `Storage` with `storage` in doc/datavolumes.md

I also reworded it so that the paragraph does not start in lower-case.

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Docs: Remove optional default 'accessModes: ReadWriteOnce' from docs

Removed from storage options, I still kept it for the pvc.

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Docs: Remove resources/requests/storage when cloning a PVC

This argument is optional. Only removed for 'storage', not 'pvc'.

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Replace 'pvc' with 'storage' API in manifests

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Docs: Moved 'Target Storage/PVC' section above 'Source'

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Docs: Rephrase the Storage target section to emphasize it over PVC

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Fix empty field in YAML file

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Rephrase prose around filesystem volume mode

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Fix grammar and spelling

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Write acces mode in upgrade-testing-artifacts manifest

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Update doc/datavolumes.md

Co-authored-by: Alexander Wels <awels@redhat.com>
Signed-off-by: Edu Gómez Escandell <edu1997xyz@gmail.com>

---------

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
Signed-off-by: Edu Gómez Escandell <edu1997xyz@gmail.com>
Co-authored-by: Alexander Wels <awels@redhat.com>
2024-06-07 19:02:12 +02:00

1.1 KiB

How to clone an image from a PV to a block PV

The purpose of this document is to show how to clone an image from an existing (file system or block) DV/PVC, to a target block PV.

Prerequisites

  • You have a Kubernetes cluster up and running with CDI installed, source DV/PVC, and at least one available block PersistentVolume to store the cloned disk image.
  • When cloning from file system to block, content type must be kubevirt (default) in both source and target, and host-assisted clone is used.
  • Feature-Gate 'BlockVolume' is enabled.

Clone an image with DataVolume manifest

Create the following DataVolume manifest (clone-block-datavolume.yaml):

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: clone-block-datavolume
spec:
  source:
    pvc:
      namespace: "source-ns"
      name: "source-datavolume"
  storage:
    volumeMode: Block

Deploy the DataVolume manifest:

kubectl create -f clone-block-pv-datavolume.yaml

Two cloning pods, source and target, will be spawned and the image existed on the source block PV, will be copied to the target block PV.