Ask Your Question
0

neutron error while launching with heat

asked 2014-08-07 02:20:44 -0500

dubi gravatar image

updated 2014-08-07 13:46:31 -0500

zaneb gravatar image

I get the following error while using heat to provision a VM from a template:

JSON response :

{"stacks": [{"description": "Generated template", "links": [{"href": "http://9.148.45.17:8004/v1/5eae73fa860c4291bab537f5e45e849b/stacks/stack/995f363c-00d4-49c6-9907-aca1470d28ea", "rel": "self"}], "stack_status_reason": "Resource CREATE failed: HT-15306C5 NeutronClientException: 503-{u'NeutronError': {u'message': u'Unable to create the network. No tenant network is available for allocation.', u'type': u'NoNetworkAvailable', u'detail': u''}}", "stack_name": "stack", "creation_time": "2014-08-05T13:51:07Z", "updated_time": null, "stack_status": "CREATE_FAILED", "id": "995f363c-00d4-49c6-9907-aca1470d28ea"},

The neutron flat network exists at the target openstack when I use the : heat -f <template file=""> stack-create command . Even if I erase the flat network from the target openstack system I get the same error . If I drop the network sections from the template the heat template gets applied ok at the target Openstack and IP is assigned from the existing flat network there to the launched VM .

The template was generated on one openstack then used on another target openstack with the network IP allocation ranges modified

attached below the heat template used :

########## Heat Template ##########
description: Generated template
heat_template_version: 2013-05-23
parameters:
  server_0_flavor:
    default: m1.tiny
    description: Flavor to use for server server_0
    type: string
  server_0_image:
    default: e35d4491-fd0d-4241-8524-8703c27608ff 
    description: Image to use to boot server server_0
    type: string

resources:
  network_0:
    properties:
      admin_state_up: true
      name: public_net
      shared: false
      tenant_id: 5eae73fa860c4291bab537f5e45e849b
    type: OS::Neutron::Net

  server_0:
    properties:
      block_device_mapping:
      - device_name: /dev/vdb
        volume_id:
          get_resource: volume_0
      diskConfig: AUTO
      flavor:
        get_param: server_0_flavor
      image:
        get_param: server_0_image
      name: test1
      networks:
      - network:
          get_resource: network_0
    type: OS::Nova::Server
  subnet_0:
    properties:
      allocation_pools:
      - "end": 9.148.45.94
        "start": 9.148.45.81
      cidr: 9.148.45.0/24
      dns_nameservers:
      - 9.148.5.22
      enable_dhcp: true
      host_routes: []
      ip_version: 4
      name: public_subnet
      tenant_id: 5eae73fa860c4291bab537f5e45e849b 
      network_id:
        get_resource: network_0
    type: OS::Neutron::Subnet
  volume_0:
    properties:
      metadata:
        attached_mode: rw
        readonly: 'False'
      name: my_vol
      size: 1
    type: OS::Cinder::Volume
edit retag flag offensive close merge delete

Comments

Could you edit the question and convert the Template to a code block with CRLF.. currently impossible to read it.

AndyHardwick gravatar imageAndyHardwick ( 2014-08-07 04:39:49 -0500 )edit

The ref to network_0 is in server_0 using the clause :

server_o:

networks: 
  - network:
          get_resource: network_0

Will that create a new net and subnet or just directs the launched VM to allocate IP from such existing net ? In fact even if I erased the existing net at the target openstack and applied the heat template
I got the same error . so the template defined network was not generated from scratch

dubi gravatar imagedubi ( 2014-08-07 06:49:28 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2014-08-07 08:49:43 -0500

Hi,

Now it is easier to read the template, I was incorrect in what I commented on before and something I should have asked earlier was are you using Neutron Flat or Neutron VLAN/GRE? If Flat then creating new networks will fail IMHO - which is why you get this "Unable to create the network. No tenant network is available for allocation.". As it is 'Flat' there is nothing to allocate. When using GRE/VLAN there will be a range of to allocate from be it tunnels or vlans.

Example network using GRE:

Provider Network
  Network Type: gre
  Physical Network: -
   Segmentation ID: 2

For what it is worth this templates works,

It creates - a network not connected to anything (no routers)

  • A subnet
  • The Volume
  • The server is then connected to the network created.
  • The Volume is attached

I slightly edited the template to look neater, I commented out your tenantID and added the 'gateway' property for completeness.

########## Heat Template ##########
description: Generated template
heat_template_version: 2013-05-23

parameters:
    server_0_flavor:
        default: m1.tiny
        description: Flavor to use for server server_0
        type: string

    server_0_image:
        default: e35d4491-fd0d-4241-8524-8703c27608ff
        description: Image to use to boot server server_0
        type: string

resources:

    network_0:
        type: OS::Neutron::Net
        properties:
            admin_state_up: true
            name: public_net
            shared: false
            #tenant_id: 5eae73fa860c4291bab537f5e45e849b

    server_0:
        type: OS::Nova::Server
        properties:
            block_device_mapping:
            - device_name: /dev/vdb
              volume_id: { get_resource: volume_0 }
            diskConfig: AUTO
            flavor: { get_param: server_0_flavor }
            image: { get_param: server_0_image }
            name: test1
            networks: [network: { get_resource: network_0 }]

    subnet_0:
        type: OS::Neutron::Subnet
        properties:
            network_id: { get_resource: network_0 }
            cidr: 9.148.45.0/24
            dns_nameservers : [9.148.5.22]
            #gateway_ip: xx.xx.xx.xx
            allocation_pools:
            - start: 9.148.45.81
              end: 9.148.45.94

    volume_0:
        type: OS::Cinder::Volume
        properties:
            name: my_vol
            size: 1
            metadata:
                attached_mode: rw
                readonly: 'False'
edit flag offensive delete link more

Comments

Thx . I am using Flat network Actually when I dropped the 'networks' section from the server_o above and erased network_o and subnet_o definitions the the VM heat launch succeeded and it auto allocated an IP for the VM from the existing flat network already defined (manualy before) at the target openstack

I thought IP allocation from existing specified network can also be commanded in Heat even if the existing network is flat

dubi gravatar imagedubi ( 2014-08-07 09:22:15 -0500 )edit
0

answered 2015-09-28 01:36:34 -0500

I have the similar kind of issue. what is going wrong in the below yml file for creating the flat network-

It gives error- Resource Create Failed: Neutronclientexception: 503-{U'Neutronerror': {U'Message': U'Unable To Create The Network. No Tenant Network Is Available For Allocation.', U'Type': U'Nonetworkavailable', U'Detail': U''}}

heat_template_version: 2013-05-23
description: Simple template to create a flat network

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"
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-08-07 02:20:44 -0500

Seen: 2,361 times

Last updated: Sep 28 '15