Ask Your Question
0

CircularDependencyException - Accessing a property within the resource

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

Subeesh KK gravatar image

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

Hi all -

I wanted to access a property within the same resource.

extServer:
    type: OS::Nova::Server
    properties:
        image: { get_param: image }
        flavor: { get_param: flavor }
        name:  { get_param: [ vmNames, get_param: index ] }
        networks:         
            repeat:
                for_each:
                    <%port%>: { get_param: allnetworks }
                template:
                    network: <%port%>

      user_data_format: RAW
        user_data_update_policy: IGNORE
        user_data:
            str_replace:
                params:
                    $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
0

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

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

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: 2019-01-24 05:41:42 -0500

Seen: 12 times

Last updated: Jan 30