https://github.com/kvaps/linstor-csi-migrator
Convert old LINSTOR flexVolumes to CSI
https://github.com/kvaps/linstor-csi-migrator
csi flexvolume linstor
Last synced: 8 months ago
JSON representation
Convert old LINSTOR flexVolumes to CSI
- Host: GitHub
- URL: https://github.com/kvaps/linstor-csi-migrator
- Owner: kvaps
- License: gpl-3.0
- Created: 2019-03-27T20:05:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T13:33:18.000Z (about 7 years ago)
- Last Synced: 2024-12-28T02:31:02.257Z (over 1 year ago)
- Topics: csi, flexvolume, linstor
- Language: Shell
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# linstor-csi-migrator
Convert old LINSTOR flexVolumes to CSI
### How it works
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.
* https://github.com/LINBIT/linstor-csi/issues/4 `flexvolume` (migrate flexvolumes to csi)
* https://github.com/LINBIT/linstor-csi/issues/7 `csi1` (migrate csi to use right volume names)
* https://github.com/LINBIT/linstor-csi/issues/11 `csi2` (update csi to use right driver name)
### Preparation
* Make sure that you have `jq` and `kubectl` installed 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
```
### Usage
* 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.sh` and apply the changes.
### Additional steps
* To avoid problems with pods termination, before upgrade `flexvolume` volumes, please stop all the workload.
* During `csi2` upgrade, 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`
```