Skip to content

Raw block volume snapshot failure #41

Closed
@madhurnawandar

Description

@madhurnawandar

Raw block volume snapshot fails with error like:

 Warning  SnapshotCreationFailed  6s    csi-snapshotter csi-hostpath  Failed to create snapshot: failed to take snapshot of the volume, pvc-cb8d96b6-5d40-11e9-bcc0-0236f32917fe: "rpc error: code = Internal desc = failed create snapshot: exit status 1: tar: can't change directory to '/csi-data-dire6fc6eb8-5d40-11e9-97b2-0236f32917fe': Not a directory\n"

There are 2 reasons to this:
1 : Following constants are defined incorrect:

provisionRoot      = "/csi-data-dir"
snapshotRoot       = "/csi-data-dir"

Thjey should be

provisionRoot      = "/csi-data-dir/"
snapshotRoot       = "/csi-data-dir/"

2: In case of raw block volumes the volume content comes as a single file as against a directory in case of a filesystem volume. So the tar command with -C option won't work. Instead, a tar file should be created directly from the file corresponding to the raw block volume. Something like

tar czf <tar_fikle_name> <file_for_raw_block_volume>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions