openstack升级过程中持久化数据DB的升级

在openstack升级过程中,比较重要的部分就是对持久化数据的升级了,对于nova来说绝大多数持久化数据存储在数据库中,可以利用db sync对DB中的数据表进行升级。

以下是nova升级folsom版本到grizzly版本时DB的升级:

升级前DB:
Folsom Nova:
+-------------------------------------+ | Tables_in_nova | +-------------------------------------+ | agent_builds | | aggregate_hosts | | aggregate_metadata | | aggregates | | block_device_mapping | | bw_usage_cache | | cells | | certificates | | compute_node_stats | | compute_nodes | | console_pools | | consoles | | dns_domains | | fixed_ips | | floating_ips | | instance_faults | | instance_id_mappings | | instance_info_caches | | instance_metadata | | instance_system_metadata | | instance_type_extra_specs | | instance_type_projects | | instance_types | | instances | | iscsi_targets | | key_pairs | | migrate_version | | migrations | | networks | | provider_fw_rules | | quota_classes | | quota_usages | | quotas | | reservations | | s3_images | | security_group_instance_association | | security_group_rules | | security_groups | | services | | sm_backend_config | | sm_flavors | | sm_volume | | snapshot_id_mappings | | snapshots | | task_log | | virtual_interfaces | | virtual_storage_arrays | | volume_id_mappings | | volume_metadata | | volume_type_extra_specs | | volume_types | | volumes | +-------------------------------------+ 52 rows in set (0.00 sec)
mysql> select * from migrate_version; +---------------+------------------------------------------------------------------+---------+ | repository_id | repository_path | version | +---------------+------------------------------------------------------------------+---------+ | nova | /usr/lib/python2.6/site-packages/nova/db/sqlalchemy/migrate_repo | 133 | +---------------+------------------------------------------------------------------+---------+ 1 row in set (0.00 sec)

可以看到folsom版本的migrate_version是133版本。在grizzly的代码中以下代码是负责升级数据库的:

openstack升级过程中持久化数据DB的升级_第1张图片

运行db sync后Grizzly版本会将Folsom版本的数据导入,这期间会做一系列动作,最终版本好会升级为161。这些文件的文件名中“_”之前的数字代表了版本号。

升级后DB:
Grizzly Nova:
+--------------------------------------------+ | Tables_in_nova | +--------------------------------------------+ | agent_builds | | aggregate_hosts | | aggregate_metadata | | aggregates | | block_device_mapping | | bw_usage_cache | | cells | | certificates | | compute_node_stats | | compute_nodes | | console_pools | | consoles | | dns_domains | | fixed_ips | | floating_ips | | instance_actions | | instance_actions_events | | instance_faults | | instance_id_mappings | | instance_info_caches | | instance_metadata | | instance_system_metadata | | instance_type_extra_specs | | instance_type_projects | | instance_types | | instances | | iscsi_targets | | key_pairs | | migrate_version | | migrations | | networks | | provider_fw_rules | | quota_classes | | quota_usages | | quotas | | reservations | | s3_images | | security_group_default_rules | | security_group_instance_association | | security_group_rules | | security_groups | | services | | shadow_agent_builds | | shadow_aggregate_hosts | | shadow_aggregate_metadata | | shadow_aggregates | | shadow_block_device_mapping | | shadow_bw_usage_cache | | shadow_cells | | shadow_certificates | | shadow_compute_node_stats | | shadow_compute_nodes | | shadow_console_pools | | shadow_consoles | | shadow_dns_domains | | shadow_fixed_ips | | shadow_floating_ips | | shadow_instance_actions | | shadow_instance_actions_events | | shadow_instance_faults | | shadow_instance_id_mappings | | shadow_instance_info_caches | | shadow_instance_metadata | | shadow_instance_system_metadata | | shadow_instance_type_extra_specs | | shadow_instance_type_projects | | shadow_instance_types | | shadow_instances | | shadow_iscsi_targets | | shadow_key_pairs | | shadow_migrate_version | | shadow_migrations | | shadow_networks | | shadow_provider_fw_rules | | shadow_quota_classes | | shadow_quota_usages | | shadow_quotas | | shadow_reservations | | shadow_s3_images | | shadow_security_group_instance_association | | shadow_security_group_rules | | shadow_security_groups | | shadow_services | | shadow_sm_backend_config | | shadow_sm_flavors | | shadow_sm_volume | | shadow_snapshot_id_mappings | | shadow_snapshots | | shadow_task_log | | shadow_virtual_interfaces | | shadow_virtual_storage_arrays | | shadow_volume_id_mappings | | shadow_volume_metadata | | shadow_volume_type_extra_specs | | shadow_volume_types | | shadow_volume_usage_cache | | shadow_volumes | | sm_backend_config | | sm_flavors | | sm_volume | | snapshot_id_mappings | | snapshots | | task_log | | virtual_interfaces | | virtual_storage_arrays | | volume_id_mappings | | volume_metadata | | volume_type_extra_specs | | volume_types | | volume_usage_cache | | volumes | +--------------------------------------------+ 111 rows in set (0.00 sec) mysql> select * from migrate_version; +---------------+------------------------------------------------------------------+---------+ | repository_id | repository_path | version | +---------------+------------------------------------------------------------------+---------+ | nova | /usr/lib/python2.6/site-packages/nova/db/sqlalchemy/migrate_repo | 161 | +---------------+------------------------------------------------------------------+---------+ 1 row in set (0.00 sec)



你可能感兴趣的:(DB,openstack,升级)