自定义网络
1.创建隔离网络
在TripleO的默认部署中,所有的网络流量都走Provisioning Network。那能不能把每种类型的网络分离出来?当然可以!
TripleO网络中有以下网络类型:
Network 1 - Provisioning
Network 2 - Internal API
Network 3 - Tenant Networks
Network 4 - Storage
Network 5 - Storage Management
Network 7 - External and Floating IP (mapped after Overcloud creation)
假设我们有如下网络,应该如何写网络配置文件。
网络类型 | Subnet | VLAN |
---|---|---|
PXE/SSH | 192.0.2.0/24 | access |
Internal API | 172.16.0.0/24 | 201 |
Tenant | 172.17.0.0/24 | 202 |
Storage | 172.18.0.0/24 | 203 |
Storage Management | 172.19.0.0/24 | 204 |
External / Floating IP | 192.168.122.0/24 | 205 |
编写network-environment.yaml
resource_registry:
# 为每个类型的节点指定网卡配置文件 (这些文件必须存在)
OS::TripleO::BlockStorage::Net::SoftwareConfig:
../network/config/single-nic-vlans/cinder-storage.yaml
OS::TripleO::Compute::Net::SoftwareConfig:
../network/config/single-nic-vlans/compute.yaml
OS::TripleO::Controller::Net::SoftwareConfig:
../network/config/single-nic-vlans/controller.yaml
OS::TripleO::ObjectStorage::Net::SoftwareConfig:
../network/config/single-nic-vlans/swift-storage.yaml
OS::TripleO::CephStorage::Net::SoftwareConfig:
../network/config/single-nic-vlans/ceph-storage.yaml
parameter_defaults:
# This section is where deployment-specific configuration is done
# PXE(也叫ControlPlane)网络的掩码
ControlPlaneSubnetCidr: '24'
# PXE网络的网关,使用Management网络时也需要填写。
ControlPlaneDefaultRoute: 10.0.131.1
EC2MetadataIp: 10.0.131.2 # Generally the IP of the Undercloud
# 指定各种网络的子网
InternalApiNetCidr: 10.0.132.0/24
StorageNetCidr: 10.0.133.0/24
StorageMgmtNetCidr: 10.0.134.0/24
TenantNetCidr: 10.0.135.0/24
ExternalNetCidr: 10.0.136.0/24
# 指定各类网络的vlan id
InternalApiNetworkVlanID: 4002
StorageNetworkVlanID: 4003
StorageMgmtNetworkVlanID: 4004
TenantNetworkVlanID: 4005
ExternalNetworkVlanID: 4006
# 指定各类网络的IP地址范围 (IP和Vip)
InternalApiAllocationPools: [{'start': '10.0.132.51', 'end': '10.0.132.80'}]
StorageAllocationPools: [{'start': '10.0.133.51', 'end': '10.0.133.80'}]
StorageMgmtAllocationPools: [{'start': '10.0.134.51', 'end': '10.0.134.80'}]
TenantAllocationPools: [{'start': '10.0.135.51', 'end': '10.0.135.80'}]
# Leave room if the external network is also used for floating IPs
ExternalAllocationPools: [{'start': '10.0.136.51', 'end': '10.0.136.200'}]
# External 网络的网关
ExternalInterfaceDefaultRoute: 10.0.136.1
# Management 网络
ManagementNetCidr: 10.0.130.0/24
ManagementAllocationPools: [{'start': '10.0.130.51', 'end', '10.0.130.80'}]
# Use either this parameter or ControlPlaneDefaultRoute in the NIC templates
ManagementInterfaceDefaultRoute: 10.0.130.1
# Define the DNS servers (maximum 2) for the overcloud nodes
DnsServers: ["119.29.29.29","8.8.4.4"]
# Set to empty string to enable multiple external networks or VLANs
NeutronExternalNetworkBridge: "''"
# The tunnel type for the tenant network (vxlan or gre). Set to '' to disable tunneling.
NeutronTunnelTypes: 'vxlan'
NeutronTenantNetwork: 'vxlan'
# bond 网络类型
BondInterfaceOvsOptions: "bond_mode=active-backup"
# external 网络别名
NeutronBridgeMappings: "datacentre:br-ex"
# external vlan网络范围
NeutronNetworkVLANRanges: "datacentre:4007:4015"
2. 为主机指定IP
在使用isolation network部署overcloud时,所有的isolation netwrok IP 都会从network-environment.yaml
定义的pool中获取。在部署生产环境时,一定不想让IP可控:每台节点都随机的从IP pool里随机挑选IP会让排错异常困难。因为你不知道哪个节点用哪个IP。那么 How?
要为主机指定固定IP,需要ips-from-pool-all.yaml
$ cp /usr/share/openstack-tripleo-heat-templates/environments/ips-from-pool-all.yaml ~/templates/
在ips-from-pool-all.yaml
中指定IP
a
3. 部署代码自定义
3.
Vip registry
resource_registry:
OS::TripleO::Network::Ports::NetVipMap: /usr/share/openstack-tripleo-heat-templates/network/ports/net_vip_map_external.yaml
OS::TripleO::Network::Ports::ExternalVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
OS::TripleO::Network::Ports::InternalApiVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
OS::TripleO::Network::Ports::StorageVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
OS::TripleO::Network::Ports::StorageMgmtVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
OS::TripleO::Network::Ports::RedisVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/from_service.yaml
Vip parameter
parameter_defaults:
...
# Predictable VIPs
ControlPlaneIP: 192.168.0.230
ExternalNetworkVip: 10.1.1.190
InternalApiNetworkVip: 172.16.0.30
StorageNetworkVip: 172.18.0.30
StorageMgmtNetworkVip: 172.19.0.40
ServiceVips:
redis: 172.16.0.31
当前内容版权归 UnitedStack 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 UnitedStack .