No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Guide for Interworking Between HUAWEI CloudFabric Solution and Redhat OpenStack

Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Modifying the YAML Template

Modifying the YAML Template

The director uses Heat Orchestration Templates (HOT) as a template format for its Overcloud deployment plan. Templates in HOT format are mostly expressed in YAML format. The purpose of a template is to define and create a stack, which is a collection of resources that Heat creates and configures. Resources are objects in the OpenStack and can include computing resources, network configuration, security groups, scaling rules, and custom resources.

You can use the default template or customize a template. The default template is in the /usr/share/openstack-tripleo-heat-templates directory. The default template has limited functions and cannot meet the actual requirements. To customize a template, you need to configure the following YAML files: controller.yaml, compute.yaml, ceph.yaml, network-environment.yaml, network-isolation.yaml, and storage-environment.yaml. In this project, only the controller.yaml, compute.yaml, network-environment.yaml, and network-isolation.yaml files are used.

Create the templates directory in the /home/stack directory of the director VM and copy the default YAML template to the templates directory.

mkdir /home/stack/templates
cp -r /usr/share/openstack-tripleo-heat-templates/ /home/stack/templates/

Select the bond mode or single-card mode according to the actual situation. Copy the network description file to the /home/stack/templates/nic-configs/ directory. This operation is not required in this example.

mkdir ~/templates/nic-configs/
cp -r /usr/share/openstack-tripleo-heat-templates/network/config/ bond-with-vlans /home/stack/templates/nic-configs/

You are advised to modify the template based on the actual environment by referring to templates.rar.

templates.rar

  1. Configure the network-environment.yaml file.

    Modify the following parameters in the /home/stack/templates/network-environment.yaml file:

    • ControlPlaneSubnetCidr: number of bits in the subnet mask of the PXE network.
    • ControlPlaneDefaultRoute and EC2MetadataIp: PXE IP address of the Undercloud.

    In this example, the network-environment.yaml file content is as follows:

    #This file is an example of an environment file for defining the isolated
    #networks and related parameters.
    resource_registry:
    # Network Interface templates to use (these files must exist)
    #  OS::TripleO::BlockStorage::Net::SoftwareConfig:
    #    ../network/config/single-nic-vlans/cinder-storage.yaml
    OS::TripleO::Compute::Net::SoftwareConfig:
    /home/stack/templates/nic-configs/compute.yaml
    OS::TripleO::Controller::Net::SoftwareConfig:
    /home/stack/templates/nic-configs/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
    # CIDR subnet mask length for provisioning network
    ControlPlaneSubnetCidr: '24'
    # Gateway router for the provisioning network (or Undercloud IP)
    ControlPlaneDefaultRoute: 172.24.50.1
    EC2MetadataIp: 172.24.50.1  # Generally the IP of the Undercloud
    # Customize the IP subnets to match the local environment
    InternalApiNetCidr: 172.24.51.0/24
    #  StorageNetCidr: 172.18.0.0/24
    #  StorageMgmtNetCidr: 172.19.0.0/24
    TenantNetCidr: 172.24.53.0/24
    ExternalNetCidr: 172.24.52.0/24
    # Customize the VLAN IDs to match the local environment
    InternalApiNetworkVlanID: 51
    #  StorageNetworkVlanID: 30
    #  StorageMgmtNetworkVlanID: 40
    TenantNetworkVlanID: 53
    ExternalNetworkVlanID: 52
    # Customize the IP ranges on each network to use for static IPs and VIPs
    InternalApiAllocationPools: [{'start': '172.24.51.1', 'end': '172.24.51.100'}]
    #  StorageAllocationPools: [{'start': '172.18.0.10', 'end': '172.18.0.200'}]
    #  StorageMgmtAllocationPools: [{'start': '172.19.0.10', 'end': '172.19.0.200'}]
    TenantAllocationPools: [{'start': '172.24.53.1', 'end': '172.24.53.100'}]
    # Leave room if the external network is also used for floating IPs
    ExternalAllocationPools: [{'start': '172.24.52.5', 'end': '172.24.52.50'}]
    # Gateway router for the external network
    ExternalInterfaceDefaultRoute: 172.24.52.254
    # Uncomment if using the Management Network (see network-management.yaml)
    # ManagementNetCidr: 10.0.1.0/24
    # ManagementAllocationPools: [{'start': '10.0.1.10', 'end', '10.0.1.50'}]
    # Use either this parameter or ControlPlaneDefaultRoute in the NIC templates
    # ManagementInterfaceDefaultRoute: 10.0.1.1
    # Define the DNS servers (maximum 2) for the overcloud nodes
    DnsServers: ["8.8.8.8","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'
    # Customize bonding options, e.g. "mode=4 lacp_rate=1 updelay=1000 miimon=100"
    #  BondInterfaceOvsOptions: "bond_mode=active-backup"
  2. Configure the network-isolation.yaml file. In this example, the network-isolation.yaml file content is as follows:

    # Enable the creation of Neutron networks for isolated Overcloud
    # traffic and configure each role to assign ports (related
    # to that role) on these networks.
    resource_registry:
    OS::TripleO::Network::External: ../network/external.yaml
    OS::TripleO::Network::InternalApi: ../network/internal_api.yaml
    #OS::TripleO::Network::StorageMgmt: ../network/storage_mgmt.yaml
    #OS::TripleO::Network::Storage: ../network/storage.yaml
    OS::TripleO::Network::Tenant: ../network/tenant.yaml
    # Management network is optional and disabled by default.
    # To enable it, include environments/network-management.yaml
    #OS::TripleO::Network::Management: ../network/management.yaml
    
    # Port assignments for the VIPs
    OS::TripleO::Network::Ports::ExternalVipPort: ../network/ports/external.yaml
    OS::TripleO::Network::Ports::InternalApiVipPort: ../network/ports/internal_api.yaml
    #OS::TripleO::Network::Ports::StorageVipPort: ../network/ports/storage.yaml
    #OS::TripleO::Network::Ports::StorageMgmtVipPort: ../network/ports/storage_mgmt.yaml
    OS::TripleO::Network::Ports::RedisVipPort: ../network/ports/vip.yaml
    
    # Port assignments for service virtual IPs for the controller role
    OS::TripleO::Controller::Ports::RedisVipPort: ../network/ports/vip.yaml
    # Port assignments for the controller role
    OS::TripleO::Controller::Ports::ExternalPort: ../network/ports/external.yaml
    OS::TripleO::Controller::Ports::InternalApiPort: ../network/ports/internal_api.yaml
    #OS::TripleO::Controller::Ports::StoragePort: ../network/ports/storage.yaml
    #OS::TripleO::Controller::Ports::StorageMgmtPort: ../network/ports/storage_mgmt.yaml
    OS::TripleO::Controller::Ports::TenantPort: ../network/ports/tenant.yaml
    #OS::TripleO::Controller::Ports::ManagementPort: ../network/ports/management.yaml
    
    # Port assignments for the compute role
    OS::TripleO::Compute::Ports::ExternalPort: ../network/ports/noop.yaml
    OS::TripleO::Compute::Ports::InternalApiPort: ../network/ports/internal_api.yaml
    #OS::TripleO::Compute::Ports::StoragePort: ../network/ports/storage.yaml
    #OS::TripleO::Compute::Ports::StorageMgmtPort: ../network/ports/noop.yaml
    OS::TripleO::Compute::Ports::TenantPort: ../network/ports/tenant.yaml
    #OS::TripleO::Compute::Ports::ManagementPort: ../network/ports/management.yaml
    
    # Port assignments for the ceph storage role
    OS::TripleO::CephStorage::Ports::ExternalPort: ../network/ports/noop.yaml
    OS::TripleO::CephStorage::Ports::InternalApiPort: ../network/ports/noop.yaml
    #OS::TripleO::CephStorage::Ports::StoragePort: ../network/ports/storage.yaml
    #OS::TripleO::CephStorage::Ports::StorageMgmtPort: ../network/ports/storage_mgmt.yaml
    OS::TripleO::CephStorage::Ports::TenantPort: ../network/ports/noop.yaml
    #OS::TripleO::CephStorage::Ports::ManagementPort: ../network/ports/management.yaml
    
    # Port assignments for the swift storage role
    OS::TripleO::SwiftStorage::Ports::ExternalPort: ../network/ports/noop.yaml
    OS::TripleO::SwiftStorage::Ports::InternalApiPort: ../network/ports/internal_api.yaml
    OS::TripleO::SwiftStorage::Ports::StoragePort: ../network/ports/storage.yaml
    OS::TripleO::SwiftStorage::Ports::StorageMgmtPort: ../network/ports/storage_mgmt.yaml
    OS::TripleO::SwiftStorage::Ports::TenantPort: ../network/ports/noop.yaml
    #OS::TripleO::SwiftStorage::Ports::ManagementPort: ../network/ports/management.yaml
    
    # Port assignments for the block storage role
    OS::TripleO::BlockStorage::Ports::ExternalPort: ../network/ports/noop.yaml
    OS::TripleO::BlockStorage::Ports::InternalApiPort: ../network/ports/internal_api.yaml
    OS::TripleO::BlockStorage::Ports::StoragePort: ../network/ports/storage.yaml
    OS::TripleO::BlockStorage::Ports::StorageMgmtPort: ../network/ports/storage_mgmt.yaml
    OS::TripleO::BlockStorage::Ports::TenantPort: ../network/ports/noop.yaml
    #OS::TripleO::BlockStorage::Ports::ManagementPort: ../network/ports/management.yaml
  3. Configure controller.yaml and compute.yaml, and map the NIC name to the network plan. The following uses the controller.yaml file as an example.

    In this example, the controller.yaml file content is as follows:

    heat_template_version: 2015-04-30
    
    description: >
    Software Config to drive os-net-config to configure multiple interfaces
    for the controller role.
    
    parameters:
    ControlPlaneIp:
    default: ''
    description: IP address/subnet on the ctlplane network
    type: string
    ExternalIpSubnet:
    default: ''
    description: IP address/subnet on the external network
    type: string
    InternalApiIpSubnet:
    default: ''
    description: IP address/subnet on the internal API network
    type: string
    StorageIpSubnet:
    default: ''
    description: IP address/subnet on the storage network
    type: string
    StorageMgmtIpSubnet:
    default: ''
    description: IP address/subnet on the storage mgmt network
    type: string
    TenantIpSubnet:
    default: ''
    description: IP address/subnet on the tenant network
    type: string
    ManagementIpSubnet: # Only populated when including environments/network-management.yaml
    default: ''
    description: IP address/subnet on the management network
    type: string
    ExternalNetworkVlanID:
    default: 52
    description: Vlan ID for the external network traffic.
    type: number
    InternalApiNetworkVlanID:
    default: 51
    description: Vlan ID for the internal_api network traffic.
    type: number
    StorageNetworkVlanID:
    default: 30
    description: Vlan ID for the storage network traffic.
    type: number
    StorageMgmtNetworkVlanID:
    default: 40
    description: Vlan ID for the storage mgmt network traffic.
    type: number
    TenantNetworkVlanID:
    default: 53
    description: Vlan ID for the tenant network traffic.
    type: number
    ManagementNetworkVlanID:
    default: 60
    description: Vlan ID for the management network traffic.
    type: number
    ControlPlaneSubnetCidr: # Override this via parameter_defaults
    default: '24'
    description: The subnet CIDR of the control plane network.
    type: string
    ControlPlaneDefaultRoute: # Override this via parameter_defaults
    description: The default route of the control plane network.
    type: string
    ExternalInterfaceDefaultRoute:
    description: default route for the external network
    type: string
    ManagementInterfaceDefaultRoute: # Commented out by default in this template
    default: unset
    description: The default route of the management network.
    type: string
    DnsServers: # Override this via parameter_defaults
    default: []
    description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf.
    type: comma_delimited_list
    EC2MetadataIp: # Override this via parameter_defaults
    description: The IP address of the EC2 metadata server.
    type: string
    
    resources:
    OsNetConfigImpl:
    type: OS::Heat::StructuredConfig
    properties:
    group: os-apply-config
    config:
    os_net_config:
    network_config:
    -
    type: interface
    name: enp2s0f0
    use_dhcp: false
    dns_servers: {get_param: DnsServers}
    addresses:
    -
    ip_netmask:
    list_join:
    - '/'
    - - {get_param: ControlPlaneIp}
    - {get_param: ControlPlaneSubnetCidr}
    routes:
    -
    ip_netmask: 169.254.169.254/32
    next_hop: {get_param: EC2MetadataIp}
    
    -
    type: interface
    name: enp2s0f1
    use_dhcp: false
    addresses:
    -
    ip_netmask: {get_param: InternalApiIpSubnet}
    
    -
    # Create a bridge which can also be used for VLAN-mode bridge mapping
    type: ovs_bridge
    name: br-tenant
    use_dhcp: false
    members:
    -
    type: interface
    name: enp2s0f2
    use_dhcp: false
    # force the MAC address of the bridge to this interface
    primary: true
    -
    type: vlan
    vlan_id: {get_param: TenantNetworkVlanID}
    addresses:
    -
    ip_netmask: {get_param: TenantIpSubnet}
    
    -
    type: ovs_bridge
    name: br-ex
    dns_servers: {get_param: DnsServers}
    use_dhcp: false
    members:
    -
    type: interface
    name: enp2s0f3
    primary: true
    
    -
    type: vlan
    vlan_id: {get_param: ExternalNetworkVlanID}
    addresses:
    - ip_netmask: {get_param: ExternalIpSubnet}
    routes:
    -
    default: true
    next_hop: {get_param: ExternalInterfaceDefaultRoute}
    
    # Uncomment when including environments/network-management.yaml
    # If setting default route on the Management interface, comment
    # out the default route on the External interface. This will
    # make the External API unreachable from remote subnets.
    #-
    #  type: interface
    #  name: nic7
    #  use_dhcp: false
    #  addresses:
    #    -
    #      ip_netmask: {get_param: ManagementIpSubnet}
    #  routes:
    #    -
    #      default: true
    #      next_hop: {get_param: ManagementInterfaceDefaultRoute}
    
    outputs:
    OS::stack_id:
    description: The OsNetConfigImpl resource.
    value: {get_resource: OsNetConfigImpl}
    In this example, the compute.yaml file content is as follows:
    heat_template_version: 2015-04-30
    
    description: >
    Software Config to drive os-net-config to configure multiple interfaces
    for the compute role.
    
    parameters:
    ControlPlaneIp:
    default: ''
    description: IP address/subnet on the ctlplane network
    type: string
    ExternalIpSubnet:
    default: ''
    description: IP address/subnet on the external network
    type: string
    InternalApiIpSubnet:
    default: ''
    description: IP address/subnet on the internal API network
    type: string
    StorageIpSubnet:
    default: ''
    description: IP address/subnet on the storage network
    type: string
    StorageMgmtIpSubnet:
    default: ''
    description: IP address/subnet on the storage mgmt network
    type: string
    TenantIpSubnet:
    default: ''
    description: IP address/subnet on the tenant network
    type: string
    ManagementIpSubnet: # Only populated when including environments/network-management.yaml
    default: ''
    description: IP address/subnet on the management network
    type: string
    ExternalNetworkVlanID:
    default: 52
    description: Vlan ID for the external network traffic.
    type: number
    InternalApiNetworkVlanID:
    default: 51
    description: Vlan ID for the internal_api network traffic.
    type: number
    StorageNetworkVlanID:
    default: 30
    description: Vlan ID for the storage network traffic.
    type: number
    StorageMgmtNetworkVlanID:
    default: 40
    description: Vlan ID for the storage mgmt network traffic.
    type: number
    TenantNetworkVlanID:
    default: 53
    description: Vlan ID for the tenant network traffic.
    type: number
    ManagementNetworkVlanID:
    default: 60
    description: Vlan ID for the management network traffic.
    type: number
    ControlPlaneSubnetCidr: # Override this via parameter_defaults
    default: '24'
    description: The subnet CIDR of the control plane network.
    type: string
    ControlPlaneDefaultRoute: # Override this via parameter_defaults
    description: The default route of the control plane network.
    type: string
    ExternalInterfaceDefaultRoute: # Not used by default in this template
    default: '172.24.52.254'
    description: The default route of the external network.
    type: string
    ManagementInterfaceDefaultRoute: # Commented out by default in this template
    default: unset
    description: The default route of the management network.
    type: string
    DnsServers: # Override this via parameter_defaults
    default: []
    description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf.
    type: comma_delimited_list
    EC2MetadataIp: # Override this via parameter_defaults
    description: The IP address of the EC2 metadata server.
    type: string
    
    resources:
    OsNetConfigImpl:
    type: OS::Heat::StructuredConfig
    properties:
    group: os-apply-config
    config:
    os_net_config:
    network_config:
    -
    type: interface
    name: enp2s0f0
    use_dhcp: false
    dns_servers: {get_param: DnsServers}
    addresses:
    -
    ip_netmask:
    list_join:
    - '/'
    - - {get_param: ControlPlaneIp}
    - {get_param: ControlPlaneSubnetCidr}
    routes:
    -
    ip_netmask: 169.254.169.254/32
    next_hop: {get_param: EC2MetadataIp}
    -
    default: true
    next_hop: {get_param: ControlPlaneDefaultRoute}
    
    -
    type: interface
    name: enp2s0f1
    use_dhcp: false
    addresses:
    -
    ip_netmask: {get_param: InternalApiIpSubnet}
    -
    # Create a bridge which can also be used for VLAN-mode bridge mapping
    type: ovs_bridge
    name: br-tenant
    members:
    -
    type: interface
    name: enp129s0f0
    primary: true
    
    -
    type: vlan
    vlan_id: {get_param: TenantNetworkVlanID}
    addresses:
    -
    ip_netmask: {get_param: TenantIpSubnet}
    # Uncomment when including environments/network-management.yaml
    # If setting default route on the Management interface, comment
    # out the default route on the Control Plane.
    #-
    #  type: interface
    #  name: nic7
    #  use_dhcp: false
    #  addresses:
    #    -
    #      ip_netmask: {get_param: ManagementIpSubnet}
    #  routes:
    #    -
    #      default: true
    #      next_hop: {get_param: ManagementInterfaceDefaultRoute}
    
    outputs:
    OS::stack_id:
    description: The OsNetConfigImpl resource.
    value: {get_resource: OsNetConfigImpl}

Download
Updated: 2019-03-25

Document ID: EDOC1100072313

Views: 2384

Downloads: 15

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next