Neutron Networking

Download
heat_template_version: 2015-04-30

description: OpenStack Neutron with ACI - Provider - Consumer

resources:

  private_net:
    type: OS::Neutron::Net
    
    properties: 
      name: private_net
  
  private_subnet:
    type: OS::Neutron::Subnet
    
    properties:
      name: private_subnet
      cidr: 192.168.0.0/24
      gateway_ip: '192.168.0.1'
      network_id: {get_resource: private_net}
  
  router:
    type: OS::Neutron::Router
    
    properties:
      name: router
      external_gateway_info: {network: public}
  
  router_interface:
    type: OS::Neutron::RouterInterface
    
    depends_on: [private_net, private_subnet]
    properties:
      router_id: {get_resource: router}
      subnet_id: {get_resource: private_subnet}
  
  vm_consumer:
    type: OS::Nova::Server
    
    properties:
      name: vm_consumer
      image: Debian 8
      flavor: m1.small
      networks:
        - port: { get_resource: vm_consumer_port0 }

  vm_consumer_port0:
    type: OS::Neutron::Port
    
    properties:
      name: vm_consumer_port0
      fixed_ips:
      - {ip_address: 192.168.0.3}
      network: {get_resource: private_net}
      security_groups:
      - { get_resource: security_group_provider }
      
  vm_provider:
    type: OS::Nova::Server
    
    properties:
      name: vm_provider
      image: Debian 8
      flavor: m1.small
      networks:
        - port: { get_resource: vm_provider_port0 }
  
  vm_provider_port0:
    type: OS::Neutron::Port
    
    properties:
      name: vm_provider_port0
      fixed_ips:
      - {ip_address: 192.168.0.4}
      network: {get_resource: private_net}
      security_groups:
      - { get_resource: security_group_provider }
      - { get_resource: security_group_external }
  
  security_group_provider:
    type: OS::Neutron::SecurityGroup
    
    properties:
      name: security_group_provider
      description: Ping and SSH
      rules:
      - protocol: icmp
      - protocol: tcp
        port_range_min: 22
        port_range_max: 22
        remote_ip_prefix: "192.168.0.0/24"
  
  security_group_external:
    type: OS::Neutron::SecurityGroup
    
    properties:
      name: security_group_external
      description: Ping and SSH
      rules:
      - protocol: icmp
      - protocol: tcp
        port_range_min: 22
        port_range_max: 22
        remote_ip_prefix: "0.0.0.0/24"
 
  vm_provider_floating_ip_association:
    type: OS::Neutron::FloatingIPAssociation
    
    properties:
      floatingip_id: {get_resource: floating_ip}
      port_id: { get_resource: vm_provider_port0 }
  
  floating_ip:
    type: OS::Neutron::FloatingIP
    
    properties:
      floating_network_id: public

Last modified: 0001-01-01