Openstack ansible 出现“NoSuchTableError:compute_nodes”

问题描述 投票:0回答:1

我正在尝试部署 Openstack 的实例。我已经取得了很多进步,但这个问题让我难住了; 当剧本设置 nova 时,它们似乎都运行良好,除了“运行 nova-status 升级检查以验证健康配置”

我尝试手动运行此任务,但在容器上遇到了同样的问题。

调试已开启,这是错误;

[root@infra1-nova-api-container-23349c06 ~]# /openstack/venvs/nova-27.0.0/bin/nova-status upgrade check
Traceback (most recent call last):
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table 'nova.compute_nodes' doesn't exist")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/dialects/mysql/base.py", line 3213, in _show_create_table
    rp = connection.execution_options(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1760, in exec_driver_sql
    return self._exec_driver_sql(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1669, in _exec_driver_sql
    ret = self._execute_context(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
    self._handle_dbapi_exception(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
    util.raise_(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'nova.compute_nodes' doesn't exist")
[SQL: SHOW CREATE TABLE `compute_nodes`]
(Background on this error at: https://sqlalche.me/e/14/f405)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/nova/cmd/status.py", line 341, in main
    ret = fn(*fn_args, **fn_kwargs)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/oslo_upgradecheck/upgradecheck.py", line 105, in check
    result = func(self)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/nova/cmd/status.py", line 143, in _check_cellsv2
    num_computes = self._count_compute_nodes()
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/nova/cmd/status.py", line 91, in _count_compute_nodes
    compute_nodes = sa.Table('compute_nodes', meta, autoload_with=engine)
  File "<string>", line 2, in __new__
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/util/deprecations.py", line 309, in warned
    return fn(*args, **kwargs)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/sql/schema.py", line 617, in __new__
    metadata._remove_table(name, schema)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
    compat.raise_(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/sql/schema.py", line 612, in __new__
    table._init(name, metadata, *args, **kw)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/sql/schema.py", line 687, in _init
    self._autoload(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/sql/schema.py", line 722, in _autoload
    conn_insp.reflect_table(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/reflection.py", line 757, in reflect_table
    tbl_opts = self.get_table_options(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/reflection.py", line 398, in get_table_options
    return self.dialect.get_table_options(
  File "<string>", line 2, in get_table_options
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/reflection.py", line 55, in cache
    ret = fn(self, con, *args, **kw)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/dialects/mysql/base.py", line 2831, in get_table_options
    parsed_state = self._parsed_state_or_create(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/dialects/mysql/base.py", line 3080, in _parsed_state_or_create
    return self._setup_parser(
  File "<string>", line 2, in _setup_parser
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/engine/reflection.py", line 55, in cache
    ret = fn(self, con, *args, **kw)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/dialects/mysql/base.py", line 3107, in _setup_parser
    sql = self._show_create_table(
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/dialects/mysql/base.py", line 3218, in _show_create_table
    util.raise_(exc.NoSuchTableError(full_name), replace_context=e)
  File "/openstack/venvs/nova-27.0.0/lib64/python3.9/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
sqlalchemy.exc.NoSuchTableError: `compute_nodes`
[DEFAULT]
# Logs / State
debug = True
use_stderr = True
use_journal = True
state_path = /var/lib/nova
service_down_time = 120
# Scheduler
cpu_allocation_ratio = 2.0
disk_allocation_ratio = 1.0
ram_allocation_ratio = 1.0
reserved_host_disk_mb = 2048
reserved_host_memory_mb = 2048
# Compute
compute_driver = libvirt.LibvirtDriver
instances_path = /var/lib/nova/instances
allow_resize_to_same_host = True
# Api's
enabled_apis = osapi_compute,metadata
# Rpc all
transport_url = rabbit://nova:<password>@172.19.238.242:5671//nova?ssl=1&ssl_version=TLSv1_2&ssl_ca_file=
# Network
my_ip = 172.19.239.31
# Hypervisor
default_ephemeral_format = ext4
# Ceilometer notification configurations
# Notifications

[oslo_messaging_notifications]
topics =
driver = noop
transport_url = rabbit://nova:<password>@172.19.238.242:5671//nova?ssl=1&ssl_version=TLSv1_2&ssl_ca_file=
# Messaging

[oslo_messaging_rabbit]
heartbeat_in_pthread = True
# Image cache

[image_cache]
manager_interval = 0

[cache]
enabled = true
backend = oslo_cache.memcache_pool
memcache_servers = 172.19.236.112:11211
# Cinder

[cinder]
catalog_info = volumev3:cinderv3:internalURL
os_region_name = RegionOne
auth_section = keystone_authtoken

[vnc]
enabled = True
novncproxy_base_url = https://172.19.238.6:6080/vnc_lite.html
novncproxy_host = 172.19.239.31
novncproxy_port = 6080
server_listen = 172.19.239.31
server_proxyclient_address = 172.19.239.31
auth_schemes = vencrypt,none
vencrypt_client_key = /etc/pki/nova-novncproxy/client-key.pem
vencrypt_client_cert = /etc/pki/nova-novncproxy/client-cert.pem
vencrypt_ca_certs = /etc/pki/nova-novncproxy/ca-cert.pem
# Glance

[glance]
insecure = False
# Neutron

[neutron]
region_name = RegionOne
auth_type = password
default_floating_pool = public
username = nova
password = 38e15d3d6a2a0ffbb751b81
project_name = service
user_domain_id = default
project_domain_id = default
auth_url = http://172.19.238.0:5000/v3
insecure = False
metadata_proxy_shared_secret = <password>
service_metadata_proxy = True

[placement]
region_name = RegionOne
auth_type = password
username = nova
password = <password>
project_name = service
user_domain_id = default
project_domain_id = default
auth_url = http://172.19.238.0:5000/v3
insecure = False

[conductor]
workers = 6

[service_user]
send_service_user_token = True
region_name = RegionOne
auth_type = password
username = nova
password = <password>
project_name = service
user_domain_id = default
project_domain_id = default
auth_url = http://172.19.238.0:5000/v3
insecure = False

[keystone_authtoken]
insecure = False
auth_type = password
auth_url = http://172.19.238.0:5000
www_authenticate_uri = http://172.19.238.0:5000
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = <password>
region_name = RegionOne
service_token_roles_required = True
service_token_roles = service
service_type = compute
memcached_servers = 172.19.236.112:11211
token_cache_time = 300
# if your memcached server is shared, use these settings to avoid cache poisoning
memcache_security_strategy = ENCRYPT
memcache_secret_key = <password>

[database]
connection = mysql+pymysql://nova:<password>@172.19.237.254:3306/nova?charset=utf8&ssl_verify_cert=true
max_overflow = 50
max_pool_size = 5
pool_timeout = 30
connection_recycle_time = 600

[api_database]
connection = mysql+pymysql://nova_api:<password>@172.19.237.254:3306/nova_api?charset=utf8&ssl_verify_cert=true
max_overflow = 50
max_pool_size = 5
pool_timeout = 30
connection_recycle_time = 600

[oslo_concurrency]
lock_path = /run/lock/nova

[libvirt]
inject_partition = -2
inject_password = False
inject_key = False
virt_type = qemu
cpu_mode = none
live_migration_with_native_tls = true
live_migration_scheme = tls
live_migration_inbound_addr = 172.19.239.31
hw_disk_discard = ignore
disk_cachemodes =

[wsgi]
api_paste_config = /etc/nova/api-paste.ini
[api]
vendordata_jsonfile_path = /etc/nova/vendor_data.json
dhcp_domain = openstacklocal

[scheduler]
workers = 6
max_attempts = 5
discover_hosts_in_cells_interval = 60

[filter_scheduler]
max_io_ops_per_host = 10
ram_weight_multiplier = 5.0
enabled_filters = ComputeFilter,AggregateNumInstancesFilter,AggregateIoOpsFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,NUMATopologyFilter
host_subset_size = 1
track_instance_changes = True

[upgrade_levels]
compute = auto

我已经尝试删除 nova 数据库,以便剧本可以再次生成它们,但不确定为什么会发生这种情况。

任何线索或帮助将不胜感激。谢谢

尝试重新运行剧本。第一个错误是缺少与数据库的连接(由不正确的 haproxy 配置引起),因此我将其指向 gallera 容器的 IP,而不是 haproxy IP,这导致连接工作正常,但随后发生了这种情况。我尝试删除数据库并让剧本重新创建它们。

openstack openstack-nova
1个回答
0
投票

手动运行 nova-manage db 同步并清除错误。

© www.soinside.com 2019 - 2024. All rights reserved.