sudo apt update
2.安装 Python 构建依赖项:
sudo apt install git python3-dev libffi-dev gcc libssl-dev
sudo apt install python3-venv
python3 -m venv /path/to/venv
source /path/to/venv/bin/activate
pip install -U pip
4
,最多支持5
.pip install 'ansible>=4,<6'
如果出现ansible版本错误 ,请更新你的ansible-core的版本
克隆代码
这里注意我们使用的是 stable/zed分支:
git clonehttps://kgithub.com/openstack/kolla-ansible -b stable/zed
pip install kolla-ansible
配置 kolla-ansible
安装依赖:
pip install -r kolla-ansible/requirements.txt
创建 kolla 配置文件并设置权限:
sudo mkdir -p /etc/kolla
sudo chown $USER:$USER /etc/kolla
拷贝 kolla 配置文件模版:
cp -r kolla-ansible/etc/kolla/* /etc/kolla
安装 Ansible Galaxy 依赖项:
kolla-ansible install-deps
下一步是准备我们的库存文件。清单是一个 Ansible 文件,我们在其中指定主机及其所属的组。我们可以使用它来定义节点角色和访问凭证。
Kolla Ansible 附带了all-in-one
示例multinode
清单文件。它们之间的区别在于前者已准备好在本地主机上部署单节点 OpenStack。
配置单节点清单文件
cp kolla-ansible/ansible/inventory/* ~/
vim ~/multinode
自己根据你的服务 选择
[control]
controller
[network]
controller
[compute]
compute1
compute2
compute3
[storage]
compute1
compute2
compute3
[monitoring]
controller
[deployment]
controller
我们部署中使用的密码存储在/etc/kolla/passwords.yml
文件中。此文件中的所有密码都是空白的,必须手动或通过运行随机密码生成器来填写:
kolla-genpwd
vim /etc/kolla/passwords.yml
//修改第165行,这是登录Dashboard(web界面控制台)的密码。正常情况下也不能太简单,可以截取一段自动生成的密码
keystone_admin_password: 123456
vim /etc/kolla/globals.yml
//第14行和第15行,选择下载的基础镜像,5选1
# Valid options are ['centos', 'debian', 'oraclelinux', 'rhel', 'ubuntu']
kolla_base_distro: "ubuntu"
//第17行和第18行,选择的安装方法,2选1。binary二进制安装,source源码安装
# Valid options are [ binary, source ]
kolla_install_type: "source"
//第20行和第21行,选择OpenStack的版本标签,详细请看:https://releases.openstack.org/
# Valid option is Docker repository tag
openstack_release: "zed" //注意版本必须小写,后期下载的OpenStack相关的docker镜像标签也为stein。我是train版本失败,才换成stein
//第23行和第24行,存放配置文件的位置
# Location of configuration overrides
#node_custom_config: "/etc/kolla/config" //默认存放地址
//第31行,OpenStack内部管理网络地址,通过该IP访问OpenStack Web页面进行管理。如果启用了高可用,需要设置为VIP(漂移IP)
kolla_internal_vip_address: "10.196.110.100"
//第87行,OpenStack内部管理网络地址的网卡接口
network_interface: "eth0"
//第105行,OpenStack外部(或公共)网络的网卡接口,可以是vlan模式或flat模式。
//此网卡应该在没有IP地址的情况下处于活动,如果不是,那么OpenStack云平台中的云主机实例将无法访问外部网络。(存在IP时br-ex桥接就不成功)
neutron_external_interface: "eth1"
//第190行,关闭高可用
enable_haproxy: "no"
//第443行和第444行,指定nova-compute守护进程使用的虚拟化技术。(kvm好像有点问题,大家可以试试,看看你们能不能过nova下载)
//nova-compute是一个非常重要的守护进程,负责创建和终止虚拟机实例,即管理虚拟机实例的生命周期
# Valid options are [ qemu, kvm, vmware, xenapi ]
nova_compute_virt_type: "qemu"
生成ssh key,并给自己授权
ssh-keygen
ssh-copy compute1
ssh-copy compute2
ssh-copy compute3
Bootstrap servers
该步骤会对当前环境做一些检查与基础配置。
kolla-ansible -i ~/multinode bootstrap-servers
部署前检查
kolla-ansible -i ~/multinode prechecks
拉取镜像
kolla-ansible -i /etc/kolla/all-in-one pull
执行部署
kolla-ansible -i ~/multinode deploy
生成 keystone admin 用户环境变量文件
kolla-ansible -i ~/multinode post-deploy
cat /etc/kolla/admin-openrc.sh
pip install python3-openstackclient python3-glanceclient python3-neutronclient
mkdir /etc/skyline
查看数据库密码
cat /etc/kolla/passwords.yml | grep ^database
连接 OpenStack 环境的数据库, 并创建 skyline 数据库;
docker exec -it mariadb bash 去操作
MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS skyline DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON skyline.* TO 'skyline'@'localhost' IDENTIFIED BY 'skyline';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON skyline.* TO 'skyline'@'%' IDENTIFIED BY 'skyline';
查看keystone是否开启了35357端口 如果没有开启 下面请改成5000端口
配置yaml
vi /etc/skyline/skyline.yaml
default:
access_token_expire: 3600
access_token_renew: 1800
cors_allow_origins: []
database_url: 'mysql://root:1Y3PTsuvZCy6Rn3rjZRwQmqYEUj7QqfosRRxcrl4@10.196.2.100:3306/skyline'
# database_url: 'sqlite:tmp/skyline.db'
debug: false
log_dir: ./log
prometheus_basic_auth_password: ''
prometheus_basic_auth_user: ''
prometheus_enable_basic_auth: false
prometheus_endpoint: http://localhost:9091
secret_key: aCtmgbcUqYUy_HNVg5BDXCaeJgJQzHJXwqbXr0Nmb2o
session_name: session
developer:
show_raw_sql: false
openstack:
base_domains:
- heat_user_domain
base_roles:
- keystone_system_admin
- keystone_system_reader
- keystone_project_admin
- keystone_project_member
- keystone_project_reader
- nova_system_admin
- nova_system_reader
- nova_project_admin
- nova_project_member
- nova_project_reader
- cinder_system_admin
- cinder_system_reader
- cinder_project_admin
- cinder_project_member
- cinder_project_reader
- glance_system_admin
- glance_system_reader
- glance_project_admin
- glance_project_member
- glance_project_reader
- neutron_system_admin
- neutron_system_reader
- neutron_project_admin
- neutron_project_member
- neutron_project_reader
- heat_system_admin
- heat_system_reader
- heat_project_admin
- heat_project_member
- heat_project_reader
- placement_system_admin
- placement_system_reader
- panko_system_admin
- panko_system_reader
- panko_project_admin
- panko_project_member
- panko_project_reader
- ironic_system_admin
- ironic_system_reader
- octavia_system_admin
- octavia_system_reader
- octavia_project_admin
- octavia_project_member
- octavia_project_reader
default_region: RegionOne
extension_mapping:
fwaas_v2: neutron_firewall
vpnaas: neutron_vpn
interface_type: public
keystone_url: 'http://10.196.2.100:5000/v3'
nginx_prefix: /api/openstack
reclaim_instance_interval: 604800
service_mapping:
baremetal: ironic
compute: nova
database: trove
identity: keystone
image: glance
load-balancer: octavia
network: neutron
object-store: swift
orchestration: heat
placement: placement
volumev3: cinder
system_admin_roles:
- admin
- system_admin
system_project: 'service'
system_project_domain: 'Default'
system_reader_roles:
- system_reader
system_user_domain: 'Default'
system_user_name: 'skyline'
system_user_password: 'skyline'
setting:
base_settings:
- flavor_families
- gpu_models
- usb_models
flavor_families:
- architecture: x86_architecture
categories:
- name: general_purpose
properties: []
- name: compute_optimized
properties: []
- name: memory_optimized
properties: []
- name: high_clock_speed
properties: []
- architecture: heterogeneous_computing
categories:
- name: compute_optimized_type_with_gpu
properties: []
- name: visualization_compute_optimized_type_with_gpu
properties: []
gpu_models:
- nvidia_t4
usb_models:
- usb_c
2.运行 skyline_bootstrap 容器进行初始化引导
docker run -d --name skyline_bootstrap -e KOLLA_BOOTSTRAP="" -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml --net=host 99cloud/skyline:latest
3.初始化引导完成后运行 skyline 服务
docker rm -f skyline_bootstrap
docker run -d --name skyline --restart=always -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml --net=host 99cloud/skyline:latest
4.查看服务
root@controller:/etc/skyline# netstat -tnlp |grep 9999
tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 453702/nginx: maste