其他分享
首页 > 其他分享> > kolla 部署ussuri,并使用ceph

kolla 部署ussuri,并使用ceph

作者:互联网

部署ceph

ussuri版本已经不支持通过kolla部署ceph,需要使用外部ceph,参看
https://blog.51cto.com/penguintux/2536500
先部署一套ceph
参看
https://docs.openstack.org/kolla-ansible/ussuri/reference/storage/external-ceph-guide.html
配置外部ceph

准备ceph

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

kolla-ansible的组件版本

cat kolla-ansible/ansible/roles/prechecks/vars/main.yml
---
docker_version_min: '1.10.0'
docker_py_version_min: '2.0.0'
ansible_version_min: '2.8'
ansible_version_max: '2.9'

准备CentOS 8环境

yum install python3
pip3 install docker

python3 -m venv /opt/ven_op
source /opt/ven_op/bin/activate
cat .pip/pip.conf
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com
cat <<EOF>> /etc/yum.repos.d/docker-ce.repo   
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/8/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
EOF

yum install docker-ce
systemctl start docker
systemctl enable docker

准备kolla-ansible

cd kolla-ansible
git checkout stable/ussuri
pip install .

mkdir -p /etc/kolla
chown $USER:$USER /etc/kolla

cp -r etc/kolla/* /etc/kolla/  # 实际只是复制了globals.yml、passwords.yml

配置ansible

cat <<EOF>>/etc/ansible/ansible.cfg
[defaults]
host_key_checking=False
pipelining=True
forks=100
EOF

配置kolla-ansible

kolla_base_distro: "centos"
kolla_install_type: "source"
node_custom_config: "/etc/kolla/config"

# network_interface默认承载各api、vxlan、存储流量
network_interface: "eth1"

# 管理IP
# 需要与network_interface在同一网段
# 如果启用了haproxy,使用一个未被使用的IP
# 如果没启用haproxy,使用eth1的IP
kolla_internal_vip_address: "192.168.254.207"

# pulibc 网络,用于浮动IP
neutron_external_interface: "eth2"

neutron_plugin_agent: "openvswitch"

# 配置虚拟化类型
nova_compute_virt_type: "qemu"

# 要安装的组件
nable_openstack_core: "yes"

enable_haproxy: "no"
enable_cinder: "yes"

# 以下是配置使用外部ceph
glance_backend_ceph: "yes"
cinder_backend_ceph: "yes"
nova_backend_ceph: "yes"
# gnocchi_backend_storage: "ceph"
# enable_manila_backend_cephfs_native: "yes"

ceph_glance_keyring: "ceph.client.glance.keyring"
ceph_glance_user: "glance"
ceph_glance_pool_name: "images"

ceph_cinder_keyring: "ceph.client.cinder.keyring"
ceph_cinder_user: "cinder"
ceph_cinder_pool_name: "volumes"
ceph_cinder_backup_keyring: "ceph.client.cinder-backup.keyring"
ceph_cinder_backup_user: "cinder-backup"
ceph_cinder_backup_pool_name: "backups"

ceph_nova_keyring: "{{ ceph_cinder_keyring }}"
ceph_nova_user: "cinder"
ceph_nova_pool_name: "vms"
cat <<EOF>>/etc/kolla/config/glance/ceph.conf
[global]
fsid = 0e7fe350-fbbf-11ea-a78a-52540079f755
# mon_initial_members = ceph-0
mon_host = 192.168.254.200,192.168.254.201,192.168.254.202
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
EOF

cp ceph.client.glance.keyring /etc/kolla/config/glance/
cp /etc/kolla/config/glance/ceph.conf  /etc/kolla/config/cinder

cp ceph.client.cinder.keyring /etc/kolla/config/cinder/cinder-volume/
cp ceph.client.cinder.keyring /etc/kolla/config/cinder/cinder-backup/
cp ceph.client.cinder-backup.keyring /etc/kolla/config/cinder/cinder-backup/
cp /etc/kolla/config/glance/ceph.conf /etc/kolla/config/nova
cp ceph.client.cinder.keyring /etc/kolla/config/nova/

使用openstack

pip install python-openstackclient
. /etc/kolla/admin-openrc.sha

标签:ussuri,ceph,etc,ansible,pool,cinder,kolla
来源: https://blog.51cto.com/penguintux/2539670