Convert old LINSTOR flexVolumes to CSI
Script takes PersistentVolumes with Linstor flexVolume driver or old-style CSI metadata, which stopped working after last update of linstor csi-plugin and generates commands for update their metadata to use with new csi-plugin.
- piraeusdatastore/linstor-csi#4
flexvolume(migrate flexvolumes to csi) - piraeusdatastore/linstor-csi#7
csi1(migrate csi to use right volume names) - piraeusdatastore/linstor-csi#11
csi2(update csi to use right driver name)
-
Make sure that you have
jqandkubectlinstalled in your system. -
Download the script:
curl -LO https://github.com/kvaps/linstor-csi-migrator/raw/master/linstor-csi-migrator.sh chmod +x linstor-csi-migrator.sh
-
Make sure that you have access to list PVs in your cluster.
-
Generate commands:
# FlexVolumes: ./linstor-csi-migrator.sh flexvolume > flexvolume_commands.sh # Old format CSIs: ./linstor-csi-migrator.sh csi1 > csi1_commands.sh # CSIs with old driver name: ./linstor-csi-migrator.sh csi2 > csi2_commands.sh -
Create backup of your Persistent Volumes:
kubectl get pv -o json > pv.json -
Now you can open
*_commands.shand apply the changes.
-
To avoid problems with pods termination, before upgrade
flexvolumevolumes, please stop all the workload. -
During
csi2upgrade, you should also change drivername for running pods, on every node run:sed -i 's/io.drbd.linstor-csi/linstor.csi.linbit.com/g' `find /var/lib/kubelet/pods/ -mindepth 5 -maxdepth 5 -name vol_data.json`