sudo yum install python-virtualenv
virtualenv /path/to/virtualenv
source /path/to/virtualenv/bin/activate
pip install -U pip
pip install ansible===2.5.0
# On CentOS Linux release 7.7.1908 (Core)
yum remove python-requests-2.6.0-9.el7_7.noarch -y
# Kolla 对 docker-py 版本有限制
sudo pip install docker==2.7.0
# 在使用 ansible mariadb 时,需要使用 libselinux-python ,所以要配置 pip install selinux
pip install selinux
yum install sshpass -y
# 源码方式下载
git clone https://github.com/openstack/kolla
git clone https://github.com/openstack/kolla-ansible
# 切换到对应分支
git checkout <version>
git checkout <version>
# 以上两部可以省略为
git clone https://github.com/openstack/kolla -b <version>
git clone https://github.com/openstack/kolla-ansible -b <version>
# 安装 kolla 和 kolla-ansible
pip install ./kolla
pip install ./kolla-ansible
# 创建 kolla 和 kolla-ansible 配置文件目录
sudo mkdir -p /etc/kolla
sudo chown $USER:$USER /etc/kolla
# 自动生成 password 文件 /etc/kolla/passwords.yml
cd kolla-ansible/tools
./generate_passwords.py
# cp 所有 kolla-ansible 文件到 /etc/kolla 中
cp -r kolla-ansible/etc/kolla/* /etc/kolla
# 生成 kolla image 相关配置文件 etc/kolla/kolla-build.conf
# cp etc/kolla/kolla-build.conf 到 /etc/kolla 目录下
pip install tox
cd kolla/
tox -e genconfig
cp etc/kolla/kolla-build.conf /etc/kolla/kolla-build.conf
# cp kolla-ansible inventory 文件到个人的 work directory
cp kolla-ansible/ansible/inventory/* .
创建 /etc/ansible/ansible.cfg
目录和文件,配置如下
[defaults]
host_key_checking=False
pipelining=False
forks=10
stdout_callback=debug
[DEFAULT]
# centos image base
base = centos
# centos 7
base_tag = 7
# 这里使用 stein 版本 Docker images
tag = stein
install_type = source
# 创建 neutron-server image 时使用:
# neutron-server 添加 F5 driver, 从 github 上 clone 指定 branch 为 stable/stein。
[neutron-server-plugin-neutron-lbaas]
type = git
location = https://github.com/F5Networks/f5-openstack-lbaasv2-driver.git
reference = stable/stein
# 创建 F5 agent image 时使用:
# 指定 neutron-lbaas image 安装 F5 agent 代码(stein verison)。
[neutron-lbaas-agent]
type = git
location = https://github.com/F5Networks/f5-openstack-agent.git
reference = test-stein
# 到 kolla 目录下
cd kolla
# 运行
python tools/build.py neutron-server
制作 F5 agent
镜像需要在额外在修改一些文件:
添加 lbaas-overrides.j2
文件
{% extends parent_template %}
# Neutron lbaas does not use haproxy, so I do not install haproxy
{% set neutron_lbaas_agent_packages_remove = ['haproxy'] %}
修改 neutron-lbaas-agent.json.j2
文件
# 注意:可能有多个同名文件,需要找到被 code 使用的 neutron-lbaas-agent.json.j2 文件。
(ansible2.5) [root@centos7-min kolla]# find / -name neutron-lbaas-agent.json.j2
/etc/kolla/config/neutron-lbaas-agent/neutron-lbaas-agent.json.j2
/root/kolla-ansible/ansible/roles/neutron/templates/neutron-lbaas-agent.json.j2
/root/ansible2.5/share/kolla-ansible/ansible/roles/neutron/templates/neutron-lbaas-agent.json.j2
# 在我的环境中,因为是用 virtualenv ansible2.5,所以我要修改
/root/ansible2.5/share/kolla-ansible/ansible/roles/neutron/templates/neutron-lbaas-agent.json.j2
找到正确的 neutron-lbaas-agent.json.j2
文件,修改如下:
{
"command": "f5-oslbaasv2-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/services/f5/f5-openstack-agent_bigip.ini",
"config_files": [
{
"source": "{{ container_config_directory }}/neutron.conf",
"dest": "/etc/neutron/neutron.conf",
"owner": "neutron",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/neutron_lbaas.conf",
"dest": "/etc/neutron/neutron_lbaas.conf",
"owner": "neutron",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/services/f5/esd/demo.json",
"dest": "/etc/neutron/services/f5/esd/demo.json",
"owner": "neutron",
"perm": "0600",
"optional": true
},
{
"source": "{{ container_config_directory }}/services/f5/f5-openstack-agent_bigip.ini",
"dest": "/etc/neutron/services/f5/f5-openstack-agent_bigip14.ini",
"owner": "neutron",
"perm": "0600",
"optional": true
}
],
"permissions": [
{
"path": "/var/log/kolla/neutron",
"owner": "neutron:neutron",
"recurse": true
},
{
"path": "/var/lib/neutron/kolla",
"owner": "neutron:neutron",
"recurse": true
}
]
}
修改 neutron-lbaas-agent
的 Dockerfile.j2
,如下:
FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block neutron_lbaas_agent_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% set neutron_lbaas_agent_packages = [
'haproxy'
] %}
{{ macros.install_packages(neutron_lbaas_agent_packages | customizable("packages")) }}
{% if install_type == 'binary' %}
{% if base_package_type == 'rpm' %}
{% set neutron_lbaas_agent_packages = [
'openstack-neutron-lbaas'
] %}
{% elif base_package_type == 'deb' %}
{% set neutron_lbaas_agent_packages = [
'neutron-lbaas-common',
'neutron-lbaasv2-agent',
'python3-neutron-lbaas'
] %}
{% endif %}
{{ macros.install_packages(neutron_lbaas_agent_packages | customizable("packages")) }}
{% elif install_type == 'source' %}
ADD neutron-lbaas-agent-archive /neutron-lbaas-agent-source
{% set neutron_lbaas_agent_pip_packages = [
'/neutron_lbaas'
] %}
RUN ln -s neutron-lbaas-agent-source/* neutron_lbaas \
&& {{ macros.install_pip(neutron_lbaas_agent_pip_packages | customizable("pip_packages")) }} \
&& cp -R /neutron_lbaas/etc/neutron/services /etc/neutron/
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_neutron_extend_start
RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start
{% block neutron_lbaas_agent_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER neutron
运行制作镜像命令
# 到 kolla 目录下
cd kolla
# 运行
python tools/build.py --template-override ../lbaas-overriders.j2 neutron-lbaas-agent
(ansible2.5) [root@centos7-min ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kolla/centos-source-neutron-lbaas-agent stein ee718b64ab88 15 hours ago 1.03GB
kolla/centos-source-neutron-base stein f585d6edf7d1 15 hours ago 1.02GB
kolla/centos-source-openstack-base stein 82b5071b4303 15 hours ago 798MB
kolla/centos-source-base stein ac707b767c8b 15 hours ago 379MB
<none> <none> d417f0a941ca 7 days ago 1.02GB
kolla/centos-source-neutron-server stein e2ae638f9c5a 7 days ago 1.05GB
kolla/centos-source-nova-compute stein ba5a56ff3a0c 7 days ago 1.86GB
kolla/centos-source-nova-api stein 37689b6817c6 8 days ago 1.1GB
kolla/centos-source-neutron-lbaas-agent:stein
和 kolla/centos-source-neutron-server:stein
镜像成功创建。
这里使用的是 all-in-one
的部署方式,Ansible inventory all-in-one
修改如下:
# These initial groups are the only groups required to be modified. The
# additional groups are for more control of the environment.
[control]
10.145.69.250 ansible_user=root ansible_password=default ansible_become=true
[network]
10.145.69.250 ansible_user=root ansible_password=default ansible_become=true
[compute]
10.145.69.250 ansible_user=root ansible_password=default ansible_become=true
[storage]
10.145.69.250 ansible_user=root ansible_password=default ansible_become=true
[monitoring]
10.145.69.250 ansible_user=root ansible_password=default ansible_become=true
[deployment]
10.145.69.250 ansible_user=root ansible_password=default ansible_become=true
参考 global.yml
。
###############
# Kolla options
###############
# Valid options are [ COPY_ONCE, COPY_ALWAYS ]
#config_strategy: "COPY_ALWAYS"
# Valid options are ['centos', 'debian', 'oraclelinux', 'rhel', 'ubuntu']
#kolla_base_distro: "centos"
# Valid options are [ binary, source ]
#kolla_install_type: "binary"
kolla_install_type: "source"
# Valid option is Docker repository tag
#openstack_release: ""
openstack_release: "stein"
# Location of configuration overrides
#node_custom_config: "/etc/kolla/config"
# This should be a VIP, an unused IP on your network that will float between
# the hosts running keepalived for high-availability. If you want to run an
# All-In-One without haproxy and keepalived, you can set enable_haproxy to no
# in "OpenStack options" section, and set this value to the IP of your
# 'network_interface' as set in the Networking section below.
kolla_internal_vip_address: "10.145.69.250"
##############################
# Neutron - Networking Options
##############################
# This interface is what all your api services will be bound to by default.
# Additionally, all vxlan/tunnel and storage network traffic will go over this
# interface by default. This interface must contain an IPv4 address.
# It is possible for hosts to have non-matching names of interfaces - these can
# be set in an inventory file per host or per group or stored separately, see
# http://docs.ansible.com/ansible/intro_inventory.html
# Yet another way to workaround the naming problem is to create a bond for the
# interface on all hosts and give the bond name here. Similar strategy can be
# followed for other types of interfaces.
#network_interface: "eth0"
network_interface: "ens160"
# These can be adjusted for even more customization. The default is the same as
# the 'network_interface'. These interfaces must contain an IPv4 address.
#kolla_external_vip_interface: "{{ network_interface }}"
#api_interface: "{{ network_interface }}"
#storage_interface: "{{ network_interface }}"
#cluster_interface: "{{ network_interface }}"
#swift_storage_interface: "{{ storage_interface }}"
#swift_replication_interface: "{{ swift_storage_interface }}"
#tunnel_interface: "{{ network_interface }}"
#dns_interface: "{{ network_interface }}"
#octavia_network_interface: "{{ api_interface }}"
# This is the raw interface given to neutron as its external network port. Even
# though an IP address can exist on this interface, it will be unusable in most
# configurations. It is recommended this interface not be configured with any IP
# addresses for that reason.
#neutron_external_interface: "eth1"
neutron_external_interface: "ens192"
##############
# OpenDaylight
##############
#enable_opendaylight_qos: "no"
#enable_opendaylight_l3: "yes"
enable_opendaylight_l3: "no"
###################
# OpenStack options
###################
# Use these options to set the various log levels across all OpenStack projects
# Valid options are [ True, False ]
#openstack_logging_debug: "False"
# Valid options are [ none, novnc, spice, rdp ]
#nova_console: "novnc"
# These roles are required for Kolla to be operation, however a savvy deployer
# could disable some of these required roles and run their own services.
#enable_glance: "{{ enable_openstack_core | bool }}"
#enable_haproxy: "yes"
enable_haproxy: "no"
#enable_keepalived: "{{ enable_haproxy | bool }}"
#enable_keystone: "{{ enable_openstack_core | bool }}"
#enable_mariadb: "yes"
#enable_memcached: "yes"
#enable_neutron: "{{ enable_openstack_core | bool }}"
#enable_nova: "{{ enable_openstack_core | bool }}"
#enable_rabbitmq: "{{ 'yes' if om_rpc_transport == 'rabbit' or om_notify_transport == 'rabbit' else 'no' }}"
#enable_outward_rabbitmq: "{{ enable_murano | bool }}"
# OpenStack services can be enabled or disabled with these options
#enable_aodh: "no"
#enable_barbican: "no"
#enable_blazar: "no"
#enable_ceilometer: "no"
#enable_ceilometer_ipmi: "no"
#enable_central_logging: "no"
enable_central_logging: "yes"
#enable_ceph: "no"
#enable_ceph_mds: "no"
#enable_ceph_rgw: "no"
#enable_ceph_nfs: "no"
#enable_ceph_dashboard: "{{ enable_ceph | bool }}"
#enable_chrony: "yes"
#enable_cinder: "no"
#enable_cinder_backup: "yes"
enable_cinder_backup: "no"
#enable_cinder_backend_hnas_iscsi: "no"
#enable_cinder_backend_hnas_nfs: "no"
#enable_cinder_backend_iscsi: "no"
#enable_cinder_backend_lvm: "no"
#enable_cinder_backend_nfs: "no"
#enable_cinder_backend_quobyte: "no"
#enable_cloudkitty: "no"
#enable_collectd: "no"
#enable_congress: "no"
#enable_cyborg: "no"
#enable_designate: "no"
#enable_destroy_images: "no"
enable_elasticsearch: "{{ 'yes' if enable_central_logging | bool or enable_freezer | bool or enable_osprofiler | bool or enable_skydive | bool or enable_monasca | bool else 'no' }}"
#enable_etcd: "no"
enable_fluentd: "yes"
#enable_freezer: "no"
#enable_gnocchi: "no"
#enable_grafana: "no"
#enable_heat: "{{ enable_openstack_core | bool }}"
#enable_horizon: "{{ enable_openstack_core | bool }}"
#enable_horizon_blazar: "{{ enable_blazar | bool }}"
#enable_horizon_cloudkitty: "{{ enable_cloudkitty | bool }}"
#enable_horizon_congress: "{{ enable_congress | bool }}"
#enable_horizon_designate: "{{ enable_designate | bool }}"
#enable_horizon_freezer: "{{ enable_freezer | bool }}"
#enable_horizon_fwaas: "{{ enable_neutron_fwaas | bool }}"
#enable_horizon_ironic: "{{ enable_ironic | bool }}"
#enable_horizon_karbor: "{{ enable_karbor | bool }}"
#enable_horizon_magnum: "{{ enable_magnum | bool }}"
#enable_horizon_manila: "{{ enable_manila | bool }}"
#enable_horizon_mistral: "{{ enable_mistral | bool }}"
#enable_horizon_murano: "{{ enable_murano | bool }}"
enable_horizon_neutron_lbaas: "{{ enable_neutron_lbaas | bool }}"
#enable_horizon_neutron_aas: "{{ enable_neutron_aas | bool }}"
#enable_horizon_octavia: "{{ enable_octavia | bool }}"
#enable_horizon_sahara: "{{ enable_sahara | bool }}"
#enable_horizon_searchlight: "{{ enable_searchlight | bool }}"
#enable_horizon_senlin: "{{ enable_senlin | bool }}"
#enable_horizon_solum: "{{ enable_solum | bool }}"
#enable_horizon_tacker: "{{ enable_tacker | bool }}"
#enable_horizon_trove: "{{ enable_trove | bool }}"
#enable_horizon_watcher: "{{ enable_watcher | bool }}"
#enable_horizon_zun: "{{ enable_zun | bool }}"
#enable_hyperv: "no"
#enable_influxdb: "{{ enable_monasca | bool or (enable_cloudkitty | bool and cloudkitty_storage_backend == 'influxdb') }}"
#enable_ironic: "no"
#enable_ironic_ipxe: "no"
#enable_ironic_neutron_agent: "no"
#enable_ironic_pxe_uefi: "no"
#enable_kafka: "no"
#enable_karbor: "no"
#enable_kuryr: "no"
#enable_magnum: "no"
#enable_manila: "no"
#enable_manila_backend_generic: "no"
#enable_manila_backend_hnas: "no"
#enable_manila_backend_cephfs_native: "no"
#enable_manila_backend_cephfs_nfs: "no"
#enable_mariabackup: "no"
#enable_mistral: "no"
#enable_monasca: "no"
#enable_mongodb: "no"
#enable_murano: "no"
#enable_multipathd: "no"
#enable_neutron_bgp_dragent: "no"
#enable_neutron_dvr: "no"
#enable_neutron_lbaas: "no"
enable_neutron_lbaas: "yes"
#enable_neutron_fwaas: "no"
#enable_neutron_qos: "no"
#enable_neutron_agent_ha: "no"
#enable_neutron_aas: "no"
#enable_neutron_sriov: "no"
#enable_neutron_sfc: "no"
#enable_neutron_metering: "no"
#enable_nova_fake: "no"
#enable_nova_serialconsole_proxy: "no"
#enable_nova_ssh: "yes"
enable_nova_ssh: "no"
########################
# Glance - Image Options
########################
# Configure image backend.
#glance_backend_ceph: "no"
#glance_backend_file: "yes"
#glance_backend_swift: "no"
#glance_backend_vmware: "no"
#enable_glance_image_cache: "no"
# Configure glance upgrade option, due to this feature is experimental
# in glance, so default value should be set to "no".
glance_enable_rolling_upgrade: "no"
创建自定义目录:
# 创建 kolla 自定义配置目录
mkdir /etc/kolla/config
# 创建 neutron 自定义配置目录
mkdir /etc/kolla/config/neutron
# 创建 neutron lbaasv2 自定义配置目录
mkdir /etc/kolla/config/neutron-lbaas-agent
创建自定义配置:
neutron_lbaas.conf
的 service_provider
配置改写存放在 /etc/kolla/config/neutron
目录下,改写如下:(ansible2.5) [root@centos7-min ~]# cd /etc/kolla/config/neutron
(ansible2.5) [root@centos7-min neutron]# ls
neutron_lbaas.conf
(ansible2.5) [root@centos7-min neutron]# cat neutron_lbaas.conf
[service_providers]
service_provider = LOADBALANCERV2:F5Networks:neutron_lbaas.drivers.f5.driver_v2.F5LBaaSV2Driver:default
services/f5/f5-openstack-agent_bigip.ini
和 /services/f5/esd/demo.json
文件。services
文件夹 copy 到 /etc/kolla/neutron-lbaas-agent
目录下。如果目录不存在,那么可以先进行下一步 [部署 all-in-one Openstack](#部署 all-in-one Openstack) 后,再 copy 过去。执行上面步骤的原因是 kolla-ansible 中没有对 F5 agent 配置和文件处理相关的代码,必须手动将配置文件复制到对应的目录。
启动 neutron-lbaas-agent 的 container 后 /etc/kolla/neutron-lbaas-agent
目录中的文件会被挂载到contianer 的 /var/lib/kolla/config_files
目录。container 启动时使用 dumb-init
执行 set_config.py
(来自 base image) 命令去读取 neutron-lbaas-agent.json.j2
文件进行配置。
在 set_config.py 配置过程中,必须保证 neutron-lbaas-agent.json.j2
中所有文件都存在对应的目录下。
部署 Openstack 需要运行如下命令,前两条命了 check 主机状态,最后一条部署 Openstack。
kolla-ansible -i all-in-one bootstrap-servers
kolla-ansible -i all-in-one prechecks
kolla-ansible -i all-in-one deploy
部署完以后,我们会看到
(ansible2.5) [root@centos7-min neutron]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7be8767d05a1 kolla/centos-source-horizon:stein "dumb-init --single-…" 15 hours ago Up 15 hours horizon
e0bf04c0be9c kolla/centos-source-heat-engine:stein "dumb-init --single-…" 15 hours ago Up 15 hours heat_engine
43a9e1fd4c53 kolla/centos-source-heat-api-cfn:stein "dumb-init --single-…" 15 hours ago Up 15 hours heat_api_cfn
6b75d261adae kolla/centos-source-heat-api:stein "dumb-init --single-…" 15 hours ago Up 15 hours heat_api
72e57bbec953 kolla/centos-source-neutron-metadata-agent:stein "dumb-init --single-…" 15 hours ago Up 15 hours neutron_metadata_agent
3e3c8d1e175f kolla/centos-source-neutron-lbaas-agent:stein "dumb-init --single-…" 15 hours ago Up 15 hours neutron_lbaas_agent
47da3ba587bc kolla/centos-source-neutron-l3-agent:stein "dumb-init --single-…" 15 hours ago Up 15 hours neutron_l3_agent
fa3706f4024a kolla/centos-source-neutron-dhcp-agent:stein "dumb-init --single-…" 15 hours ago Up 15 hours neutron_dhcp_agent
0f17896b5c4a kolla/centos-source-neutron-openvswitch-agent:stein "dumb-init --single-…" 15 hours ago Up 15 hours neutron_openvswitch_agent
862bc86dab8a kolla/centos-source-neutron-server:stein "dumb-init --single-…" 15 hours ago Up 15 hours neutron_server
37cc18acfb8a kolla/centos-source-openvswitch-vswitchd:stein "dumb-init --single-…" 15 hours ago Up 15 hours openvswitch_vswitchd
9dccd467357a kolla/centos-source-openvswitch-db-server:stein "dumb-init --single-…" 15 hours ago Up 15 hours openvswitch_db
dd1e847f826f kolla/centos-source-nova-compute:stein "dumb-init --single-…" 15 hours ago Up 15 hours nova_compute
49b09998c65e kolla/centos-source-nova-api:stein "dumb-init --single-…" 15 hours ago Up 15 hours nova_api
4fd180581cb4 kolla/centos-source-nova-novncproxy:stein "dumb-init --single-…" 15 hours ago Up 15 hours nova_novncproxy
e9003dfd0bab kolla/centos-source-nova-consoleauth:stein "dumb-init --single-…" 15 hours ago Up 15 hours nova_consoleauth
460d140ad119 kolla/centos-source-nova-scheduler:stein "dumb-init --single-…" 15 hours ago Up 15 hours nova_scheduler
026804a1b88c kolla/centos-source-nova-libvirt:stein "dumb-init --single-…" 15 hours ago Up 15 hours nova_libvirt
ee66eaafc3d0 kolla/centos-source-nova-conductor:stein "dumb-init --single-…" 15 hours ago Up 15 hours nova_conductor
17643a811f08 kolla/centos-source-placement-api:stein "dumb-init --single-…" 15 hours ago Up 15 hours placement_api
e3d5772afa8a kolla/centos-source-glance-api:stein "dumb-init --single-…" 15 hours ago Up 15 hours glance_api
ea3ea061565c kolla/centos-source-keystone-fernet:stein "dumb-init --single-…" 15 hours ago Up 15 hours keystone_fernet
a45dc9f950bb kolla/centos-source-keystone-ssh:stein "dumb-init --single-…" 15 hours ago Up 15 hours keystone_ssh
5b8cebda4e7b kolla/centos-source-keystone:stein "dumb-init --single-…" 15 hours ago Up 15 hours keystone
a723c51e92ff kolla/centos-source-rabbitmq:stein "dumb-init --single-…" 15 hours ago Up 15 hours rabbitmq
999f506dd312 kolla/centos-source-memcached:stein "dumb-init --single-…" 15 hours ago Up 15 hours memcached
eccb5c54f2b0 kolla/centos-source-mariadb:stein "dumb-init -- kolla_…" 15 hours ago Up 15 hours mariadb
0320ae05dbaa kolla/centos-source-kibana:stein "dumb-init --single-…" 15 hours ago Up 15 hours kibana
b36f62e8015a kolla/centos-source-elasticsearch:stein "dumb-init --single-…" 15 hours ago Up 15 hours elasticsearch
be242e9c0a86 kolla/centos-source-chrony:stein "dumb-init --single-…" 15 hours ago Up 15 hours chrony
03e1d11f4cd0 kolla/centos-source-cron:stein "dumb-init --single-…" 15 hours ago Up 15 hours cron
3ba2661a6ece kolla/centos-source-kolla-toolbox:stein "dumb-init --single-…" 15 hours ago Up 15 hours kolla_toolbox
241c9afc4be1 kolla/centos-source-fluentd:stein "dumb-init --single-…" 15 hours ago Up 15 hours fluentd
# 因为只是用 lbaas 功能,可以不安装 python-openstackclient
# (ansible2.5) [root@centos7-min ~]# pip install python-openstackclient
(ansible2.5) [root@centos7-min ~]# pip install python-neutronclient
(ansible2.5) [root@centos7-min ~]# cd kolla-ansible/tools/
(ansible2.5) [root@centos7-min ~]# ./kolla-ansible post-deplo
(ansible2.5) [root@centos7-min ~]# . /etc/kolla/admin-openrc.sh
# 查看 agent 状态
(ansible2.5) [root@centos7-min neutron]# neutron agent-list
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+--------------------------------------+----------------------+--------------------------------------------------+-------------------+-------+----------------+---------------------------+
| id | agent_type | host | availability_zone | alive | admin_state_up | binary |
+--------------------------------------+----------------------+--------------------------------------------------+-------------------+-------+----------------+---------------------------+
| 97672ee5-7fd5-414b-96a9-28d7b824ce30 | Open vSwitch agent | centos7-min | | :-) | True | neutron-openvswitch-agent |
| a1adcfad-3183-4b7b-ad88-b14b23006472 | Loadbalancerv2 agent | centos7-min:7db2b813-16fd-5339-92f9-02e5c0c14c4f | | :-) | True | f5-oslbaasv2-agent |
| ac67822d-3b34-4b45-8c91-3615007b3086 | DHCP agent | centos7-min | nova | :-) | True | neutron-dhcp-agent |
| bee0a262-09ae-44be-88ac-97cf01c5f97e | Metadata agent | centos7-min | | :-) | True | neutron-metadata-agent |
| db6892f2-cca2-4b23-b886-b467abaaee4b | L3 agent | centos7-min | nova | :-) | True | neutron-l3-agent |
+--------------------------------------+----------------------+--------------------------------------------------+-------------------+-------+----------------+---------------------------+
在使用 neutron client 命令时候可能遇到类似问题:
ImportError: No module named queue
需要修改代码
try:
import queue
except ImportError:
import Queue as queue
(ansible2.5) [root@centos7-min tools]# neutron net-create kolla-net
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2020-04-16T15:56:04Z |
| description | |
| id | ce70b7fd-0942-49fa-8840-ad4afedf4c19 |
| ipv4_address_scope | |
| ipv6_address_scope | |
| is_default | False |
| mtu | 1450 |
| name | kolla-net |
| port_security_enabled | True |
| project_id | f443b8161ac549ccb62d3abfcbb21095 |
| provider:network_type | vxlan |
| provider:physical_network | |
| provider:segmentation_id | 36 |
| revision_number | 1 |
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | f443b8161ac549ccb62d3abfcbb21095 |
| updated_at | 2020-04-16T15:56:04Z |
+---------------------------+--------------------------------------+
(ansible2.5) [root@centos7-min tools]# neutron subnet-create --name kolla-subnet kolla-net 192.168.123.0/24
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new subnet:
+-------------------+------------------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------------------+
| allocation_pools | {"start": "192.168.123.2", "end": "192.168.123.254"} |
| cidr | 192.168.123.0/24 |
| created_at | 2020-04-16T15:57:43Z |
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 192.168.123.1 |
| host_routes | |
| id | 1ee001b8-0833-4184-b019-38868893811b |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | kolla-subnet |
| network_id | ce70b7fd-0942-49fa-8840-ad4afedf4c19 |
| project_id | f443b8161ac549ccb62d3abfcbb21095 |
| revision_number | 0 |
| service_types | |
| subnetpool_id | |
| tags | |
| tenant_id | f443b8161ac549ccb62d3abfcbb21095 |
| updated_at | 2020-04-16T15:57:43Z |
+-------------------+------------------------------------------------------+
(ansible2.5) [root@centos7-min tools]# neutron lbaas-loadbalancer-create --name kolla-lb kolla-subnet
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new loadbalancer:
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| admin_state_up | True |
| description | |
| id | 33daddb3-9cdb-4c25-8305-60dc22e6f299 |
| listeners | |
| name | kolla-lb |
| operating_status | OFFLINE |
| pools | |
| provider | f5networks |
| provisioning_status | PENDING_CREATE |
| tenant_id | f443b8161ac549ccb62d3abfcbb21095 |
| vip_address | 192.168.123.4 |
| vip_port_id | b399e204-4bf3-452b-babc-3c05a440d9f6 |
| vip_subnet_id | 1ee001b8-0833-4184-b019-38868893811b |
+---------------------+--------------------------------------+
(ansible2.5) [root@centos7-min tools]# neutron lbaas-listener-create --name kolla-ls --loadbalancer kolla-lb --protocol TCP --protocol-port 22
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new listener:
+---------------------------+------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------+
| admin_state_up | True |
| connection_limit | -1 |
| default_pool_id | |
| default_tls_container_ref | |
| description | |
| id | d31fccb9-063d-456e-bd2c-6c47bc90f1a7 |
| loadbalancers | {"id": "33daddb3-9cdb-4c25-8305-60dc22e6f299"} |
| name | kolla-ls |
| protocol | TCP |
| protocol_port | 22 |
| sni_container_refs | |
| tenant_id | f443b8161ac549ccb62d3abfcbb21095 |
+---------------------------+------------------------------------------------+
创建 loadbalancer:
创建 listener:
创建 pool:
创建 member:
创建 healthmonitor:
Dashboard 上查看 loadbalancer 创建结果:
Dashboard 上查看 listener 创建结果:
Dashboard 上查看 pool 和 pool member 创建结果:
查看 vs 列表:
查看 vs 状态:
查看 pool 和 health monitor 状态:
查看 pool member 状态: