IRSHAD
IRSHAD

Reputation: 2933

Openstack Heat template for flat network

I have configured 2-Node Openstack(Icehouse) setup and heat is also configured. when creating instance using HOT template it is successfully launched. But when I'm trying to create the flat network using my yml file it shows below error-

"Unable to create the network. No tenant network is available for allocation"

heat_template_version: 2013-05-23
description: Simple template to deploy a single compute instance

resources:
  provider_01:
     type: OS::Neutron::ProviderNet
     properties:
       physical_network: physnet2
       shared: true
       network_type: flat
  network_01:
     type: OS::Neutron::Net
     properties:
       admin_state_up: true
       name: External2
       shared: true
       #admin tenant id
       tenant_id: 6ec23610836048ddb8f9294dbf89a41e
  subnet_01:
     type: OS::Neutron::Subnet
     properties:
       name: Subnet2
       network_id: { get_resource: network_01 }
       cidr: 192.168.56.0/24
       gateway_ip: 192.168.56.1
       allocation_pools: [{"start": 192.168.56.50, "end": 192.168.56.70}]
       enable_dhcp: true
  port_01:
     type: OS::Neutron::Port
     properties:
       admin_state_up: true
       network_id: { get_resource: network_01 }
       #security_groups: "default"

Upvotes: 0

Views: 1335

Answers (1)

IRSHAD
IRSHAD

Reputation: 2933

heat_template_version: 2014-10-16
description: Template to create a tenant network along with router config

parameters:
    ImageId:
       type: string
       label: cirros-0.3.2-x86_64
       description: cirros-0.3.2-x86_64

resources:
    demo-net:
       type: OS::Neutron::Net
       properties:
          name: demo-net

    demo-subnet:
       type: OS::Neutron::Subnet
       properties:
          name: demo-subnet
          network_id: { get_resource: demo-net }
          cidr: 10.10.0.0/24
          gateway_ip: 10.10.0.1

    my_instance:
       type: OS::Nova::Server
       properties:
          name: "demo_test_nw_01"
          image: { get_param: ImageId }
          flavor: "m1.tiny"
          networks:
          - network : { get_resource: demo-net }

Upvotes: 0

Related Questions