当设置三张网卡的时候,可能会出现ping不通baidu.com
解决方案:三张网卡只选管理网卡做为默认网关即可,gateway4只配置在eth0,可解决
eg.1 执行su -s /bin/sh -c "glance-manage db_sync" glance 报错 
ERROR glance sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1044, "Access denied for user 'glance'@'%' to database 'glance'")
解决方案:进入数据库,对glance用户重新授权,见4.1

eg.2 执行glance image-create --name "cirros-0.4.0" \
>   --file cirros-0.4.0-x86_64-disk.img \
>   --disk-format qcow2 --container-format bare \
>   --visibility=public
HTTP 403 Forbidden: You are not authorized to complete publicize_image action.
解决方案:查看/etc/glance/glance-api.conf是否有添加如下配置并去除空行
[paste_deploy]
flavor = keystone

eg.1 执行su -s /bin/sh -c "placement-manage db sync" placement 报错 
1044, "Access denied for user 'placement'@'%' to database 'placement'"
解决方案:
1 查看授权表,发现权限没有被打开
SELECT host,user,password,Grant_priv,Super_priv FROM mysql.user;
+-----------+-----------+-------------------------------------------+------------+------------+
| host      | user      | password                                  | Grant_priv | Super_priv |
+-----------+-----------+-------------------------------------------+------------+------------+
| localhost | root      | *2683A2B8A9DE120C7B5CC6D45B5F7A2E708FAFCF | Y          | Y          |
| localhost | keystone  | *2431959D1DBB9DEF2BB0E90F0C08387220989A5F | N          | N          |
| %         | keystone  | *2431959D1DBB9DEF2BB0E90F0C08387220989A5F | N          | N          |
| %         | root      | *2683A2B8A9DE120C7B5CC6D45B5F7A2E708FAFCF | N          | N          |
| localhost | glance    | *4BED54445326D0D3477C30025D66AF8911CA854F | N          | N          |
| %         | glance    | *4BED54445326D0D3477C30025D66AF8911CA854F | N          | N          |
| localhost | placement | *7F75AD3C141B7CD8E66685A5505B1630D896092F | N          | N          |
| %         | placement | *7F75AD3C141B7CD8E66685A5505B1630D896092F | N          | N          |
+-----------+-----------+-------------------------------------------+------------+------------+
2 更新用户权限:
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';
或者 
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'devops';
FLUSH PRIVILEGES;
+-----------+-----------+-------------------------------------------+------------+------------+
| host      | user      | password                                  | Grant_priv | Super_priv |
+-----------+-----------+-------------------------------------------+------------+------------+
| localhost | root      | *2683A2B8A9DE120C7B5CC6D45B5F7A2E708FAFCF | Y          | Y          |
| localhost | keystone  | *2431959D1DBB9DEF2BB0E90F0C08387220989A5F | N          | N          |
| %         | keystone  | *2431959D1DBB9DEF2BB0E90F0C08387220989A5F | N          | N          |
| %         | root      | *2683A2B8A9DE120C7B5CC6D45B5F7A2E708FAFCF | Y          | Y          |
| localhost | glance    | *4BED54445326D0D3477C30025D66AF8911CA854F | N          | N          |
| %         | glance    | *4BED54445326D0D3477C30025D66AF8911CA854F | N          | N          |
| localhost | placement | *7F75AD3C141B7CD8E66685A5505B1630D896092F | N          | N          |
| %         | placement | *7F75AD3C141B7CD8E66685A5505B1630D896092F | N          | N          |
+-----------+-----------+-------------------------------------------+------------+------------+

eg2.root@controller160:~# placement-status upgrade check
SQL connection failed. 10 attempts left.
SQL connection failed. 9 attempts left.
SQL connection failed. 8 attempts left.
SQL connection failed. 7 attempts left.
SQL connection failed. 6 attempts left.
SQL connection failed. 5 attempts left.
解决方案:
1 检查mysql 3306是否启用
2 检查connection URL是否配置及密码是否正确
3 检查本机hosts文件是否有录入各节点对应的host列表

eg3.查看Resource Provider:资源提供者,实际提供资源的实体,例如:Compute Node、Storage Pool、IP Pool 等。 
Inventory:资源清单,资源提供者所拥有的资源清单,例如:Compute Node 拥有的 vCPU、Disk、RAM 等 inventories。
解决方案:
yum install python3-osc-placement.noarch
[root@controller160 ~]# export OS_PLACEMENT_API_VERSION=1.28
[root@controller160 ~]# openstack resource class list
+----------------------------+
| name                       |
+----------------------------+
| VCPU                       |
| MEMORY_MB                  |
| DISK_GB                    |
| PCI_DEVICE                 |
| SRIOV_NET_VF               |
| NUMA_SOCKET                |
| NUMA_CORE                  |
| NUMA_THREAD                |
| NUMA_MEMORY_MB             |
| IPV4_ADDRESS               |
| VGPU                       |
| VGPU_DISPLAY_HEAD          |
| NET_BW_EGR_KILOBIT_PER_SEC |
| NET_BW_IGR_KILOBIT_PER_SEC |
| PCPU                       |
| MEM_ENCRYPTION_CONTEXT     |
| FPGA                       |
| PGPU                       |
+----------------------------+
[root@controller160 ~]# openstack resource provider list
+--------------------------------------+------------+------------+--------------------------------------+----------------------+
| uuid                                 | name       | generation | root_provider_uuid                   | parent_provider_uuid |
+--------------------------------------+------------+------------+--------------------------------------+----------------------+
| f4021a77-37d8-4325-84a4-b47b0443aa02 | compute163 |          2 | f4021a77-37d8-4325-84a4-b47b0443aa02 | None                 |
| f76880fb-90b7-47fc-8105-68f8f3e08914 | compute164 |          2 | f76880fb-90b7-47fc-8105-68f8f3e08914 | None                 |
+--------------------------------------+------------+------------+--------------------------------------+----------------------+
[root@controller160 ~]# openstack resource provider inventory list f4021a77-37d8-4325-84a4-b47b0443aa02
+----------------+------------------+----------+----------+----------+-----------+-------+
| resource_class | allocation_ratio | min_unit | max_unit | reserved | step_size | total |
+----------------+------------------+----------+----------+----------+-----------+-------+
| VCPU           |             16.0 |        1 |        1 |        0 |         1 |     1 |
| MEMORY_MB      |              1.5 |        1 |     1826 |      512 |         1 |  1826 |
| DISK_GB        |              1.0 |        1 |       14 |        0 |         1 |    14 |
+----------------+------------------+----------+----------+----------+-----------+-------+

eg1.root@controller160:~# apt install nova-api nova-conductor nova-novncproxy nova-scheduler
The following packages have unmet dependencies:  
nova-api : Depends: python3-nova (= 2:21.0.0~b3~git2020041013.57ff308d6d-0ubuntu2~cloud0) but it is not going to be installed 
E: Unable to correct problems, you have held broken packages.
解决方案:
1 查看apt源是否设置正确
2 apt-get update
3 apt-get dist-upgrade
4 apt-get -f 命令(修复受损软件包)

eg2.ERROR oslo_service.service amqp.exceptions.AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.
解决方案:
1 查看nova配置里的rabbitmq配置是否正常
2 查看rabbitmq是否有创建对应的用户及权限
3 如果是账号错误需要操作如下:
root@controller160:/etc/apt# su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
+-------+--------------------------------------+---------------------------------------------+----------------------------------------------------+----------+
|  Name |                 UUID                 |                Transport URL                |                Database Connection                 | Disabled |
+-------+--------------------------------------+---------------------------------------------+----------------------------------------------------+----------+
| cell0 | 00000000-0000-0000-0000-000000000000 |                    none:/                   | mysql+pymysql://nova:****@controller160/nova_cell0 |  False   |
| cell1 | a3527e1f-85dc-46a6-bd17-af5f19b3a725 | rabbit://openstack:****@controller160:5672/ |    mysql+pymysql://nova:****@controller160/nova    |  False   |
+-------+--------------------------------------+---------------------------------------------+----------------------------------------------------+----------+
#停止服务
root@controller160:/etc/apt# systemctl stop nova-api nova-scheduler nova-conductor nova-novncproxy
#修改nova.conf配置里的rabbitmq_url为正确的账号
#删除使用错误账户的cell
root@controller160:/etc/apt# su -s /bin/sh -c "nova-manage cell_v2 delete_cell --cell_uuid a3527e1f-85dc-46a6-bd17-af5f19b3a725" nova
#重新创建cell1
root@controller160:/etc/apt# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
--transport-url not provided in the command line, using the value [DEFAULT]/transport_url from the configuration file
--database_connection not provided in the command line, using the value [database]/connection from the configuration file
74d4b65d-4d9c-4699-885e-4a773e295ef8
#验证是否正解
root@controller160:/etc/apt# su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
+-------+--------------------------------------+--------------------------------------------+----------------------------------------------------+----------+
|  Name |                 UUID                 |               Transport URL                |                Database Connection                 | Disabled |
+-------+--------------------------------------+--------------------------------------------+----------------------------------------------------+----------+
| cell0 | 00000000-0000-0000-0000-000000000000 |                   none:/                   | mysql+pymysql://nova:****@controller160/nova_cell0 |  False   |
| cell1 | 74d4b65d-4d9c-4699-885e-4a773e295ef8 | rabbit://rabbitmq:****@controller160:5672/ |    mysql+pymysql://nova:****@controller160/nova    |  False   |
+-------+--------------------------------------+--------------------------------------------+----------------------------------------------------+----------+
#重新启动服务
systemctl start nova-api nova-scheduler nova-conductor nova-novncproxy
#查看对应日志是否还有报错

eg1. 查看节点是否支持硬件加速
egrep -c '(vmx|svm)' /proc/cpuinfo
输出为0时,/etc/nova/nova-compute.conf配置需要更改成以下项
virt_type = qemu
输出为1时,更改成
virt_type = kvm

eg1.Unable to create a new session key. It is likely that the cache is unavailable.
解决方案:将local_settings.py中 SESSION_ENGINE = 'django.contrib.sessions.backends.cache' 应改为
SESSION_ENGINE = 'django.contrib.sessions.backends.file'

eg2.发现日志里一直报以下这个错误,dashboard明明用户名密码都正确但是一直报这个错!原因是官网的配置有问题!
less /var/log/apache2/error.log 
[Thu May 21 11:26:04.998581 2020] [authz_core:error] [pid 14375:tid 140677929187072] [client 127.0.0.1:47960] AH01630: client denied by server configuration: /usr/bin/keystone-wsgi-public
解决方案:将官网的vim /etc/openstack-dashboard/local_settings.py里的这条配置
OPENSTACK_KEYSTONE_URL = "http://%s/identity/v3" % OPENSTACK_HOST
改成:OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
即可解决!

eg1.执行状态检查时发现报错
root@controller160:~#  openstack volume service list
The server is currently unavailable. Please try again at a later time.<br /><br />
The Keystone service is temporarily unavailable.
但是执行其他命令是正常的,因此判断非keystone问题,回顾下安装步骤
root@controller160:~# openstack service list
+----------------------------------+-----------+-----------+
| ID                               | Name      | Type      |
+----------------------------------+-----------+-----------+
| 0d9cdd8f207147bf93b573203c8e78a3 | placement | placement |
| 0e20d3c0a35e486bb2aed2bf3cc17c00 | neutron   | network   |
| 6ad962f2c8834b1cbaac24c5c952bbe7 | glance    | image     |
| 99b513bed6da45ae814b3d99a10e87e5 | keystone  | identity  |
| bf7d430353f84346b27d26a3117a52e7 | cinderv3  | volumev3  |
| f1173afb33a741ddb3a6540b3a8e70f6 | cinderv2  | volumev2  |
| fc0fb7e04b4443cd95be23d91bd0fc51 | nova      | compute   |
+----------------------------------+-----------+-----------+

 (HTTP 503)
解决方案:重新授权cinder进admin
root@controller160:~# openstack role add --project service --user cinder admin
root@controller160:~# openstack volume service list
+------------------+----------------+------+---------+-------+----------------------------+
| Binary           | Host           | Zone | Status  | State | Updated At                 |
+------------------+----------------+------+---------+-------+----------------------------+
| cinder-scheduler | controller160  | nova | enabled | up    | 2020-05-22T07:10:29.000000 |
| cinder-volume    | compute162@lvm | nova | enabled | up    | 2020-05-22T07:10:28.000000 |
+------------------+----------------+------+---------+-------+----------------------------+



eg1. oslo_db.exception.DBError: (pymysql.err.InternalError) (1832, "Cannot change column 'network_id': used in a foreign key constraint 'subnets_ibfk_1'")
[SQL: ALTER TABLE subnets MODIFY network_id VARCHAR(36) NOT NULL]
解决方案:
root@controller160:~# mysql -uroot -p
MariaDB [(none)]> use neutron;
MariaDB [(none)]> ALTER TABLE subnets DROP FOREIGN KEY subnets_ibfk_1;
Query OK, 0 rows affected (0.15 sec)
Records: 0  Duplicates: 0  Warnings: 0

eg2.oslo_db.exception.DBError: (pymysql.err.InternalError) (1071, 'Specified key was too long; max key length is 767 bytes')
[SQL:
CREATE TABLE ovn_hash_ring (
	node_uuid VARCHAR(36) NOT NULL,
	group_name VARCHAR(256) NOT NULL,
	hostname VARCHAR(256) NOT NULL,
	created_at DATETIME NOT NULL,
	updated_at DATETIME NOT NULL,
	PRIMARY KEY (node_uuid, group_name)
)ENGINE=InnoDB

]
解决方案1:
root@controller160:~# vim /etc/mysql/mariadb.conf.d/99-openstack.cnf
增加以下配置:
innodb_large_prefix = on
重启mariadb:
systemctl restart mariadb.service
MariaDB [(none)]> show variables like '%innodb_large_prefix%';
+---------------------+-------+
| Variable_name       | Value |
+---------------------+-------+
| innodb_large_prefix | ON    |
+---------------------+-------+
解决方案2:添加DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC,手动执行即可创建
CREATE TABLE ovn_hash_ring (
	node_uuid VARCHAR(36) NOT NULL,
	group_name VARCHAR(256) NOT NULL,
	hostname VARCHAR(256) NOT NULL,
	created_at DATETIME NOT NULL,
	updated_at DATETIME NOT NULL,
	PRIMARY KEY (node_uuid, group_name)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;


Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐