環(huán)境:
Rocky9.1 minimal
disk 40GB
cpu 8core
ram 24GB
已有一個(gè)可用的ceph集群作為后端存儲(chǔ)
安裝
基礎(chǔ)軟件
dnf install git python3-devel gcc openssl-devel python3-libselinux
虛擬環(huán)境
python3 -m venv /path/to/venv
source /path/to/venv/bin/activate
配置pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install -U pip
pip install 'ansible>=4,<6'
安裝kolla-ansible
pip install git+https://opendev.org/openstack/kolla-ansible@stable/zed
配置kolla
mkdir -p /etc/kolla
chown $USER:$USER /etc/kolla ---> root就不用
cp -r /path/to/venv/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
cp /path/to/venv/share/kolla-ansible/ansible/inventory/* .
for all-in-one scenario in virtual environment add the following to the very beginning of the inventory
localhost ansible_python_interpreter=python
安裝ansible galaxy
kolla-ansible install-deps
配置ansible
(venv) [root@localhost ~]# cat /etc/ansible/ansible.cfg
[defaults]
host_key_checking=False
pipelining=True
forks=100
log_path = /var/log/ansible.log
配置
生成密碼到/etc/kolla
kolla-genpwd
配置/etc/kolla/globals.yml
要注意的幾個(gè)配置項(xiàng)
kolla_base_distro: "rocky" # 我們要使用的容器的基礎(chǔ)鏡像是基于rocky還是ubuntu
network_interface: "ens160" # 表示API網(wǎng)絡(luò),當(dāng)然默認(rèn)還作為vxlan/gre的租戶網(wǎng)絡(luò)
neutron_external_interface: "ens192" # 表示外部網(wǎng)絡(luò)vlan/flat
kolla_internal_vip_address: "localhost" # 即使是單控制節(jié)點(diǎn),也需要配置 internal vip,否則mariadb連不上
enable_haproxy: "no" # 單節(jié)點(diǎn)關(guān)掉
kolla_internal_vip_address: "x.x.x.x" # 多節(jié)點(diǎn)時(shí),開啟haproxy和keepalived,VIP地址
docker_registry: "hub.instack.cloud"
docker_registry_insecure: "yes"
opnstack_region_name: "ChengDu"
enable_cinder: "yes"
enable_cinder_backup: "no"
enable_fluentd: "no"
enable_ironic: "yes"
enable_redis: "yes" # for ironic
glance_backend_ceph: "yes"
glance_backend_file: "no"
cinder_backend_ceph: "yes"
nova_compute_virt_type: "qemu" # 針對(duì)于宿主機(jī)是虛擬機(jī)的情況
ceph創(chuàng)建存儲(chǔ)池
ceph osd pool create volumes
ceph osd pool create images
ceph osd pool create backups
ceph osd pool create vms
rbd pool init volumes
rbd pool init images
rbd pool init backups
rbd pool init vms
ceph auth get-or-create client.glance mon 'profile rbd' osd 'profile rbd pool=images' mgr 'profile rbd pool=images'
ceph auth get-or-create client.cinder mon 'profile rbd' osd 'profile rbd pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images' mgr 'profile rbd pool=volumes, profile rbd pool=vms'
ceph auth get-or-create client.cinder-backup mon 'profile rbd' osd 'profile rbd pool=backups' mgr 'profile rbd pool=backups'
復(fù)制上邊各個(gè)client的keyring
復(fù)制到/etc/kolla/config
對(duì)應(yīng)目錄下
復(fù)制ceph.conf到各個(gè)目錄下
如ceph.client.cinder-backup.keyring
[client.cinder-backup]
key = AQBUZ8xkkkSRJxAAx1JHN5iT5ZkL+Z7MBzz4Yw==
(venv) [root@localhost config]# ll cinder/
total 0
lrwxrwxrwx. 1 root root 34 Jun 30 07:08 ceph.conf -> /etc/kolla/config/custom/ceph.conf
drwxr-xr-x. 2 root root 98 Aug 4 02:51 cinder-backup
drwxr-xr-x. 2 root root 57 Aug 4 02:50 cinder-volume
(venv) [root@localhost config]# ll cinder/cinder-backup/
total 8
-rw-r--r--. 1 root root 78 Aug 4 02:51 ceph.client.cinder-backup.keyring
-rw-r--r--. 1 root root 71 Aug 4 02:50 ceph.client.cinder.keyring
lrwxrwxrwx. 1 root root 34 Jun 30 06:58 ceph.conf -> /etc/kolla/config/custom/ceph.conf
(venv) [root@localhost config]# ll cinder/cinder-volume/
total 4
-rw-r--r--. 1 root root 71 Aug 4 02:50 ceph.client.cinder.keyring
lrwxrwxrwx. 1 root root 34 Jun 30 06:58 ceph.conf -> /etc/kolla/config/custom/ceph.conf
(venv) [root@localhost config]# ll glance/
total 4
-rw-r--r--. 1 root root 71 Aug 4 02:51 ceph.client.glance.keyring
lrwxrwxrwx. 1 root root 34 Jun 30 06:55 ceph.conf -> /etc/kolla/config/custom/ceph.conf
(venv) [root@localhost config]# ll nova
total 0
lrwxrwxrwx. 1 root root 65 Jun 30 07:11 ceph.client.cinder.keyring -> /etc/kolla/config/cinder/cinder-volume/ceph.client.cinder.keyring
lrwxrwxrwx. 1 root root 34 Jun 30 06:56 ceph.conf -> /etc/kolla/config/custom/ceph.conf
(venv) [root@localhost config]#
(venv) [root@localhost config]#
(venv) [root@localhost config]# cat cinder/cinder-volume/ceph.client.cinder.keyring
[client.cinder]
key = AQBSZ8xkcCdYAhAAeaKuFG81/stzldEDnFd/RA==
(venv) [root@localhost config]# AQBSZ8xkcCdYAhAAeaKuFG81/stzldEDnFd/RA
配置nova和Ironic
cat /etc/kolla/config/nova.conf
[DEFAULT]
block_device_allocate_retries = 300
reclaim_instance_interval = 86400
[glance]
num_retries = 300
(venv) [root@localhost config]# ll ironic
total 470012
-rw-r--r--. 1 root root 469082349 Jul 26 02:08 ironic-agent.initramfs
-rwxr-xr-x. 1 root root 12189800 Jul 26 02:08 ironic-agent.kernel
-rwxrwxrwx. 1 root root 10820 Jul 4 02:43 pxelinux.0
部署
kolla-ansible -i all-in-one bootstrap-servers
kolla-ansible -i all-in-one prechecks
kolla-ansible -i all-in-one deploy # 部署
kolla-ansible -i all-in-one post-deploy
完成后修改~/.bashrc
echo "source /path/to/venv/bin/activate" >> ~/.bashrc
echo "source /etc/kolla/admin-openrc.sh" >> ~/.bashrc
source ~/.bashrc
檢查一下各個(gè)容器是否正常
docker ps -a
安裝配置skyline dashboard
pip install python-openstackclient
openstack user create --domain default --password admin skyline
openstack role add --project service --user skyline admin
# 進(jìn)入mariadb容器
mysql -uroot -p
CREATE DATABASE IF NOT EXISTS skyline DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON skyline.* TO 'skyline'@'localhost' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON skyline.* TO 'skyline'@'%' IDENTIFIED BY 'admin';
# 先運(yùn)行一個(gè)bootstrap,然后刪除,skyline.yaml見附錄
docker run -d --name skyline_bootstrap -e KOLLA_BOOTSTRAP="" -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml --net=host 99cloud/skyline:latest
# 檢查日志輸出結(jié)尾是否是"exit 0"
docker logs skyline_bootstrap
docker rm skyline_bootstrap
docker run -d --name skyline -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml --net=host 99cloud/skyline:latest
附錄
cat /etc/skyline/skyline.yaml
default:
access_token_expire: 3600
access_token_renew: 1800
cors_allow_origins: []
database_url: mysql://skyline:admin@192.168.1.98:3306/skyline
debug: false
log_dir: ./log
log_file: skyline.log
prometheus_basic_auth_password: ''
prometheus_basic_auth_user: ''
prometheus_enable_basic_auth: false
prometheus_endpoint: http://192.168.1.98:9091
secret_key: admin
session_name: session
ssl_enabled: true
openstack:
base_domains:
- heat_user_domain
default_region: ChengDu
enforce_new_defaults: true
extension_mapping:
floating-ip-port-forwarding: neutron_port_forwarding
fwaas_v2: neutron_firewall
qos: neutron_qos
vpnaas: neutron_vpn
interface_type: public
keystone_url: http://192.168.1.98:5000/v3/
nginx_prefix: /api/openstack
reclaim_instance_interval: 604800
service_mapping:
baremetal: ironic
compute: nova
container: zun
container-infra: magnum
database: trove
identity: keystone
image: glance
key-manager: barbican
load-balancer: octavia
network: neutron
object-store: swift
orchestration: heat
placement: placement
sharev2: manilav2
volumev3: cinder
sso_enabled: false
sso_protocols:
- openid
sso_region: ChengDu
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: 'admin'
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
主要是注意各個(gè)IP地址文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-643954.html
安裝其他CLI文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-643954.html
pip install python-ironicclient
pip install python-ironic-inspector-client
到了這里,關(guān)于kolla-ansible all-in-one部署OpenStack的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!