Unknown resource Type : OS::TripleO::NodeUserData

Bug #1644487 reported by Amit Ugol on 2016-11-24
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Low
Carlos Camacho

Bug Description

Using firstboot to config nodes in advance fails on validation:

template:

heat_template_version: 2014-10-16
resources:
  userdata:
    type: OS::Heat::MultipartMime
    properties:
      parts:
      - config: {get_resource: update}
  update:
    type: OS::Heat::SoftwareConfig
    properties:
      config: |
        #!/bin/bash
        yum update -y

environment:

resource_registry:
    OS::TripleO::NodeUserData: first_boot_update_hook.yml

error from log:

HTTP/1.1 400 Bad Request
date: Thu, 24 Nov 2016 09:28:06 GMT
connection: keep-alive
content-type: application/json; charset=UTF-8
content-length: 1128
x-openstack-request-id: req-b0287dfd-5352-4ab1-b84a-ec65be3c7775

{"explanation": "The server could not comply with the request since it is either malformed or otherwise incorrect.", "code": 400, "error": {"message": "Failed to validate: Failed to validate: resources[0]: Unknown resource Type : OS::TripleO::NodeUserData", "traceback": "Traceback (most recent call last):\n\n File \"/usr/lib/python2.7/site-packages/heat/common/context.py\", line 308, in wrapped\n return func(self, ctx, *args, **kwargs)\n\n File \"/usr/lib/python2.7/site-packages/heat/engine/service.py\", line 730, in create_stack\n parent_resource_name)\n\n File \"/usr/lib/python2.7/site-packages/heat/engine/service.py\", line 641, in _parse_template_and_validate_stack\n stack.validate()\n\n File \"/usr/lib/python2.7/site-packages/osprofiler/profiler.py\", line 105, in wrapper\n return f(*args, **kwargs)\n\n File \"/usr/lib/python2.7/site-packages/heat/engine/stack.py\", line 679, in validate\n raise ex\n\nStackValidationFailed: Failed to validate: Failed to validate: resources[0]: Unknown resource Type : OS::TripleO::NodeUserData\n", "type": "StackValidationFailed"}, "title": "Bad Request"}

ERROR: Failed to validate: Failed to validate: resources[0]: Unknown resource Type : OS::TripleO::NodeUserData
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 374, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 54, in run
    self.take_action(parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 951, in take_action
    self._deploy_tripleo_heat_templates(stack, parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 357, in _deploy_tripleo_heat_templates
    environments, parsed_args.timeout)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 261, in _heat_deploy
    orchestration_client.stacks.create(**stack_args)
  File "/usr/lib/python2.7/site-packages/heatclient/v1/stacks.py", line 162, in create
    data=kwargs, headers=headers)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 281, in post
    return self.client_request("POST", url, **kwargs)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 271, in client_request
    resp, body = self.json_request(method, url, **kwargs)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 260, in json_request
    resp = self._http_request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 215, in _http_request
    raise exc.from_response(resp)
HTTPBadRequest: ERROR: Failed to validate: Failed to validate: resources[0]: Unknown resource Type : OS::TripleO::NodeUserData
clean_up DeployOvercloud: ERROR: Failed to validate: Failed to validate: resources[0]: Unknown resource Type : OS::TripleO::NodeUserData
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 112, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 255, in run
    result = self.run_subcommand(remainder)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 374, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 54, in run
    self.take_action(parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 951, in take_action
    self._deploy_tripleo_heat_templates(stack, parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 357, in _deploy_tripleo_heat_templates
    environments, parsed_args.timeout)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 261, in _heat_deploy
    orchestration_client.stacks.create(**stack_args)
  File "/usr/lib/python2.7/site-packages/heatclient/v1/stacks.py", line 162, in create
    data=kwargs, headers=headers)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 281, in post
    return self.client_request("POST", url, **kwargs)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 271, in client_request
    resp, body = self.json_request(method, url, **kwargs)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 260, in json_request
    resp = self._http_request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 215, in _http_request
    raise exc.from_response(resp)
HTTPBadRequest: ERROR: Failed to validate: Failed to validate: resources[0]: Unknown resource Type : OS::TripleO::NodeUserData

Changed in tripleo:
assignee: nobody → Carlos Camacho (ccamacho)
Carlos Camacho (ccamacho) wrote :
Download full text (3.1 KiB)

Mind to check that you are using latest master??

If not, tell me which branch are you using to test it.

Working for me (latest master), I ran these steps:

cd
mkdir firstboot
cat > firstboot/one_two.yaml << EOF
heat_template_version: 2014-10-16

resources:
  userdata:
    type: OS::Heat::MultipartMime
    properties:
      parts:
      - config: {get_resource: one_config}
      - config: {get_resource: two_config}

  one_config:
    type: OS::Heat::SoftwareConfig
    properties:
      config: |
        #!/bin/bash
        echo "one" > /tmp/one

  two_config:
    type: OS::Heat::SoftwareConfig
    properties:
      config: |
        #!/bin/bash
        echo "two" > /tmp/two

outputs:
  OS::stack_id:
    value: {get_resource: userdata}
EOF

cd
cat > firstboot/userdata_env.yaml << EOF
resource_registry:
    OS::TripleO::NodeUserData: one_two.yaml
EOF

#Deploy the overcloud as:

openstack overcloud deploy \
 --libvirt-type qemu \
 --ntp-server pool.ntp.org \
 --templates /home/stack/tripleo-heat-templates \
 -e /home/stack/firstboot/userdata_env.yaml

### Also with your example:

cd
cat > firstboot/first_boot_update_hook.yaml << EOF
heat_template_version: 2014-10-16

resources:
  userdata:
    type: OS::Heat::MultipartMime
    properties:
      parts:
      - config: {get_resource: update}

  update:
    type: OS::Heat::SoftwareConfig
    properties:
      config: |
        #!/bin/bash
        yum update -y

outputs:
  OS::stack_id:
    value: {get_resource: userdata}
EOF

cd
cat > firstboot/first_boot_env.yaml << EOF
resource_registry:
    OS::TripleO::NodeUserData: first_boot_update_hook.yaml
EOF

#Deploy the overcloud as:

openstack overcloud deploy \
 --libvirt-type qemu \
 --ntp-server pool.ntp.org \
 --templates /home/stack/tripleo-heat-templates \
 -e /home/stack/firstboot/first_boot_env.yaml

#Both examples working and running in latest master.

Some logs..

[stack@instack ~]$ heat stack-list
WARNING (shell) "heat stack-list" is deprecated, please use "openstack stack list" instead
+----+------------+--------------+---------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+----+------------+--------------+---------------+--------------+
+----+------------+--------------+---------------+--------------+
[stack@instack ~]$ openstack overcloud deploy \
> --libvirt-type qemu \
> --ntp-server pool.ntp.org \
> --templates /home/stack/tripleo-heat-templates \
> -e /home/stack/firstboot/first_boot_env.yaml
Removing the current plan files
Uploading new plan files
Started Mistral Workflow tripleo.plan_management.v1.update_deployment_plan. Execution ID: 1a3863f4-38c2-40b1-ada5-cf7292ca2a76
Plan updated
Deploying templates in the directory /tmp/tripleoclient-QYqpWY/tripleo-heat-templates
Started Mistral Workflow tripleo.deployment.v1.deploy_plan. Execution ID: b62e6757-a79f-4ef1-8b86-c2ae7d030cc6
2016-11-24 11:03:28Z [overcloud]: CREATE_IN_PROGRESS Stack CREATE started
2016-11-24 11:03:28Z [overcloud.MysqlRootPassword]: CREATE_IN_PROGRESS state changed
2016-11-24 11:03:28Z [overcloud.PcsdPassword]: CREATE_IN_PROGRESS state changed
2016-11-24 11:03:28Z [overcloud.RabbitCookie]: CREATE_IN_PROGRESS s...

Read more...

Changed in tripleo:
importance: Undecided → Critical
Changed in tripleo:
importance: Critical → Low
Amit Ugol (amit-ugol) wrote :

I used a file.yml not file.yaml.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers