cat << EOF >> /etc/hosts
192.168.179.90 kolla-ansible-controller
192.168.179.91 kolla-ansible-compute
EOF
ssh-copy-id $ip
for ip in kolla-ansible-controller kolla-ansible-compute; do ssh $ip yum install -y python36 python36-devel libffi-devel gcc python-setuptools python3-pip; done
pip3 install --upgrade setuptools
yum install ansible-python3 -y
ln -s /usr/bin/ansible-3 /usr/bin/ansible
ln -s /usr/bin/ansible-playbook-3 /usr/bin/ansible-playbook
cat /etc/ansible/ansible.cfg
[defaults]
host_key_checking=False
pipelining=True
forks=100
使用的是 stable/train 分支:
git clone https://github.com/openstack/kolla-ansible -b stable/train --depth 1
cd kolla-ansible
python3 setup.py install
卸载命令:
pip3 uninstall kolla-ansible
安装依赖:
pip3 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
修改kolla
配置文件:
cat << EOF > /etc/kolla/globals.yml
---
kolla_base_distro: "centos"
kolla_install_type: "source"
openstack_release: "train"
kolla_internal_vip_address: ""
docker_registry: ""
network_interface: "ens33"
neutron_external_interface: "ens33"
enable_haproxy: "yes"
glance_enable_rolling_upgrade: "no"
nova_compute_virt_type: "qemu"
EOF
使用脚本生成密码文件/etc/kolla/passwords.yml:
cd kolla-ansible/tools
python3 generate_passwords.py
拷贝 ansible 主机清单文件:
cp kolla-ansible/ansible/inventory/* ~/
配置文件如下:
本实验采用多节点multinode
部署:
[control]
kolla-ansible-controller
[network]
kolla-ansible-controller
[compute]
kolla-ansible-compute
[monitoring]
[storage]
[deployment]
localhost ansible_connection=local
[mariadb:children]
control
[rabbitmq:children]
control
[outward-rabbitmq:children]
[qdrouterd:children]
[monasca-agent:children]
[monasca:children]
[storm:children]
[mongodb:children]
[keystone:children]
control
[glance:children]
control
[nova:children]
control
[neutron:children]
network
[openvswitch:children]
network
compute
[opendaylight:children]
network
[cinder:children]
control
[cloudkitty:children]
[freezer:children]
[memcached:children]
control
[horizon:children]
control
[swift:children]
control
[glance-api:children]
glance
[nova-api:children]
nova
[nova-conductor:children]
nova
[nova-super-conductor:children]
nova
[nova-novncproxy:children]
nova
[nova-scheduler:children]
nova
[nova-spicehtml5proxy:children]
nova
[nova-compute-ironic:children]
[nova-serialproxy:children]
nova
[neutron-server:children]
control
[neutron-dhcp-agent:children]
neutron
[neutron-l3-agent:children]
neutron
[neutron-metadata-agent:children]
neutron
[neutron-bgp-dragent:children]
neutron
[neutron-infoblox-ipam-agent:children]
neutron
[neutron-metering-agent:children]
neutron
[cinder-api:children]
cinder
[cinder-backup:children]
storage
[cinder-scheduler:children]
cinder
[cinder-volume:children]
storage
[iscsid:children]
compute
使用 ping 模块验证,正常的验证结果如下:
# ansible-3 -i ~/multinode all -m ping
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.26.2) or chardet (2.2.1) doesn't match a supported version!
RequestsDependencyWarning)
kolla-ansible-controller | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
kolla-ansible-compute | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
检查与基础配置
kolla-ansible -i ~/multinode bootstrap-servers
部署前检查
kolla-ansible -i ~/multinode prechecks
执行部署
export ANSIBLE_SCP_IF_SSH=y
kolla-ansible -i ~/multinode deploy
生成 keystone admin 用户环境变量文件
kolla-ansible -i ~/multinode post-deploy
. /etc/kolla/admin-openrc.sh
kolla-ansible destroy -i ~/multinode --yes-i-really-really-mean-it
pip3 install openstackclient
docker exec kolla_toolbox openstack --os-interface admin \
--os-auth-url http://192.168.179.90:35357 \
--os-identity-api-version 3 \
--os-project-domain-name default \
--os-tenant-name admin \
--os-username admin \
--os-password 04XYSVCBkELIrEv6MFMofrCvd1GycBksyRDKK8VC \
--os-user-domain-name default \
--os-region-name RegionOne \
compute service list --format json --column Host --service nova-compute
openstack compute service list
openstack compute agent list
openstack network agent list
初始化
初始化脚本会创建 cirros 镜像、网络、子网、路由、安全组、规格、配额等虚拟机资源:
. kolla-ansible/tools/init-runonce
创建虚拟机
openstack server create --image cirros --flavor m1.tiny --key-name mykey --network demo-net demo1
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/kwame211/article/details/124672211
内容来源于网络,如有侵权,请联系作者删除!