feat(block_volume): support migration from instance volume #2922
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provide a solution to easily migrate from instance_volume to block_volume.
This is done in 2 steps:
Starting from your terraform config with your instance_volume
You can use the new field
migrate_to_sbs
on your instance's volume to prevent it from synced, thus preventing terraform from detecting that the volume does not exist after its migration. If detected as deleted, terraform would trigger back the creation of the volume.When doing migration, the new resource
block_volume
will have the same ID as the oldinstance_volume
. If you replace your usage ofscaleway_instance_volume.volume.id
toscaleway_block_volume.volume.id
, it should not trigger any changes.The last step is to remove the usage of
scaleway_instance_volume
, it required multiple steps but you should have migrated to the new SBS api.The goal of this steps is to provide an easy migration plan to use the new SBS api for your old volumes.
Without this migration plan, any user would need to do a manual migration an tinker with terraform's state