<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Intel Clear";
panose-1:2 11 6 4 2 2 3 2 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Intel Clear",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif">Hi All,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif">I have a problem about cloud-init.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif">I want to both transfer files and execute script. So I give below script to user-data when I create instance.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Intel Clear",sans-serif">#cloud-config<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Intel Clear",sans-serif">write_files:<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Intel Clear",sans-serif">- encoding: b64<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Intel Clear",sans-serif"> content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBwAAAA==<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Intel Clear",sans-serif"> owner: root:root<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Intel Clear",sans-serif"> path: /root/hhb.gz<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Intel Clear",sans-serif"> permissions: '0644'
<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Intel Clear",sans-serif"><o:p> </o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Intel Clear",sans-serif">#!/bin/bash
<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Intel Clear",sans-serif">mkdir -p /home/ubuntu/config<o:p></o:p></span></i></p>
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif">but, I can’t get /root/hhb.gz and /home/Ubuntu/config.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif">If I separate transfer files and execute script. It is ok.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif">Any idea?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif"><o:p> </o:p></span></p>
<div style="mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0in 0in 1.0pt 0in">
<p class="MsoNormal" style="border:none;padding:0in"><span style="font-family:"Intel Clear",sans-serif">Below is my debug info<o:p></o:p></span></p>
</div>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">ubuntu@onap-hhb7:~$ sudo cloud-init --version<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">sudo: unable to resolve host onap-hhb7<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">cloud-init 0.7.5<o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">security-groupsubuntu@onap-hhb7:~$ curl
<a href="http://169.254.169.254/2009-04-04/user-data">http://169.254.169.254/2009-04-04/user-data</a><o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">#cloud-config<o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">write_files:<o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">- encoding: b64<o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"> content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBwAAAA==<o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"> owner: root:root<o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"> path: /root/hhb.gz<o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"> permissions: '0644'<o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"> <o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">#!/bin/bash<o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><b><i><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">mkdir -p /home/ubuntu/config<o:p></o:p></span></i></b></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">ubuntu@onap-hhb7:~$ sudo ls /root/ -a<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">. .. .bashrc .profile .ssh<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">ubuntu@onap-hhb7:/var/lib/cloud/instance$ ls<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">boot-finished datasource obj.pkl sem user-data.txt.i vendor-data.txt.i<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">cloud-config.txt handlers scripts user-data.txt vendor-data.txt<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">ubuntu@onap-hhb7:/var/lib/cloud/instance$ sudo cat user-data.txt<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">sudo: unable to resolve host onap-hhb7<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">#cloud-config<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">write_files:<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">- encoding: b64<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"> content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBwAAAA==<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"> owner: root:root<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"> path: /root/hhb.gz<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"> permissions: '0644'<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black"> <o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">#!/bin/bash<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:11.0pt;font-family:"Intel Clear",sans-serif;color:black">mkdir -p /home/ubuntu/config<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Intel Clear",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal">-------------------------------------------------------------------------------------------------------------------------------<o:p></o:p></p>
<p class="MsoNormal">Huang.haibin<o:p></o:p></p>
<p class="MsoNormal">11628530<o:p></o:p></p>
<p class="MsoNormal">86+18106533356<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>