[Openstack] about cloud-init question
Huang, Haibin
haibin.huang at intel.com
Mon Apr 23 06:52:51 UTC 2018
Hi Fabian,
I have export cloud-init.log as attachment.
I can’t find the reason. Can you help me to see it.
Thank you!
From: Fabian Zimmermann [mailto:dev.faz at gmail.com]
Sent: Monday, April 23, 2018 12:14 PM
To: Huang, Haibin <haibin.huang at intel.com>; openstack at lists.openstack.org
Subject: Re: [Openstack] about cloud-init question
Hi,
I dont think its possible to switch the interpreter during the run.
I would suggest to take a look into your cloud-init.log maybe its telling you why it is not doing what you want.
Fabian Zimmermann
Am 23. April 2018 03:08:15 MESZ schrieb "Huang, Haibin" <haibin.huang at intel.com<mailto:haibin.huang at intel.com>>:
Hi All,
I have a problem about cloud-init.
I want to both transfer files and execute script. So I give below script to user-data when I create instance.
#cloud-config
write_files:
- encoding: b64
content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBwAAAA==
owner: root:root
path: /root/hhb.gz
permissions: '0644'
#!/bin/bash
mkdir -p /home/ubuntu/config
but, I can’t get /root/hhb.gz and /home/Ubuntu/config.
If I separate transfer files and execute script. It is ok.
Any idea?
Below is my debug info
ubuntu at onap-hhb7:~$ sudo cloud-init --version
sudo: unable to resolve host onap-hhb7
cloud-init 0.7.5
security-groupsubuntu at onap-hhb7:~$ curl http://169.254.169.254/2009-04-04/user-data
#cloud-config
write_files:
- encoding: b64
content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBwAAAA==
owner: root:root
path: /root/hhb.gz
permissions: '0644'
#!/bin/bash
mkdir -p /home/ubuntu/config
ubuntu at onap-hhb7:~$ sudo ls /root/ -a
. .. .bashrc .profile .ssh
ubuntu at onap-hhb7:/var/lib/cloud/instance$ ls
boot-finished datasource obj.pkl sem user-data.txt.i vendor-data.txt.i
cloud-config.txt handlers scripts user-data.txt vendor-data.txt
ubuntu at onap-hhb7:/var/lib/cloud/instance$ sudo cat user-data.txt
sudo: unable to resolve host onap-hhb7
#cloud-config
write_files:
- encoding: b64
content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBwAAAA==
owner: root:root
path: /root/hhb.gz
permissions: '0644'
#!/bin/bash
mkdir -p /home/ubuntu/config
-------------------------------------------------------------------------------------------------------------------------------
Huang.haibin
11628530
86+18106533356
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20180423/6a4562a8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cloud-init.log
Type: application/octet-stream
Size: 143123 bytes
Desc: cloud-init.log
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20180423/6a4562a8/attachment.obj>
More information about the Openstack
mailing list