技术流ken

运维拯救世界

openstack云计算平台ovs网络配置–技术流ken

克隆计算节点需要修改的地方

 

1./etc/nova/nova.conf 文件中的my_ip

systemctl restart libvirtd.service openstack-nova-compute.service
[root@controller ~]# openstack hypervisor list
+----+---------------------+-----------------+---------------+-------+
| ID | Hypervisor Hostname | Hypervisor Type | Host IP       | State |
+----+---------------------+-----------------+---------------+-------+
|  1 | ken2                | QEMU            | 192.168.64.9  | up    |
|  2 | ken3                | QEMU            | 192.168.64.21 | up    |
+----+---------------------+-----------------+---------------+-------+

 

[root@controller ~]# nova service-list
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | controller | internal | enabled | up    | 2019-08-28T08:21:12.000000 | -               |
| 2  | nova-consoleauth | controller | internal | enabled | up    | 2019-08-28T08:21:12.000000 | -               |
| 3  | nova-scheduler   | controller | internal | enabled | up    | 2019-08-28T08:21:11.000000 | -               |
| 10 | nova-compute     | ken2       | nova     | enabled | up    | 2019-08-28T08:21:07.000000 | -               |
| 11 | nova-compute     | ken3       | nova     | enabled | up    | 2019-08-28T08:21:13.000000 | -               |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+

 

2./etc/neutron/plugins/ml2/linuxbridge_agent.ini 文件中的local_ip

[root@ken3 ~]# systemctl restart openstack-nova-compute.service
[root@ken3 ~]# systemctl restart neutron-linuxbridge-agent.service

[root@controller ~]# 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              |
+-------------------+-------------------+------------+-------------------+-------+----------------+---------------------+
| 75eac272-36e5-487 | DHCP agent        | controller | nova              | 🙂   | True           | neutron-dhcp-agent  |
| 5-9c2b-           |                   |            |                   |       |                |                     |
| 74cc843495a6      |                   |            |                   |       |                |                     |
| ac573880-d83d-    | Linux bridge      | ken3       |                   | 🙂   | True           | neutron-            |
| 44b2-80fc-        | agent             |            |                   |       |                | linuxbridge-agent   |
| 9af5c61155f8      |                   |            |                   |       |                |                     |
| b58857b0-92f8-4d3 | Linux bridge      | ken2       |                   | 🙂   | True           | neutron-            |
| 4-b960-0dbc342e6c | agent             |            |                   |       |                | linuxbridge-agent   |
| 93                |                   |            |                   |       |                |                     |
| cd76a670-1c0f-421 | L3 agent          | controller | nova              | 🙂   | True           | neutron-l3-agent    |
| 7-9078-64786bb084 |                   |            |                   |       |                |                     |
| 00                |                   |            |                   |       |                |                     |
| d4aa5337-5632-4d7 | Metadata agent    | controller |                   | 🙂   | True           | neutron-metadata-   |
| 3-b2c8-d0950711d3 |                   |            |                   |       |                | agent               |
| eb                |                   |            |                   |       |                |                     |
| e664e138-1584-4b4 | Linux bridge      | controller |                   | 🙂   | True           | neutron-            |
| 8-a582-7a40f7c9ae | agent             |            |                   |       |                | linuxbridge-agent   |
| d0                |                   |            |                   |       |                |                     |
+-------------------+-------------------+------------+-------------------+-------+----------------+---------------------+

 

 

3./etc/cinder/cinder.conf文件中的my_ip

systemctl restart openstack-cinder-volume.service target.service

 

[root@controller ~]# openstack volume service list
+------------------+------------+------+---------+-------+----------------------------+
| Binary           | Host       | Zone | Status  | State | Updated At                 |
+------------------+------------+------+---------+-------+----------------------------+
| cinder-scheduler | controller | nova | enabled | up    | 2019-08-28T08:23:22.000000 |
| cinder-volume    | ken2@lvm   | nova | enabled | up    | 2019-08-28T08:23:23.000000 |
| cinder-volume    | ken3@lvm   | nova | enabled | up    | 2019-08-28T08:23:29.000000 |
+------------------+------------+------+---------+-------+----------------------------+

 

 

添加一个新的主机之后还需要添加新的主机至cell数据库,执行如下的命令

 su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova

 

 

否则在创建虚拟机的时候报如下的错误

Host ‘ken3’ is not mapped to any cell

 

######################################################

 

neutron.conf

[DEFAULT]
state_path = /var/lib/neutron
auth_strategy = keystone
core_plugin = ml2
service_plugins = router
dhcp_agent_notification = true
allow_overlapping_ips = True
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true
transport_url = rabbit://openstack:admin@controller
 
[agent]
 
[cors]
 
[cors.subdomain]
 
[database]
connection = mysql+pymysql://neutron:NEUTRON_DBPASS@controller/neutron
 
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron
 
[matchmaker_redis]
 
[nova]
region_name = RegionOne
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
project_name = service
user_domain_name = default
username = nova
password = nova
 
[oslo_concurrency]
lock_path = $state_path/lock
 
[oslo_messaging_amqp]
 
[oslo_messaging_kafka]
 
[oslo_messaging_notifications]
 
[oslo_messaging_rabbit]
 
[oslo_messaging_zmq]
 
[oslo_middleware]
 
[oslo_policy]
 
[qos]
 
[quotas]
 
[ssl]

 

ml2_conf.ini

[DEFAULT]
 
[ml2]
type_drivers = flat,vxlan
tenant_network_types = vxlan
mechanism_drivers = openvswitch,l2population
extension_drivers = port_security
 
[ml2_type_flat]
 
[ml2_type_geneve]
 
[ml2_type_gre]
 
[ml2_type_vlan]
 
[ml2_type_vxlan]
vni_ranges = 1:1000
 
[securitygroup]
enable_ipset = true

 

openvswitch_agent.ini

[DEFAULT]
 
[agent]
tunnel_types = vxlan
l2_population = True
 
[ovs]
tunnel_bridge = br-tun
local_ip = 192.168.254.63
bridge_mappings =
 
[securitygroup]
firewall_driver = iptables_hybrid
enable_security_group = true
 
[xenapi]

 

 

l3_agent.ini

[DEFAULT]
interface_driver = openvswitch
external_network_bridge = br-ex
 
[agent]
 
[ovs]

 

metadata_agent.ini

[DEFAULT]
nova_metadata_ip = controller
metadata_proxy_shared_secret = METADATA_SECRET
 
[agent]
 
[cache]

 

dhcp_agent.ini

[DEFAULT]
interface_driver = openvswitch
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
 
[agent]
 
[ovs]

 

注意:配置完配置文件后,提前准备ovs外网用的网桥,之后同步数据库,启动服务:

 

(控制)yum install openstack-neutron openstack-neutron-ml2 openvswitch openstack-neutron-openvswitch ebtables -y
 
systemctl enable neutron-server.service neutron-dhcp-agent.service openvswitch neutron-openvswitch-agent neutron-metadata-agent.service
 
systemctl start neutron-server.service neutron-dhcp-agent.service openvswitch neutron-openvswitch-agent neutron-metadata-agent.service
 
ovs-vsctl add-br br-ex
 
ovs-vsctl add-port br-ex eth2
 
systemctl enable neutron-l3-agent.service
 
systemctl start neutron-l3-agent.service
 
(计算)yum install openvswitch openstack-neutron-openvswitch ebtables ipset
systemctl enable openvswitch neutron-openvswitch-agent
systemctl start openvswitch neutron-openvswitch-agent
systemctl stop openvswitch neutron-openvswitch-agent

 

 

 

发表评论

邮箱地址不会被公开。