<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Salman:</div><div><br></div><div>Responses are inline.</div><div apple-content-edited="true"><br class="Apple-interchange-newline">
</div>
<br><div><div>On Nov 21, 2012, at 1:53 PM, Salman Toor <<a href="mailto:salman.toor@it.uu.se">salman.toor@it.uu.se</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi, <div><br></div><div>Thanks for all your responses, I have started with --user_data with nova command but seems like something is missing </div><div><br></div><div>Red color is for important stuff.</div><div><br></div><div><div>[sztoor@sal2 ~]$ nova boot --flavor 2 --image c402227d-dddf-45a6-9391-ef5d2733e4de <font class="Apple-style-span" color="#ff3823">--user_data user_data.sh</font> --key_name mykey --security_group default basic-userData</div><div>+-------------------------------------+--------------------------------------+</div><div>|               Property              |                Value                 |</div><div>+-------------------------------------+--------------------------------------+</div><div>| OS-DCF:diskConfig                   | MANUAL                               |</div><div>| OS-EXT-SRV-ATTR:host                | None                                 |</div><div>| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                 |</div><div>| OS-EXT-SRV-ATTR:instance_name       | instance-0000003b                    |</div><div>| OS-EXT-STS:power_state              | 0                                    |</div><div>| OS-EXT-STS:task_state               | scheduling                           |</div><div>| OS-EXT-STS:vm_state                 | building                             |</div><div>| accessIPv4                          |                                      |</div><div>| accessIPv6                          |                                      |</div><div>| adminPass                           | PjxzNM46U7wk                         |</div><div>| config_drive                        |                                      |</div><div>| created                             | 2012-11-21T17:42:17Z                 |</div><div>| flavor                              | m1.small                             |</div><div>| hostId                              |                                      |</div><div>| id                                  | f055cddc-85ad-4520-a458-2f08ee6a0ccb |</div><div>| image                               | Basic-x86_64_qcow2              |</div><div>| key_name                            | mykey                                |</div><div><font class="Apple-style-span" color="#ff3823">| metadata                            | {}                                   |</font></div><div>| name                                | basic-userData                  |</div><div>| progress                            | 0                                    |</div><div>| status                              | BUILD                                |</div><div>| tenant_id                           | fc310cff7c6d4684954151196f944dc8     |</div><div>| updated                             | 2012-11-21T17:42:18Z                 |</div><div>| user_id                             | 11c08cf04c844185b83ce9d8ff8588f5     |</div><div>+-------------------------------------+--------------------------------------+</div></div><div><br></div></div></blockquote><div><br></div><div><div>The "metadata" property you see when you call "nova boot" is different from the data sent using the --user_data flag.</div><div><br></div><div>In particular, the "metadata" property shows key-value pairs that you send when using the --meta option of "nova boot", e.g.:</div><div><br></div><div>nova boot --meta key=value</div><div><br></div><br></div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>user_data.sh is a file which contains </div><div><br></div><div>--------------</div><div><br></div><div><div>EC2_USER_DATA=" base64 string "</div><div># Context variables </div><div>ONE_CONTEXT_PATH="PATH/TO/CONTEXT"</div></div><div><br></div><div>--------------</div><div><br></div><div>When the image boot seems it didn't use the user_data.sh</div><div><br></div><div><br></div><div>I am also wandering if I am using the command-line option to send user data using --user_data, do I need this metadata service? I mean for user data .... I can understand that the service can be used for getting SSH key or other stuff but does it required for user data? </div><div><br></div></div></blockquote><div><br></div><div>Yes, you need the metadata service for retrieving the user data. </div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>But when I try to access it with wget it said internal error. </div><div><br></div><div><div><font class="Apple-style-span" color="#ff3823">[sztoor@sal2 ~]$ wget <a href="http://130.248.17.161:8775/latest/user-data">http://130.248.17.161:8775/latest/user-data</a></font></div><div><font class="Apple-style-span" color="#ff3823">--2012-11-21 19:44:33--  <a href="http://130.248.17.161:8775/latest/user-data">http://130.248.17.161:8775/latest/user-data</a></font></div><div><font class="Apple-style-span" color="#ff3823">Connecting to 130.248.17.161:8775... connected.</font></div><div><font class="Apple-style-span" color="#ff3823">HTTP request sent, awaiting response... 500 Internal Server Error</font></div><div><font class="Apple-style-span" color="#ff3823">2012-11-21 19:44:33 ERROR 500: Internal Server Error.</font></div><div><br></div></div></div></blockquote><div><br></div><div><br></div><div>I am currently in the process of updating the metadata documentation which describe how to do this: <a href="https://review.openstack.org/16728">https://review.openstack.org/16728</a></div><div><br></div><div>I think you're using the wrong IP address, the metadata service is accessible at 169.254.169.254. Doing a wget on any of these URLs from inside of your instance should get you the user data:</div><div><br></div><div><a href="http://169.254.169.254/2009-04-04/user-data">http://169.254.169.254/2009-04-04/user-data</a></div><div><a href="http://169.254.169.254/latest/user-data">http://169.254.169.254/latest/user-data</a></div><div><div><a href="http://169.254.169.254/openstack/2012-08-10/user_data">http://169.254.169.254/openstack/2012-08-10/user_data</a></div><div><a href="http://169.254.169.254/openstack/latest/user_data">http://169.254.169.254/openstack/latest/user_data</a></div><div><br></div></div><div><br></div><div><div><br></div></div></div><div><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Take care,</div><div><br></div><div>Lorin</div><div>--</div><div>Lorin Hochstein</div><div>Lead Architect - Cloud Services</div><div>Nimbis Services, Inc.</div><div><a href="https://www.nimbisservices.com/">www.nimbisservices.com</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"></div></div></body></html>