标签:table Inventor ansible pytho ati -o cli 嵌套虚拟化 global
部署cephussuri版本已经不支持通过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 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‘ -o /etc/ceph/ceph.client.glance.keyring
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‘ -o /etc/ceph/ceph.client.cinder.keyring
ceph auth get-or-create client.cinder-backup mon ‘profile rbd‘ osd ‘profile rbd pool=backups‘ mgr ‘profile rbd pool=backups‘ -o /etc/ceph/ceph.client.cinder-backup.keyring
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‘
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
source /opt/ven_op/bin/activate
pip install pip -U
安装Ansible
Kolla Ansible 需要至少 Ansible 2.8 并支持2.9
source /opt/ven_op/bin/activate
pip install ‘ansible<2.10‘
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
cat <<EOF>>/etc/modprobe.d/kvm.conf
options kvm_intel nested=1
EOF
git clone https://github.com/openstack/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
cat <<EOF>>/etc/ansible/ansible.cfg
[defaults]
host_key_checking=False
pipelining=True
forks=100
EOF
kolla-genpwd
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/
cat <<EOF>>/etc/kolla/config/nova/nova.conf
[libvirt]
hw_disk_discard = unmap
disk_cachemodes="network=writeback"
cpu_mode=host-passthrough
kolla-ansible -i kolla-ansible/ansible/inventory/all-in-one bootstrap-servers
kolla-ansible -i kolla-ansible/ansible/inventory/all-in-one prechecks
拉取镜像
kolla-ansible -i kolla-ansible/ansible/inventory/all-in-one pull
kolla-ansible -i kolla-ansible/ansible/inventory/all-in-one deploy
kolla-ansible post-deploy
pip install python-openstackclient
. /etc/kolla/admin-openrc.sha
标签:table Inventor ansible pytho ati -o cli 嵌套虚拟化 global
原文地址:https://blog.51cto.com/penguintux/2539670