Skip to content

A tool that facilitates the migration from Charmed Openstack to Sunbeam.

License

Notifications You must be signed in to change notification settings

canonical/openstack-migrate

Repository files navigation

openstack-migrate

openstack-migrate facilitates the migration from Charmed Openstack to Canonical OpenStack (Sunbeam).

The tool is designed with simplicity and versatility in mind, relying only on public OpenStack APIs. As such, it can migrate between different OpenStack distributions and even different releases.

It models resource hierarchies and ownership, which are automatically handled during the migration process.

Documentation

Potential future improvements

  • Add new resource migration handlers.
  • Implement additional volume migration mechanisms. See the volume migration guide for more details.
  • Instead of dry runs, have migration plans similar to Terraform plans. The user could then see the resources that are going to be migrated, trigger the migration plan and then check the migration status for the specified plan. The resource dependencies could be modeled through a tree.
  • Cross-tenant keypair and secret migrations
    • The keypairs do not have an unique ID. Cross-tenant requests must include the keypair name and the project/user ID, even get/list.
    • We'd need to include the owner information along with the resource id in:
      • get_source_resource_ids -> may return a Resource object
      • perform_individual_migration
      • get_associated_resources
      • The migration start command
      • internal database queries and Openstack requests that currently rely solely on the resource ID
    • We have a similar situation with Barbican secrets and secret containers, where we aren't normally allowed to retrieve secrets owned by other projects.

Integration tests

openstack_migrate/tests/integration contains integration tests that exercise every supported migration handler.

The following requirements must be installed first:

sudo apt-get update
sudo apt-get install -y tox nfs-common
sudo snap install --classic astral-uv

The tests receive a configuration file similar to the standard OPENSTACK_MIGRATE_CONFIG file, having a few additional test specific settings.

Use the following to invoke the tests:

$ export OPENSTACK_MIGRATE_CONFIG=~/migrate-config-test.yaml
$ cat > $OPENSTACK_MIGRATE_CONFIG <<EOF
log_level: info
cloud_config_file: /home/ubuntu/cloud-config.yaml
source_cloud_name: source-admin
destination_cloud_name: destination-admin
database_file: /home/ubuntu/.local/share/openstack-migrate/sqlite.db
preserve_volume_type: true

# settings used by the integration tests
skip_project_purge: true
image_id:  334ad443-352f-475b-8c9b-f16825455a3f
flavor_id: f128eb24-47ec-427a-a2a6-ccfbafce105f
EOF

$ tox -e integration

Use the -k parameter to specify which test(s) to run:

tox -e integration -- -k test_migrate_image_and_cleanup

A set of temporary credentials will be created for every test module. If multi-tenant mode is enabled, the tests will use one tenant for creating the test resources (the resource owner) and a separate tenant for initiating the migration (called "requester").

About

A tool that facilitates the migration from Charmed Openstack to Sunbeam.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors