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(block_volume): support migration from instance volume #2922

Merged

Conversation

Codelax
Copy link
Member

@Codelax Codelax commented Feb 14, 2025

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

resource scaleway_instance_volume volume {
	type = "b_ssd"
	size_in_gb = 20
}

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.

resource scaleway_instance_volume volume {
	type = "b_ssd"
	size_in_gb = 20
	migrate_to_sbs = true
}

resource scaleway_block_volume volume {
	iops = 5000
	instance_volume_id = scaleway_instance_volume.volume.id
	size_in_gb = 20
}

When doing migration, the new resource block_volume will have the same ID as the old instance_volume. If you replace your usage of scaleway_instance_volume.volume.id to scaleway_block_volume.volume.id, it should not trigger any changes.

resource scaleway_block_volume volume {
	iops = 5000
	size_in_gb = 20
}

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

@Codelax Codelax added enhancement instance Instance issues, bugs and feature requests sbs Scaleway Block Storage issues, bugs and feature requests labels Feb 14, 2025
@Codelax Codelax force-pushed the feat/instance-block-migrate-sbs-volumes branch from 8dfb0dd to 379c74a Compare February 14, 2025 09:12
@Codelax Codelax marked this pull request as ready for review February 14, 2025 14:57
@remyleone remyleone added the priority:high New features label Feb 14, 2025
@Codelax Codelax force-pushed the feat/instance-block-migrate-sbs-volumes branch from 60f7ec6 to 5a5cb08 Compare February 14, 2025 15:03
@remyleone remyleone added this pull request to the merge queue Feb 17, 2025
Merged via the queue into scaleway:master with commit 0f02db0 Feb 17, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement instance Instance issues, bugs and feature requests priority:high New features sbs Scaleway Block Storage issues, bugs and feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants