UserData in AutoscalingGroup isn't executed

asked 2014-09-24 07:25:26 -0500

PatRock gravatar image

updated 2014-09-24 08:09:08 -0500

I create two instances. A Database and a WebSever, the WebServer in a AutoScalingGroup. The Database user_data gets correctly executed, but the WebServer doesn't.

        type: OS::Nova::Server
          image: { get_param: Image }
          flavor: { get_param: Flavor }
          key_name: { get_param: Key }
          networks: [{network: { get_param: NetworkID}}]
              template: |
                #!/bin/bash -v

        type: OS::Heat::AutoScalingGroup
          max_size: 5
          desired_capacity: 1
          min_size: 1
            type: PoolServer.yaml
              flavor: {get_param: WebServer_Flavor}
              image: {get_param: Image}
              key_name: {get_param: Key}
              network: {get_param: NetworkID_Intern}
              pool_id: {get_resource: Pool}
              metadata: {"metering.stack": {get_param: "OS::stack_id"}}
                  template: |
                    #!/bin/bash -v

The PoolServer.yaml looks like

  type: OS::Nova::Server
    flavor: {get_param: flavor}
    image: {get_param: image}
    key_name: {get_param: key_name}
    networks: [{network: {get_param: network}}]
    metadata: {get_param: metadata}
    user_data: {get_param: user_data}
    user_data_format: RAW

I get the error in the console[WARNING]: applying credentials failed! I also tryiedto specify the user_data in the nested template, but the result is the same. My Fedora image is not formated in RAW could this be the problem?

edit retag flag offensive close merge delete


If you add the data directly in PoolServer.yaml, rather than passing it in as a parameter, does the behavior change?

larsks gravatar imagelarsks ( 2014-09-24 14:39:16 -0500 )edit

If you log into your instance, what do you see in /var/lib/cloud/instance/user-data.txt? You should be able to log in using single-user mode if you do not otherwise have credentials.

larsks gravatar imagelarsks ( 2014-09-24 14:39:23 -0500 )edit

I can't even connect to the instance via ssh. whats wrong here? everything went wrong in the last 48h...

Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
PatRock gravatar imagePatRock ( 2014-09-25 05:05:55 -0500 )edit

You probably need to log in using single-user mode on the console. If cloud-init is failing, it may not be able to provision the ssh keys (which would explain why you are unable to log in).

larsks gravatar imagelarsks ( 2014-09-25 08:18:28 -0500 )edit

Alternatively, you can boot an instance using the 'cirros' image, which permits password login, and use that to form some diagnostics (e.g., to verify that nova instances can reach the metadata service correctly)

larsks gravatar imagelarsks ( 2014-09-25 08:19:08 -0500 )edit