2

我正在尝试将 Hyper-V 中的 nova-compute 与 Ubuntu 12.04 上的 devstack 连接,但出现此错误:

CRITICAL nova [-] (OperationalError) (1054, "Unknown column 'instances.server_name' in 'field list'") 'SELECT instances.created_at AS instances_created_at,instances.updated_at AS instances_updated_at,instances.deleted_at AS instances_deleted_at,instances.deleted AS instance_deleted,instances.id AS instances_id,instances.user_id AS instances_user_id,instances.project_id AS instances_project_id,instances.image_ref AS instances_image_ref,instances.kernel_id AS instances_kernel_id,instances.ramdisk_id AS instances_ramdisk_id,instances.server_name AS instances_server_name,instances.launch_index AS instances_launch_index, instance.key_name AS instances_key_name、instances.key_data AS instances_key_data、instances.power_state AS instances_power_state、instances。vm_state AS instances_vm_state、instances.task_state AS instances_task_state、instances.memory_mb AS instances_memory_mb、instances.vcpus AS instances_vcpus、instances.root_gb AS instances_root_gb、instances.ephemeral_gb AS instances_ephemeral_gb、instances.hostname AS instances_hostname、instances.host AS instances_host、instances.instance_type_id AS instance_instance_type_id、instances.user_data AS instances_user_data、instances.reservation_id AS instances_reservation_id、instances.scheduled_at AS instances_scheduled_at、instances.launched_at AS instances_launched_at、instances.terminated_at AS instances_terminated_at、instances.availability_zone AS instances_availability_zone、instances.display_name AS instances_display_name、instances.display_description AS instances_display_description,实例。launch_on AS instances_launched_on,instances.locked AS instances_locked,instances.os_type AS instances_os_type,instances.architecture AS instances_architecture,instances.vm_mode AS instances_vm_mode,instances.uuid AS instances_uuid,instances.root_device_name AS instances_root_device_name,instances.default_ephemeral_device AS instances_default_ephemeral_device,instances.default_swap_device AS instance_default_swap_device、instances.config_drive AS instances_config_drive、instances.access_ip_v4 AS instances_access_ip_v4、instances.access_ip_v6 AS instances_access_ip_v6、instances.auto_disk_config AS instances_auto_disk_config、instances.progress AS instances_progress、instances.shutdown_terminate AS instances_shutdown_terminate、instances.disable_terminate AS instances_disable_terminate、instance_types_1。created_at AS instance_types_1_created_at, instance_types_1.updated_at AS instance_types_1_updated_at, instance_types_1.deleted_at AS instance_types_1_deleted_at, instance_types_1.deleted AS instance_types_1_deleted, instance_types_1.id AS instance_types_1_id, instance_types_1.name AS instance_types_1_name, instance_types_1.memory_mb AS instance_types_1_memory_mb, instance_types_1.vcpus AS instance_types_1_vcpus, instance_types_1.root_gb AS instance_types_1_root_gb, instance_types_1.ephemeral_gb AS instance_types_1_ephemeral_gb, instance_types_1.flavorid AS instance_types_1_flavorid, instance_types_1.swap AS instance_types_1_swap, instance_types_1.rxtx_factor AS instance_types_1_rxtx_factor, instance_types_1.vcpu_weight AS instance_types_1_vcpu_weight, instance_types_1.disabled AS instance_types_1_disabled,instance_types_1.is_public AS instance_types_1_is_public, instance_info_caches_1.created_at AS instance_info_caches_1_created_at, instance_info_caches_1.updated_at AS instance_info_caches_1_updated_at, instance_info_caches_1.deleted_at AS instance_info_caches_1_deleted_at, instance_info_caches_1.deleted AS instance_info_caches_1_deleted, instance_info_caches_1.id AS instance_info_caches_1_id, instance_info_caches_1.network_info AS instance_info_caches_1_network_info, instance_info_caches_1.instance_uuid AS instance_info_caches_1_instance_uuid, security_groups_1. created_at AS security_groups_1_created_at、security_groups_1.updated_at AS security_groups_1_updated_at、security_groups_1.deleted_at AS security_groups_1_deleted_at、security_groups_1.deleted AS security_groups_1_deleted、security_groups_1。id AS security_groups_1_id, security_groups_1.name AS security_groups_1_name, security_groups_1.description AS security_groups_1_description, security_groups_1.user_id AS security_groups_1_user_id, security_groups_1.project_id AS security_groups_1_project_id, instance_metadata_1.created_at AS instance_metadata_1_created_at, instance_metadata_1.updated_at AS instance_metadata_1_updated_at, instance_metadata_1.deleted_at AS instance_metadata_1_deleted_at, instance_metadata_1.deleted AS instance_metadata_1_deleted, instance_metadata_1.id AS instance_metadata_1_id, instance_metadata_1。instance_metadata_1.created_at AS instance_metadata_1_created_at, instance_metadata_1.updated_at AS instance_metadata_1_updated_at, instance_metadata_1.deleted_at AS instance_metadata_1_deleted_at, instance_metadata_1.deleted AS instance_metadata_1_deleted, instance_metadata_1.id AS instance_metadata_1_id, instance._instance_metadata_1.created_at AS instance_metadata_1_created_at, instance_metadata_1.updated_at AS instance_metadata_1_updated_at, instance_metadata_1.deleted_at AS instance_metadata_1_deleted_at, instance_metadata_1.deleted AS instance_metadata_1_deleted, instance_metadata_1.id AS instance_metadata_1_id, instance._keyAS instance_metadata_1_key, instance_metadata_1.value AS instance_metadata_1_value, instance_metadata_1.instance_uuid AS instance_metadata_1_instance_uuid \nFROM instances LEFT OUTER JOIN instance_types AS instance_types_1 ON instances.instance_type_id = instance_types_1.id LEFT OUTER JOIN instance_info_caches AS instance_info_caches_1 ON instance_info_caches_1.instance_uuid = instances.uuid LEFT OUTER JOIN security_group_instance_association AS security_group_instance_association_1 ON security_group_instance_association_1.instance_uuid = instances.uuid AND instances.deleted = %s 左外连接 security_groups AS security_groups_1 ON security_groups_1.id = security_group_instance_association_1.security_group_id AND security_group_instance_association_1.deleted = %s AND security_groups_1。已删除 = %s 左外连接 instance_metadata AS instance_metadata_1 ON instance_metadata_1.instance_uuid = instances.uuid AND instance_metadata_1.deleted = %s \nWHERE instances.deleted = %s AND instances.host = %s' (0, 0, 0, 0, 0, 'WIN-NVR4BLPKAS1')

4

2 回答 2

2

数据库中的实例表中缺少一列。

它可能与代码过期;此命令将更新数据库:

nova-manage db sync

如果代码超级过时,该命令可能无法很好地工作,您可以向后同步,然后向前同步:

  1. 首先找到最早的版本:

    ls nova/db/sqlalchemy/migrate_repo/versions | 排序-n | 头

  2. 然后同步到那个版本:

    nova-manage db sync 112 # 如果 112 是列表中最早的

  3. 然后再次同步到最后:

    nova-管理数据库同步

如果这不起作用,您可以进入 mysql 并手动添加列:

alter table instances add column server_name varchar;

最后,您可以删除数据库,重新创建它然后进行同步(在 mysql 中):

drop database nova;
create database nova;
grant all on nova.* to openstack@localhost identified by 'openstack';

假设您的 nova db 用户名+密码是 openstack 和 openstack。(您可以从devstack localrc 获得

于 2012-12-05T20:34:09.650 回答
0

当我扩展到更多计算主机时,我遇到了完全相同的问题,当我解决这个问题时,我发现我有不同的 nova 服务版本,我添加了正确的存储库并删除了当前的 Openstack 计算和网络服务,重新安装并重新- 再次配置它们,一切顺利。

我正在使用 Havana 并添加了以下存储库。(我在所有机器上都使用 Centos)

百胜安装http://repos.fedorapeople.org/repos/openstack/openstack-havana/rdo-release-havana-6.noarch.rpm

百胜安装http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

于 2014-06-15T16:58:57.170 回答