From 73f82b42172c7be9bfaab959d8a34d8a372e05ad Mon Sep 17 00:00:00 2001 From: shubham Date: Mon, 1 Mar 2021 14:14:57 +0530 Subject: [PATCH 1/3] refact(migrate): improve logs and docs about multiple cstorvolume apis Signed-off-by: shubham --- cmd/migrate/executor/cstor_pool.go | 4 +++- docs/migration.md | 1 + pkg/version/util.go | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/migrate/executor/cstor_pool.go b/cmd/migrate/executor/cstor_pool.go index 97d1d0cf..dd298972 100644 --- a/cmd/migrate/executor/cstor_pool.go +++ b/cmd/migrate/executor/cstor_pool.go @@ -87,6 +87,8 @@ func (m *MigrateOptions) RunCStorSPCMigrate() error { return errors.Errorf("Failed to migrate cStor SPC : %s", m.spcName) } klog.Infof("Successfully migrated spc %s to cspc", m.spcName) - + klog.Infof("Make sure to migrate the associated PVCs, " + + "to find the old PVCs use `kubectl get cstorvolume.openebs.io -n `, " + + "and to get the migrated PVCs use `kubectl get cstorvolume.cstor.openebs.io -n `") return nil } diff --git a/docs/migration.md b/docs/migration.md index 20bdd211..d00b17ff 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -127,6 +127,7 @@ I0520 10:01:25.798889 1 pool.go:80] Successfully migrated spc sparse-claim **Note: In case the job fails for any reason please do not scale up the old CSP deployments. It can lead to data corruption.** +Make sure to migrate the associated PVCs, to find the old PVCs use `kubectl get cstorvolume.openebs.io -n ` and to get the migrated PVCs use `kubectl get cstorvolume.cstor.openebs.io -n ` ## cStor External Provisioned volumes to cStor CSI volumes diff --git a/pkg/version/util.go b/pkg/version/util.go index d385c917..3d426907 100644 --- a/pkg/version/util.go +++ b/pkg/version/util.go @@ -25,6 +25,7 @@ var ( "1.10.0": true, "1.11.0": true, "1.12.0": true, "2.0.0": true, "2.1.0": true, "2.2.0": true, "2.3.0": true, "2.4.0": true, "2.4.1": true, "2.5.0": true, "2.6.0": true, + "2.7.0": true, } validDesiredVersion = strings.Split(GetVersion(), "-")[0] ) From 4e3bdf05f2aea6b12e886c101dc734ec643737c0 Mon Sep 17 00:00:00 2001 From: shubham Date: Mon, 1 Mar 2021 18:21:15 +0530 Subject: [PATCH 2/3] addressed review comments Signed-off-by: shubham --- cmd/migrate/executor/cstor_pool.go | 8 +++++--- docs/migration.md | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/migrate/executor/cstor_pool.go b/cmd/migrate/executor/cstor_pool.go index dd298972..4b38c7ec 100644 --- a/cmd/migrate/executor/cstor_pool.go +++ b/cmd/migrate/executor/cstor_pool.go @@ -87,8 +87,10 @@ func (m *MigrateOptions) RunCStorSPCMigrate() error { return errors.Errorf("Failed to migrate cStor SPC : %s", m.spcName) } klog.Infof("Successfully migrated spc %s to cspc", m.spcName) - klog.Infof("Make sure to migrate the associated PVCs, " + - "to find the old PVCs use `kubectl get cstorvolume.openebs.io -n `, " + - "and to get the migrated PVCs use `kubectl get cstorvolume.cstor.openebs.io -n `") + + klog.Infof("Make sure to migrate the associated PVs, "+ + "to list CStorVolumes for the PVs which are pending migration use `kubectl get cstorvolume.openebs.io -n %s -l openebs.io/storage-pool-claim=%s`, "+ + "and to list CStorVolumes for the migrated/CSI PVs use `kubectl get cstorvolume.cstor.openebs.io -n %s`", + m.openebsNamespace, m.spcName, m.openebsNamespace) return nil } diff --git a/docs/migration.md b/docs/migration.md index d00b17ff..63e16f8d 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -127,7 +127,7 @@ I0520 10:01:25.798889 1 pool.go:80] Successfully migrated spc sparse-claim **Note: In case the job fails for any reason please do not scale up the old CSP deployments. It can lead to data corruption.** -Make sure to migrate the associated PVCs, to find the old PVCs use `kubectl get cstorvolume.openebs.io -n ` and to get the migrated PVCs use `kubectl get cstorvolume.cstor.openebs.io -n ` +Make sure to migrate the associated PVs, to list CStorVolumes for the PVs which are pending for migration use `kubectl get cstorvolume.openebs.io -n -l openebs.io/storage-pool-claim=` and to list CStorVolumes for the migrated/CSI PVs use `kubectl get cstorvolume.cstor.openebs.io -n ` ## cStor External Provisioned volumes to cStor CSI volumes From 51656462bb104ea448d525e66cd5678932cc66ad Mon Sep 17 00:00:00 2001 From: shubham Date: Tue, 2 Mar 2021 10:45:04 +0530 Subject: [PATCH 3/3] added changelog for the PR Signed-off-by: shubham --- changelogs/unreleased/96-shubham14bajpai | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/96-shubham14bajpai diff --git a/changelogs/unreleased/96-shubham14bajpai b/changelogs/unreleased/96-shubham14bajpai new file mode 100644 index 00000000..a8b0a104 --- /dev/null +++ b/changelogs/unreleased/96-shubham14bajpai @@ -0,0 +1 @@ +refact(migrate): improve logs and docs about multiple cstorvolume apis