Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cloud/g1-g2-ostack-cloud-migration
  • 536644/g1-g2-ostack-cloud-migration
2 results
Show changes
Commits on Source (2)
...@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [1.10.1] - 2025-02-05
### Added
- Added --source-keypair-matching-mode switch to tolerate multiple ambiguous ostack keypairs
## [1.9.14] - 2024-12-18 ## [1.9.14] - 2024-12-18
### Fixed ### Fixed
- Fixed flavor mapping for `hpc.16core-64ram-ssd-ephem` changed from `p3.*` to `r3.*` - Fixed flavor mapping for `hpc.16core-64ram-ssd-ephem` changed from `p3.*` to `r3.*`
......
...@@ -402,12 +402,20 @@ def get_src_server_keypair(args, source_keypairs, src_server): ...@@ -402,12 +402,20 @@ def get_src_server_keypair(args, source_keypairs, src_server):
"Re-dump source OpenStack keypairs to ceph migrator server node and retry migration.") "Re-dump source OpenStack keypairs to ceph migrator server node and retry migration.")
# select keypairs based on key_name and user_id # select keypairs based on key_name and user_id
source_keypairs_by_name_and_user = filter_keypairs(source_keypairs_by_name, "user_id", src_server.user_id) source_keypairs_by_name_and_user = filter_keypairs(source_keypairs_by_name, "user_id", src_server.user_id)
log_or_assert(args, if args.source_keypair_matching_mode == 'strict':
f"F.7 Single (unambiguous) Source OpenStack server keypair found ({src_server.key_name}) when searching with key_name only.", log_or_assert(args,
len(source_keypairs_by_name_and_user) > 0 or len(source_keypairs_by_name) < 2, f"F.7 Single (unambiguous) Source OpenStack server keypair found ({src_server.key_name}) when searching with key_name only.",
msg_guidance="We encountered situation when we are unable to detect source keypair. Search with (key_name, used_id) returned " len(source_keypairs_by_name_and_user) > 0 or len(source_keypairs_by_name) < 2,
"no result and search with key_name only returned multiple results. " msg_guidance="We encountered situation when we are unable to detect source keypair. Search with (key_name, used_id) returned "
"Most likely it is necessary to reimplement olib.get_or_create_dst_server_keypair().") "no result and search with key_name only returned multiple results. "
"Most likely it is necessary to reimplement olib.get_or_create_dst_server_keypair().")
elif args.source_keypair_matching_mode == 'tolerant':
log_or_assert(args,
f"F.7 Usable Source OpenStack server keypair found ({src_server.key_name}) when searching with key_name only.",
len(source_keypairs_by_name_and_user) > 0 or len(source_keypairs_by_name) > 0,
msg_guidance="We encountered situation when we are unable to detect source keypair. Search with (key_name, used_id) returned "
"no result and search with key_name only returned multiple results. "
"In --source-keypair-matching-mode=tolerant mode we pick first keypair matching.")
if not source_keypairs_by_name_and_user: if not source_keypairs_by_name_and_user:
args.logger.warning(f"F.7 No source keypair found when selecting by (key_name={src_server.key_name}, used_id={src_server.user_id}). " args.logger.warning(f"F.7 No source keypair found when selecting by (key_name={src_server.key_name}, used_id={src_server.user_id}). "
"Using selection by key_name only.") "Using selection by key_name only.")
......
...@@ -360,6 +360,8 @@ if __name__ == "__main__": ...@@ -360,6 +360,8 @@ if __name__ == "__main__":
help='Destination OpenStack/ceph cloud "ephemeral on ceph" or "libvirt ephemeral" pool name') help='Destination OpenStack/ceph cloud "ephemeral on ceph" or "libvirt ephemeral" pool name')
AP.add_argument('--source-keypair-xml-dump-file', default='/root/migrator/prod-nova_api_key_pairs.dump.xml', AP.add_argument('--source-keypair-xml-dump-file', default='/root/migrator/prod-nova_api_key_pairs.dump.xml',
help='Source OpenStack cloud keypair SQL/XML dump file name (on ceph-migrator-host)') help='Source OpenStack cloud keypair SQL/XML dump file name (on ceph-migrator-host)')
AP.add_argument('--source-keypair-matching-mode', default='strict', choices=['strict', 'tolerant'],
help='Mode of matching source ostack keypair. Strict requires at most one match, tolerant requires at least one match and picks the first one')
AP.add_argument('--source-servers-left-shutoff', default=False, required=False, action='store_true', AP.add_argument('--source-servers-left-shutoff', default=False, required=False, action='store_true',
help='Migrated source servers are left SHUTOFF (i.e. not started automatically).') help='Migrated source servers are left SHUTOFF (i.e. not started automatically).')
AP.add_argument('--destination-bootable-volume-image-name', default='cirros-0-x86_64', AP.add_argument('--destination-bootable-volume-image-name', default='cirros-0-x86_64',
......