一、搭建参考:
1、https://blog.csdn.net/hu_zhe_kan/article/details/101698228#23_23
2、https://blog.csdn.net/weixin_42758707/article/details/100184082?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task
3、https://blog.51cto.com/11233559/2122291
4、https://docs.openstack.org/project-deploy-guide/kolla-ansible/stein/quickstart.html 官网
5、https://blog.csdn.net/networken/article/details/80334111
二、错误记录:
1、dashboard报各种错误,如无法获取扩展。
# openstack catalog list(查看各个服务的endpoint) 错误如下: | nova | compute | | | nova | compute | | | nova | compute | RegionOne | | | | admin: http://controller:8774/v2.1 | | | | RegionOne | | | | internal: http://controller:8774/v2.1 | | | | RegionOne | | | | public: http://controller:8774/v2.1 解决:进入msyql数据库,把keystone库的service表的compute多余记录删除 msyql> delete from service where id='bdbedb443b9646938f1526aa990e09b0';(删除记录) #systemctl restart openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
一定要重启Nova服务,修改后
2、MariaDB [keystone]> delete from service where type='volumev2';
报错:ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`keystone`.`endpoint`, CONSTRAINT `endpoint_service_id_fkey` FOREIGN KEY (`service_id`) REFERENCES `service` (`id`))
MariaDB [keystone]> SET FOREIGN_KEY_CHECKS = 0; Query OK, 0 rows affected (0.001 sec) MariaDB [keystone]> delete from service where type='volumev2'; Query OK, 1 row affected (0.001 sec) MariaDB [keystone]> SET FOREIGN_KEY_CHECKS = 1; Query OK, 0 rows affected (0.000 sec)
3、新建的虚拟机没法从远程控制台启动
解决:修改nova的配置文件
# openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu (kvm格式在vm虚拟机上不上很友好) # openstack-config --set /etc/nova/nova.conf libvirt cpu_mode none # systemctl restart openstack-nova-compute.service
4、卷的状态不可用(下图为修改后)
解决方法:
#vim /etc/cinder/cinder.conf
- auth_uri = http://[keystone IP]:5000
- auth_url = http://[keystone IP]:35357
- auth_plugin = password
- project_domain_id = default
- user_domain_id = default
- project_name = services
- username = cinder
- password = [cinder's password]
- #根据自己的实际情况替换(cinder节点)
三、常用命令:
1、# nova service-list (查看nova服务状态)
2、 # nova-manage version (查看openstack的版本号,19为stein版)
19.1.0-1.el7
3、上传镜像:
# openstack image create "centos7" (此处粘贴复制不好使) > --file CentOS-7.6-x86_64-GenericCloud.qcow2 > --disk-format qcow2 --container-format bare > --public
4、# openstack image list (列出当前所有的镜像)
5、# openstack volume list (列出卷)
# openstack volume delete 4e131e71-70dd-40ba-98d7-4a103279a1db (删除卷)
6、# openstack network agent list (列出网络状态)