Ask Your Question
0

Trouble assigning output from NOVA Server to Designate record

asked 2017-07-21 11:12:10 -0500

Lance Haig gravatar image

Hi,

I have the following instance code

instanc:
  type: OS::Nova::Server
  properties:
    name: server1-prod-nightly
    image: { get_param: image }
    flavor: { get_param: flavor }
    key_name: { get_param: key_name }
    networks:
      - port: { get_resource: instance_port }

and I am trying to create a DNS record from the output of the Instance.

instance_record:
    type: OS::Designate::Record
    properties:
      data: { get_attr: [ instance, first_address ] }
      description: { get_attr: [instance, name] }
      domain: { get_param: dns_zone }
      name: { get_attr: [instance, name] }
      type: "A"

For some reason it is giving me an error

resources.instance_stack: Went to status CREATE_FAILED due to "BadRequest: resources.instance_record: Provided object does not match schema"

Is it possible to use the output from Nova Server to populate the DNS record?

Thanks

Lance

edit retag flag offensive close merge delete

Comments

I guess it doesn't work because OS::Nova::Server doesn't have an attribute first_address. The best way to retrieve the address is via instance_port, I think; otherwise, through the server attribute addresses.

Bernd Bausch gravatar imageBernd Bausch ( 2017-07-21 21:26:26 -0500 )edit

There is a first_address attribute, but it's deprecated and hidden from the docs.

zaneb gravatar imagezaneb ( 2017-07-24 10:04:23 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-07-24 02:14:09 -0500

Lance Haig gravatar image

I found my mistake the Designate Resource requires that the name provided be a FQDN

I was just passing in the name.

It should look like this

instance_record:
    type: OS::Designate::Record
    properties:
      data: { get_attr: [ instance, first_address ] }
      description: { get_attr: [instance, name] }
      domain: { get_param: dns_zone }
      name: { list_join: ['.', [{ get_attr: [instance, name] }, { get_param: dns_zone }]] }
      type: "A"
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: 2017-07-21 11:12:10 -0500

Seen: 130 times

Last updated: Jul 24 '17