CircularDependencyException - Accessing a property within the resource

asked 2019-01-24 05:41:42 -0600

Subeesh KK gravatar image

updated 2019-01-30 00:17:17 -0600

Hi all -

I wanted to access a property within the same resource.

    type: OS::Nova::Server
        image: { get_param: image }
        flavor: { get_param: flavor }
        name:  { get_param: [ vmNames, get_param: index ] }
                    <%port%>: { get_param: allnetworks }
                    network: <%port%>

      user_data_format: RAW
        user_data_update_policy: IGNORE
                    $IPADDRESSES: { get_attr: [extServer, networks] }

I wanted to retrieve the IP address assigned to each network and I am trying to get it via get_attr like above. This throws the circular dependency error.

I know it is possible to get it from the outputs section. But, is there any way to get the networks assigned from within the same resource? Will "addresses" property help within the resource/server ? Or I can only access it from outside that resource?

please help

Thank You, Subeesh

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-01-30 01:20:15 -0600

zaneb gravatar image

No, there's no way to access the attributes from the same resource. Attributes aren't available until the resource is complete, while properties must be available before the resource is started. That's why you'll always get a CircularDependencyError if you try it.

One alternative is to use a SoftwareDeployment to pass the data you want to the server, since this runs after the server is created.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2019-01-24 05:41:42 -0600

Seen: 78 times

Last updated: Jan 30 '19