Hyper-V nova-compute错误

时间:2012-12-04 14:37:29

标签: openstack-nova

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

  

CRITICAL nova [ - ](OperationalError)(1054,"未知栏目   ' instances.server_name'在'字段列表'")' 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   instances_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,instances.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   instances_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,instances.launched_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   instances_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。key AS   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实例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开启   security_group_instance_association_1.instance_uuid = instances.uuid   AND instances.deleted =%s LEFT OUTER JOIN 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.deleted =%s LEFT OUTER JOIN 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&#39)

2 个答案:

答案 0 :(得分:2)

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

代码可能已过时;此命令将更新DB:

nova-manage db sync

如果代码超级过时,该命令可能无法正常运行,您可以向后同步,然后向前同步:

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

    ls nova / db / sqlalchemy / migrate_repo / versions | sort -n |头

  2. 然后同步到该版本:

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

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

    nova-manage db sync

  4. 如果这不起作用,您可以进入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

    获得

答案 1 :(得分:0)

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

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

yum install http://repos.fedorapeople.org/repos/openstack/openstack-havana/rdo-release-havana-6.noarch.rpm

yum install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm