Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(migrate): add support to correct blockdevices in spc before migration #53

Merged
merged 7 commits into from
Oct 6, 2020

Conversation

shubham14bajpai
Copy link
Contributor

@shubham14bajpai shubham14bajpai commented Sep 23, 2020

Signed-off-by: shubham [email protected]

This PR adds support for auto-correction of blockdevices in SPC before migration.

This case occurs if the underlying disks used are virtual disk and the spc was created in a version prior to 2.0.0 (the blockdevice issue was fixed in 2.0.0 release)

The changes make the migration job intelligent enough to find out the renamed blockdevices and update those in CSP and SPC before proceeding with the migration.

Local test performed:

Tested the following scenario for devlink based bds:

  • created a spc in 1.12.0 version and then detaching and reattaching the disk to the node.
  • installed 2.1.0 cspc-operator and migrated the spc using the job.

Tested the following scenarios for path based bds:

Scenario 1:

  • created two spcs with two bd each in 1.12.0 version and then detaching and reattaching the disk to the node.
  • now both spcs have one bd crossed with each other(spc1 has one bd for spc2 and vice versa)
  • installed 2.1.0 cspc-operator and migrated the spc using the job.

Scenario 2:

  • created two spcs with two bd each in 1.12.0 version and then detaching and reattaching the disk to the node.
  • now all the bds in spcs are interchanges(spc1 has all bds for spc2 and vice versa)
  • installed 2.1.0 cspc-operator and migrated the spc using the job.

Scenario 3:

  • created a spc with two bd in 1.12.0 version and two unclaimed bds and then detaching and reattaching the disk to the node.
  • now one bd in spc is changed with the unclaimed one
  • installed 2.1.0 cspc-operator and migrated the spc using the job.

The spc and csp were updated with the correct blockdevices and job was successful.

Copy link

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided few comments

pkg/migrate/cstor/blockdevice_correction.go Outdated Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
- it also fixes the idempotent nature of the job when
adding annotation to spc

Signed-off-by: shubham <[email protected]>
Copy link

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided few comments

pkg/migrate/cstor/pool.go Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Outdated Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Outdated Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Outdated Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Outdated Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
Copy link

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided few comments

pkg/migrate/cstor/blockdevice_correction.go Outdated Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Outdated Show resolved Hide resolved
Copy link

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provided few comments

pkg/migrate/cstor/blockdevice_correction.go Outdated Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
pkg/migrate/cstor/blockdevice_correction.go Show resolved Hide resolved
Signed-off-by: shubham <[email protected]>
Copy link

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are good

Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@prateekpandey14 prateekpandey14 merged commit 7c12aed into openebs-archive:master Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate virtual disk correction while cStor pool migration
4 participants