Skip to content

Commit

Permalink
fix(xfs): fixing xfs duplicate uuid for cloned volumes
Browse files Browse the repository at this point in the history
for mounting the cloned volume for xfs, a new UUID has to be generated.
We are generating a new UUID for the cloned volumes which are formatted
as xfs using xfs_admin command.

Signed-off-by: Pawan <pawan@mayadata.io>
  • Loading branch information
pawanpraka1 authored and kmova committed Mar 19, 2020
1 parent 1c9ee31 commit 468bf66
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/zfs/zfs_util.go
Expand Up @@ -361,6 +361,16 @@ func CreateClone(vol *apis.ZFSVolume) error {
logrus.Infof("using existing clone volume %v", volume)
}

if vol.Spec.FsType == "xfs" {
// for mounting the cloned volume for xfs, a new UUID has to be generated
device := ZFS_DEVPATH + volume
cmd := exec.Command("xfs_admin", "-U", "generate", device)
out, err := cmd.CombinedOutput()
if err != nil {
logrus.Errorf("zfspv: Clone XFS uuid generate failed error: %s", string(out))
return err
}
}
return nil
}

Expand Down

0 comments on commit 468bf66

Please sign in to comment.