<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 17/05/14 00:49, Alex Yang wrote:<br>
    </div>
    <blockquote
cite="mid:CADZ3O5wTbvz2isghKLKwehs7b_J=hSJJ-Dj3tqs=hGoe2yLQPA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi all and Baker,
        <div><br>
        </div>
        <div>I had try to use Heat::SoftwareDeployment and
          Heat::SoftwareConfig but there may be someting wrong with my
          configuration that the hook-puppet didn't be invoked.</div>
        <div><br>
        </div>
        <div>Firstly, I follow this <a moz-do-not-send="true"
href="https://github.com/openstack/heat-templates/tree/master/hot/software-config/elements">instruction</a>
          to build a golden image.</div>
        <div><br>
        </div>
        <div>
          <div><span style="background-color:rgb(153,153,153)"><i>   
                apt-get install qemu-utils</i></span></div>
          <div><span style="background-color:rgb(153,153,153)"><i>    </i></span></div>
          <div><i style="background-color:rgb(153,153,153)">    git
              clone <a moz-do-not-send="true"
                href="https://github.com/openstack/diskimage-builder.git">https://github.com/openstack/diskimage-builder.git</a></i></div>
          <div><i style="background-color:rgb(153,153,153)">    git
              clone <a moz-do-not-send="true"
                href="https://github.com/openstack/tripleo-image-elements.git">https://github.com/openstack/tripleo-image-elements.git</a></i></div>
          <div><i style="background-color:rgb(153,153,153)">    git
              clone <a moz-do-not-send="true"
                href="https://github.com/openstack/heat-templates.git">https://github.com/openstack/heat-templates.git</a></i></div>
          <div><i style="background-color:rgb(153,153,153)">    </i></div>
          <div><i style="background-color:rgb(153,153,153)">   
              root@cloud-t1:~/alex_scripts/heat# cat set_env_path.sh </i></div>
          <div><i style="background-color:rgb(153,153,153)">   
              #!/bin/bash</i></div>
          <div><i style="background-color:rgb(153,153,153)">    </i></div>
          <div><i style="background-color:rgb(153,153,153)">    export
ELEMENTS_PATH=/root/alex_scripts/heat/tripleo-image-elements/elements:/root/alex_scripts/heat/heat-templates/hot/software-config/elements</i></div>
          <div><i style="background-color:rgb(153,153,153)">    export
              DIB_CLOUD_IMAGES=<a moz-do-not-send="true"
                href="https://cloud-images.ubuntu.com/">https://cloud-images.ubuntu.com/</a></i></div>
          <div><i style="background-color:rgb(153,153,153)">    export
              DIB_RELEASE=trusty</i></div>
          <div><i style="background-color:rgb(153,153,153)">    export
              BASE_IMAGE_FILE=trusty-server-cloudimg-amd64-root.tar.gz</i></div>
          <div><i style="background-color:rgb(153,153,153)">    export
              SHA256SUMS=<a moz-do-not-send="true"
                href="https://cloud-images.ubuntu.com/trusty/current/SHA256SUMS">https://cloud-images.ubuntu.com/trusty/current/SHA256SUMS</a></i></div>
          <div><i style="background-color:rgb(153,153,153)">    export
CACHED_FILE=/root/.cache/image-create/trusty-server-cloudimg-amd64-root.tar.gz</i></div>
          <div><i style="background-color:rgb(153,153,153)">    </i></div>
          <div><i style="background-color:rgb(153,153,153)">   
              ./diskimage-builder/bin/disk-image-create -a amd64 -o
              ubuntu-amd64-heat.qcow2 vm ubuntu heat-cfntools
              heat-config heat-config-cfn-init heat-config-puppet
              heat-config-script os-collect-config os-refresh-config
              os-apply-config</i></div>
        </div>
        <div><br>
        </div>
      </div>
    </blockquote>
    I've not tested an ubuntu image recently, if you wanted to eliminate
    this as an option then you could try the fedora instructions
    verbatim, however see below.<br>
    <blockquote
cite="mid:CADZ3O5wTbvz2isghKLKwehs7b_J=hSJJ-Dj3tqs=hGoe2yLQPA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Secondly, I use this <a moz-do-not-send="true"
href="https://github.com/openstack/heat-templates/blob/master/hot/software-config/example-templates/example-puppet-template.yaml">example</a> to
          try it out. Everything is OK but the resource of
          SoftwareDeployment. The state of SoftwareDeployment is always
          IN_PROGRESS. I login to the vm, I check something as follows:</div>
        <div><br>
        </div>
        <div>1. Checking the /var/lib/heat-config, hook-puppet is
          installed.</div>
        <div><br>
        </div>
        <div>
          <div><i style="background-color:rgb(153,153,153)">root@puppet-demo:/var/lib/heat-config#
              tree</i></div>
          <div><i style="background-color:rgb(153,153,153)">.</i></div>
          <div><i style="background-color:rgb(153,153,153)">└── hooks</i></div>
          <div><i style="background-color:rgb(153,153,153)">    ├──
              cfn-init</i></div>
          <div><i style="background-color:rgb(153,153,153)">    ├──
              puppet</i></div>
          <div>
            <i style="background-color:rgb(153,153,153)">    └── script</i></div>
        </div>
        <div> </div>
        <div>2. Checking the WORKING_DIR(<span
            style="color:rgb(221,17,68);font-family:Consolas,'Liberation
Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre">/var/lib/heat-config/heat-config-puppet</span>)
          of hook-puppet. The WORKING_DIR is not created yet. No any .pp
          files in the directory.</div>
        <div><br>
        </div>
        <div>3. Checking the status of os-collect-config, it is running.
          But there are some warrning in the
          /var/log/upstart/os-collect-config.log.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><span style="background-color:rgb(153,153,153)"><i>2014-05-16
              06:19:31.158 1140 WARNING os_collect_config.cfn [-] No
              metadata_url configured.</i></span></div>
        <div><span style="background-color:rgb(153,153,153)"><i>2014-05-16
              06:19:31.158 1140 WARNING os-collect-config [-] Source
              [cfn] Unavailable.</i></span></div>
        <div><span style="background-color:rgb(153,153,153)"><i>2014-05-16
              06:19:31.158 1140 WARNING os_collect_config.heat [-] No
              auth_url configured.</i></span></div>
        <div><span style="background-color:rgb(153,153,153)"><i>2014-05-16
              06:19:31.159 1140 WARNING os-collect-config [-] Source
              [heat] Unavailable.</i></span></div>
        <div><br>
        </div>
        <div>4. Checking /var/lib/os-collect-config</div>
        <div><br>
        </div>
        <div>
          <div><i style="background-color:rgb(153,153,153)">root@puppet-demo:/var/lib/os-collect-config#
              ls</i></div>
          <div><i style="background-color:rgb(153,153,153)">ec2.json
               ec2.json.last  ec2.json.orig  heat_local.json
               heat_local.json.last  heat_local.json.orig
               os_config_files.json</i></div>
        </div>
        <div><i style="background-color:rgb(153,153,153)"><br>
          </i></div>
        <div>
          <div><i style="background-color:rgb(153,153,153)">root@puppet-demo:/var/lib/os-collect-config#
              cat heat_local.json</i></div>
          <div><i style="background-color:rgb(153,153,153)">{</i></div>
          <div><i style="background-color:rgb(153,153,153)"> "os-collect-config":
              {</i></div>
          <div><i style="background-color:rgb(153,153,153)">  "heat": {</i></div>
          <div><i style="background-color:rgb(153,153,153)"> 
               "password": "88cdca28611a47b6af3f92cf350d7e93", </i></div>
          <div><i style="background-color:rgb(153,153,153)"> 
               "user_id": "8a8e83631f4544b88435833512f4fe04", </i></div>
          <div><i style="background-color:rgb(153,153,153)"> 
               "stack_id":
              "puppet-demo/52b04dbb-0bc5-4c89-b4bd-543975a32e06", </i></div>
          <div><i style="background-color:rgb(153,153,153)"> 
               "resource_name": "server1", </i></div>
          <div><i style="background-color:rgb(153,153,153)"> 
               "auth_url": "<a moz-do-not-send="true"
                href="http://10.22.129.21:5000/v2.0">http://10.22.129.21:5000/v2.0</a>", </i></div>
          <div><i style="background-color:rgb(153,153,153)"> 
               "project_id": "156739be982340b9b6630bae76984634"</i></div>
          <div><i style="background-color:rgb(153,153,153)">  }</i></div>
          <div><i style="background-color:rgb(153,153,153)"> }, </i></div>
          <div><i style="background-color:rgb(153,153,153)"> "deployments":
              []</i></div>
          <div><i style="background-color:rgb(153,153,153)">}</i></div>
        </div>
        <div><br>
        </div>
        <div>5. Checking the connection between vm and heat-api-cfn
          server. It's OK.</div>
        <div><br>
        </div>
        <div>After checking above things, I still can't to handle thie
          problem. There are something I need to understand:</div>
        <div><br>
        </div>
        <div>1. Where to store the puppet file and inputs, after the
          heat-engine precessing the template?</div>
        <div>2. Which meatadata server(heat_local, ec2 or heat-api-cfn)
          the os-collect-config will fetching to get the
          SoftwareDeployment meatadata?</div>
        <div>3. Is there any chapter to introduce the whole process of
          SoftwareDeployment in detial?</div>
        <br>
      </div>
    </blockquote>
    You're possibly being hit by this bug:<br>
    <a class="moz-txt-link-freetext" href="https://launchpad.net/bugs/1299109">https://launchpad.net/bugs/1299109</a><br>
    <br>
    Which is fixed by:<br>
    <a class="moz-txt-link-freetext" href="https://review.openstack.org/#/c/91733/4">https://review.openstack.org/#/c/91733/4</a><br>
    <br>
    When an os-collect-config is released with this fix I'll let you
    know and you can build a new image and try again.<br>
    <br>
    Over time we'll have docs on how to diagnose these issues, but some
    hints for this particular part of the toolchain would be to run the
    following commands until a response yields an error which gives an
    indication of where your issue might be:<br>
      os-collect-config --one-time<br>
      os-refresh-config<br>
      os-apply-config<br>
    <br>
    Clint might be able to provide some further advice for debugging
    os-*-config toolchain issues<br>
    <br>
    cheers<br>
  </body>
</html>