[Openstack Heat] - Problems to find right Heat syntax to declare static route in a router template

Lajos Katona katonalala at gmail.com
Tue Dec 20 10:34:34 UTC 2022


Hi,
For adding extra/static routes for your routers you have 2 ways in Heat
(actually Neutron API has it, and you can use them in hot also):

   - OS::Neutron::ExtraRoute
      -
      https://docs.openstack.org/api-ref/network/v2/index.html#update-router
      - OS::Neutron::ExtraRouteSet
      -
      https://docs.openstack.org/api-ref/network/v2/index.html#add-extra-routes-to-router

The 1st one is the "old" set router attribute, and the 2nd
is add_extraroutes & remove_extraroutes is optimized for concurrent updates
(see the API ref's description for add_extraroutes).
So in hot template it will look something like this:
type: OS::Neutron::ExtraRouteSet
properties:
   router: { get_resource: myrouter0 }
   routes:
    - destination: 179.24.2.0/24
      nexthop: 192.168.222.221

Lajos

ddorra at t-online.de <ddorra at t-online.de> ezt írta (időpont: 2022. dec. 19.,
H, 21:43):

> Hi,
>
>
>
> I want extend my router HOT template by adding a static route.
>
>
>
> In the Openstack cli this would be
>
>
>
>     openstack router add route --route destination='1.2.3.4/17',gateway='10.0.0.66'
> myrouter
>
>
>
> From the OS::Neutron::Router resource description I guess this belongs
> into the value_specs
>
> section as a map, but all my attempts failed, e.g.
>
>
>
> router1:
>   type: 'OS::Neutron::Router'
>   properties:
>     external_gateway_info:
>       network: provider
>     name: myrouter
>   value_specs:
>
>     route:
>       destination: '0.0.0.0/0'
>       gateway: '10.0.0.62'
>
>
>
> Can somebody help me with the correct syntax?
>
>
>
>
>
> Thanks & best regards,
>
> Dieter
>
>
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.openstack.org/pipermail/openstack-discuss/attachments/20221220/c110ed62/attachment-0001.htm>


More information about the openstack-discuss mailing list