volume: add capability to change disk type when moving a volume

This commit is contained in:
Chris Lu
2021-02-09 23:58:08 -08:00
parent 2bf5ea87d6
commit 770393a48c
6 changed files with 648 additions and 628 deletions

View File

@@ -54,7 +54,11 @@ func (vs *VolumeServer) VolumeCopy(ctx context.Context, req *volume_server_pb.Vo
return fmt.Errorf("read volume file status failed, %v", err)
}
location := vs.store.FindFreeLocation(storage.DiskType(volFileInfoResp.DiskType))
diskType := volFileInfoResp.DiskType
if req.DiskType != "" {
diskType = req.DiskType
}
location := vs.store.FindFreeLocation(storage.DiskType(diskType))
if location == nil {
return fmt.Errorf("no space left")
}