Re: [Openstack] help

2018-04-23 Thread Melvin Hillsman
Douaa can you provide details on the error you are getting? Also I am
adding the Operators ML as some more practitioners may be able to see it
from there.

On Mon, Apr 23, 2018 at 11:55 AM, Douaa  wrote:

> Hello
> I'm trying to use openstack (VIM) on openbaton for that i create to VMs
> one for OpenStack and the second for Opnebaton.
> i have installed packstack on CentOS and Openbaton on ubuntu 16.04. Now
> i'm trying to create VIM Openstack on openbaton but i have erreur there is
> any plugins or configuration i have to do it before creating VIM Openstack ?
>  Thanks for helping
>
>
>
> ___
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/
> openstack
> Post to : openstack@lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/
> openstack
>
>


-- 
Kind regards,

Melvin Hillsman
mrhills...@gmail.com
mobile: (832) 264-2646
___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


[Openstack] help

2018-04-23 Thread Douaa
 Hello
I'm trying to use openstack (VIM) on openbaton for that i create to VMs one
for OpenStack and the second for Opnebaton.
i have installed packstack on CentOS and Openbaton on ubuntu 16.04. Now i'm
trying to create VIM Openstack on openbaton but i have erreur there is any
plugins or configuration i have to do it before creating VIM Openstack ?
 Thanks for helping
___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


Re: [Openstack] which SDK to use?

2018-04-23 Thread Volodymyr Litovka

Hi Adrian,


Then we have the odd thing where most of the client list commands return
lists of objects, while some (I'm looking at you glance), returns a
generator.
After short period of use, I completely agree with this and other your 
statements re client libraries. Thanks for pointing on ways to do 
actions on stack using SDK client. I'll think again about Unified SDK - 
if it's more unified than clients, some annoyings are acceptable :)


--
Volodymyr Litovka
  "Vision without Execution is Hallucination." -- Thomas Edison


___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


Re: [Openstack] which SDK to use?

2018-04-23 Thread Adrian Turjak
I don't disagree that the SDK lacks feature parity, which is oddly
enough one of the main reasons I'm actually using it, to find those
missing features, document them, maybe fix them, or if I can't fix them
annoy the right people who can. With the SDK there is at least always a
way to get around the lack of feature parity now by using the direct
calls to the proxy object. I don't think that's a good solution, but
it's a way to start using it and then start contributing back the actual
implementations of those features.

I've been bitten and annoyed too many times by how different and
inconsistent the various other clients are, and while some of them have
some great code and features, the fact that they work very differently
to the others just drives me mad.

Or even in the case of the neutronclient, there is
'neutronclient.client' and 'neutronclient.neutron.client'. The former is
the more supported and documented one it seems (although the code
terrifies me... it's a 2500 line single file), while the latter appears
to be an unfinished client that was meant to be more in line with the
other service clients but I think is lacking features and docs. I've
never dug enough into that to find out what's going on there.

Then we have the odd thing where most of the client list commands return
lists of objects, while some (I'm looking at you glance), returns a
generator. While I prefer returning lists, the SDK is at least always
consistent in that it returns generators for ALL list commands, and
ultimately you can always wrap those calls in a list() and it's the same
result.

And don't get me started on the swiftclient. :P

The SDK isn't perfect, but it can and will get better, and it's better
than the alternative, which is mostly a weird kind of inconsistent
madness. We can't make all those clients work the same, that would break
backwards compatibility and it would take too much effort. We can though
have a unified consistent SDK that will hopefully in future be the point
of first implementation for features rather than their own clients.
First, we need to get people using the SDK and seeing the benefit of it,
and that takes time, and people helping implement those missing features.

On 22/04/18 01:37, Volodymyr Litovka wrote:
> Hi Adrian,
>
> at the moment, "wildly different" python clients provide more, than
> Unified SDK. Not sure about all clients, but what I found and what
> finally turned me to client libraries is inability to to do actions on
> stack (e.g. suspend/resume) using Unified SDK (neither doc not source
> code contain any mentions on this, while python-heatclient describes
> this and can it to do). It's far from bleeding edge - it's huge gap in
> feature consistency.

There seems to be a fairly old patch that started adding this but was
rejected due to missing tests:
https://review.openstack.org/#/c/190551/
I can't find anything more recent, but I didn't look too hard.

While not ideal you can call _action directly yourself on a stack
object, but it isn't particularly elegant:
https://github.com/openstack/openstacksdk/blob/master/openstack/orchestration/v1/stack.py#L90

stack = conn.orchestration.get_stack(stack_id)
resp = stack._action(conn.orchestration, {'suspend': ''})

I know that doesn't really help that much, but it's the best I can
recommend right now. :(
>
> On 4/20/18 6:19 AM, Adrian Turjak wrote:
>> As someone who used to use all the standalone clients, I'm leaning very
>> heavily these days to using only the SDK and think we should encourage
>> most projects to treat the SDK as their first point of implementation
>> rather than all the wildly different python clients.
>>
>> So if you are new to OpenStack, the the SDK is the best and most
>> consistent option right now for interacting with OpenStack from python.
>> Sadly though the docs are lacking, but the docs for the other libraries
>> aren't that much better anyway half the time.
>>
>>
>> On 20/04/18 01:46, Chris Friesen wrote:
>>> On 04/19/2018 07:01 AM, Jeremy Stanley wrote:
 On 2018-04-19 12:24:48 +1000 (+1000), Joshua Hesketh wrote:
> There is also nothing stopping you from using both. For example,
> you could use the OpenStack SDK for most things but if you hit an
> edge case where you need something specific you can then import
> the particular client lib.
 [...]

 Or, for that matter, leverage OpenStackSDK's ability to pass
 arbitrary calls to individual service APIs when you need something
 not exposed by the porcelain layer.
>>> Is that documented somewhere?  I spent some time looking at
>>> https://docs.openstack.org/openstacksdk/latest/ and didn't see
>>> anything that looked like that.
>>>
>> Not that I believe, but basically it amounts to that on any service
>> proxy object you can call .get .post etc. So if the SDK doesn't yet
>> support a given feature, you can still use the feature yourself, but you
>> need to do some raw requests work, which honestly isn't that bad.
>>
>> ser

Re: [Openstack] about cloud-init question

2018-04-23 Thread Eugen Block

I'm glad I could help!


Zitat von "Huang, Haibin" :


Hi
I use below config can create both /root/hhb.gz and /home/Ubuntu/config.
Thank you very much!

#cloud-config
write_files:
-   encoding: b64
content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
owner: root:root
path: /root/hhb.gz
permissions: '0644'

runcmd:
-   mkdir -p /home/ubuntu/config
mkdir -p /home/ubuntu/config/hhb


-Original Message-
From: Eugen Block [mailto:ebl...@nde.ag]
Sent: Monday, April 23, 2018 2:58 PM
To: openstack@lists.openstack.org
Subject: Re: [Openstack] about cloud-init question

Hi,

we use this piece of script to pass salt data to instances and execute the
respective commands to start the salt-minion:

---cut here---
#cloud-config
write_files:
   # Minion Konfiguration
   - content: |
   master: 
   id: 
[...]
 owner: root:root
 path: /etc/salt/minion.d/init.conf
 permissions: '0644'

   # Minion Private-Key
   - content: |
   -BEGIN RSA PRIVATE KEY-
[...]
   -END RSA PRIVATE KEY-
   owner: root:root
   path: /etc/salt/pki/minion/minion.pem
   permissions: '0400'

[...]

# Enabled und Startet den Minion
runcmd:
   - rm -f /etc/machine-id
   - systemd-machine-id-setup
   - [ systemctl, enable, salt-minion.service ]
   - [ systemctl, start, --no-block, salt-minion.service ]
   - [ systemctl, daemon-reload ]
---cut here---

This both writes the desired files and also executes required  
commands. We use
this on openSUSE machines, I'm not sure if this differs in your  
environment, but

worth a shot, I guess.

Regards,
Eugen


Zitat von "Huang, Haibin" :

> 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: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
> 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@onap-hhb7:~$ sudo cloud-init --version
>
> sudo: unable to resolve host onap-hhb7
>
> cloud-init 0.7.5
>
>
>
> security-groupsubuntu@onap-hhb7:~$ curl
> http://169.254.169.254/2009-04-04/user-data
>
> #cloud-config
>
> write_files:
>
> -   encoding: b64
>
> content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
>
> owner: root:root
>
> path: /root/hhb.gz
>
> permissions: '0644'
>
>
>
> #!/bin/bash
>
> mkdir -p /home/ubuntu/config
>
>
>
> ubuntu@onap-hhb7:~$ sudo ls /root/ -a
>
> .  ..  .bashrc  .profile  .ssh
>
>
>
> ubuntu@onap-hhb7:/var/lib/cloud/instance$ ls
>
> boot-finished datasource  obj.pkl  sem
> user-data.txt.i  vendor-data.txt.i
>
> cloud-config.txt  handlersscripts  user-data.txt  vendor-data.txt
>
> ubuntu@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: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
>
> owner: root:root
>
> path: /root/hhb.gz
>
> permissions: '0644'
>
>
>
> #!/bin/bash
>
> mkdir -p /home/ubuntu/config
>
>
>
> --
> -
> Huang.haibin
> 11628530
> 86+18106533356




___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack





___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


[Openstack] volume state (in-use/available) vs real work

2018-04-23 Thread Volodymyr Litovka

Hi colleagues,

in order to change (increase) boot disk's size "on the fly", I can do 
the following sequense of commands without stopping VM:


: openstack volume set --state available 
: openstack volume set --state in-use --size 32 

and, if properly configured, disk will be automatically resized by 
cloud-init during next reboot.


Is it dangerous to change volume state to "available" while VM is 
actively working? Which side-effects I can face while doing this?


Thank you.

--
Volodymyr Litovka
  "Vision without Execution is Hallucination." -- Thomas Edison


___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


Re: [Openstack] about cloud-init question

2018-04-23 Thread Huang, Haibin
Hi 
I use below config can create both /root/hhb.gz and /home/Ubuntu/config.
Thank you very much!

#cloud-config
write_files:
-   encoding: b64
content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
owner: root:root
path: /root/hhb.gz
permissions: '0644'  

runcmd:
-   mkdir -p /home/ubuntu/config
mkdir -p /home/ubuntu/config/hhb

> -Original Message-
> From: Eugen Block [mailto:ebl...@nde.ag]
> Sent: Monday, April 23, 2018 2:58 PM
> To: openstack@lists.openstack.org
> Subject: Re: [Openstack] about cloud-init question
> 
> Hi,
> 
> we use this piece of script to pass salt data to instances and execute the
> respective commands to start the salt-minion:
> 
> ---cut here---
> #cloud-config
> write_files:
># Minion Konfiguration
>- content: |
>master: 
>id: 
> [...]
>  owner: root:root
>  path: /etc/salt/minion.d/init.conf
>  permissions: '0644'
> 
># Minion Private-Key
>- content: |
>-BEGIN RSA PRIVATE KEY-
> [...]
>-END RSA PRIVATE KEY-
>owner: root:root
>path: /etc/salt/pki/minion/minion.pem
>permissions: '0400'
> 
> [...]
> 
> # Enabled und Startet den Minion
> runcmd:
>- rm -f /etc/machine-id
>- systemd-machine-id-setup
>- [ systemctl, enable, salt-minion.service ]
>- [ systemctl, start, --no-block, salt-minion.service ]
>- [ systemctl, daemon-reload ]
> ---cut here---
> 
> This both writes the desired files and also executes required commands. We use
> this on openSUSE machines, I'm not sure if this differs in your environment, 
> but
> worth a shot, I guess.
> 
> Regards,
> Eugen
> 
> 
> Zitat von "Huang, Haibin" :
> 
> > 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: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
> > 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@onap-hhb7:~$ sudo cloud-init --version
> >
> > sudo: unable to resolve host onap-hhb7
> >
> > cloud-init 0.7.5
> >
> >
> >
> > security-groupsubuntu@onap-hhb7:~$ curl
> > http://169.254.169.254/2009-04-04/user-data
> >
> > #cloud-config
> >
> > write_files:
> >
> > -   encoding: b64
> >
> > content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
> >
> > owner: root:root
> >
> > path: /root/hhb.gz
> >
> > permissions: '0644'
> >
> >
> >
> > #!/bin/bash
> >
> > mkdir -p /home/ubuntu/config
> >
> >
> >
> > ubuntu@onap-hhb7:~$ sudo ls /root/ -a
> >
> > .  ..  .bashrc  .profile  .ssh
> >
> >
> >
> > ubuntu@onap-hhb7:/var/lib/cloud/instance$ ls
> >
> > boot-finished datasource  obj.pkl  sem
> > user-data.txt.i  vendor-data.txt.i
> >
> > cloud-config.txt  handlersscripts  user-data.txt  vendor-data.txt
> >
> > ubuntu@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: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
> >
> > owner: root:root
> >
> > path: /root/hhb.gz
> >
> > permissions: '0644'
> >
> >
> >
> > #!/bin/bash
> >
> > mkdir -p /home/ubuntu/config
> >
> >
> >
> > --
> > -
> > Huang.haibin
> > 11628530
> > 86+18106533356
> 
> 
> 
> 
> ___
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to : openstack@lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


Re: [Openstack] about cloud-init question

2018-04-23 Thread Eugen Block

Currently, we use

host:~ #  cloud-init --version
cloud-init 0.7.8


Zitat von "Huang, Haibin" :

I suspect my cloud-init version is too lower. Can you share me your  
cloud-init version?

Thank you!


-Original Message-
From: Eugen Block [mailto:ebl...@nde.ag]
Sent: Monday, April 23, 2018 2:58 PM
To: openstack@lists.openstack.org
Subject: Re: [Openstack] about cloud-init question

Hi,

we use this piece of script to pass salt data to instances and execute the
respective commands to start the salt-minion:

---cut here---
#cloud-config
write_files:
   # Minion Konfiguration
   - content: |
   master: 
   id: 
[...]
 owner: root:root
 path: /etc/salt/minion.d/init.conf
 permissions: '0644'

   # Minion Private-Key
   - content: |
   -BEGIN RSA PRIVATE KEY-
[...]
   -END RSA PRIVATE KEY-
   owner: root:root
   path: /etc/salt/pki/minion/minion.pem
   permissions: '0400'

[...]

# Enabled und Startet den Minion
runcmd:
   - rm -f /etc/machine-id
   - systemd-machine-id-setup
   - [ systemctl, enable, salt-minion.service ]
   - [ systemctl, start, --no-block, salt-minion.service ]
   - [ systemctl, daemon-reload ]
---cut here---

This both writes the desired files and also executes required  
commands. We use
this on openSUSE machines, I'm not sure if this differs in your  
environment, but

worth a shot, I guess.

Regards,
Eugen


Zitat von "Huang, Haibin" :

> 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: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
> 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@onap-hhb7:~$ sudo cloud-init --version
>
> sudo: unable to resolve host onap-hhb7
>
> cloud-init 0.7.5
>
>
>
> security-groupsubuntu@onap-hhb7:~$ curl
> http://169.254.169.254/2009-04-04/user-data
>
> #cloud-config
>
> write_files:
>
> -   encoding: b64
>
> content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
>
> owner: root:root
>
> path: /root/hhb.gz
>
> permissions: '0644'
>
>
>
> #!/bin/bash
>
> mkdir -p /home/ubuntu/config
>
>
>
> ubuntu@onap-hhb7:~$ sudo ls /root/ -a
>
> .  ..  .bashrc  .profile  .ssh
>
>
>
> ubuntu@onap-hhb7:/var/lib/cloud/instance$ ls
>
> boot-finished datasource  obj.pkl  sem
> user-data.txt.i  vendor-data.txt.i
>
> cloud-config.txt  handlersscripts  user-data.txt  vendor-data.txt
>
> ubuntu@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: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
>
> owner: root:root
>
> path: /root/hhb.gz
>
> permissions: '0644'
>
>
>
> #!/bin/bash
>
> mkdir -p /home/ubuntu/config
>
>
>
> --
> -
> Huang.haibin
> 11628530
> 86+18106533356




___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack





___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


Re: [Openstack] about cloud-init question

2018-04-23 Thread Huang, Haibin
I suspect my cloud-init version is too lower. Can you share me your cloud-init 
version?
Thank you!

> -Original Message-
> From: Eugen Block [mailto:ebl...@nde.ag]
> Sent: Monday, April 23, 2018 2:58 PM
> To: openstack@lists.openstack.org
> Subject: Re: [Openstack] about cloud-init question
> 
> Hi,
> 
> we use this piece of script to pass salt data to instances and execute the
> respective commands to start the salt-minion:
> 
> ---cut here---
> #cloud-config
> write_files:
># Minion Konfiguration
>- content: |
>master: 
>id: 
> [...]
>  owner: root:root
>  path: /etc/salt/minion.d/init.conf
>  permissions: '0644'
> 
># Minion Private-Key
>- content: |
>-BEGIN RSA PRIVATE KEY-
> [...]
>-END RSA PRIVATE KEY-
>owner: root:root
>path: /etc/salt/pki/minion/minion.pem
>permissions: '0400'
> 
> [...]
> 
> # Enabled und Startet den Minion
> runcmd:
>- rm -f /etc/machine-id
>- systemd-machine-id-setup
>- [ systemctl, enable, salt-minion.service ]
>- [ systemctl, start, --no-block, salt-minion.service ]
>- [ systemctl, daemon-reload ]
> ---cut here---
> 
> This both writes the desired files and also executes required commands. We use
> this on openSUSE machines, I'm not sure if this differs in your environment, 
> but
> worth a shot, I guess.
> 
> Regards,
> Eugen
> 
> 
> Zitat von "Huang, Haibin" :
> 
> > 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: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
> > 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@onap-hhb7:~$ sudo cloud-init --version
> >
> > sudo: unable to resolve host onap-hhb7
> >
> > cloud-init 0.7.5
> >
> >
> >
> > security-groupsubuntu@onap-hhb7:~$ curl
> > http://169.254.169.254/2009-04-04/user-data
> >
> > #cloud-config
> >
> > write_files:
> >
> > -   encoding: b64
> >
> > content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
> >
> > owner: root:root
> >
> > path: /root/hhb.gz
> >
> > permissions: '0644'
> >
> >
> >
> > #!/bin/bash
> >
> > mkdir -p /home/ubuntu/config
> >
> >
> >
> > ubuntu@onap-hhb7:~$ sudo ls /root/ -a
> >
> > .  ..  .bashrc  .profile  .ssh
> >
> >
> >
> > ubuntu@onap-hhb7:/var/lib/cloud/instance$ ls
> >
> > boot-finished datasource  obj.pkl  sem
> > user-data.txt.i  vendor-data.txt.i
> >
> > cloud-config.txt  handlersscripts  user-data.txt  vendor-data.txt
> >
> > ubuntu@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: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
> >
> > owner: root:root
> >
> > path: /root/hhb.gz
> >
> > permissions: '0644'
> >
> >
> >
> > #!/bin/bash
> >
> > mkdir -p /home/ubuntu/config
> >
> >
> >
> > --
> > -
> > Huang.haibin
> > 11628530
> > 86+18106533356
> 
> 
> 
> 
> ___
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to : openstack@lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


Re: [Openstack] about cloud-init question

2018-04-23 Thread Eugen Block

Hi,

we use this piece of script to pass salt data to instances and execute  
the respective commands to start the salt-minion:


---cut here---
#cloud-config
write_files:
  # Minion Konfiguration
  - content: |
  master: 
  id: 
[...]
owner: root:root
path: /etc/salt/minion.d/init.conf
permissions: '0644'

  # Minion Private-Key
  - content: |
  -BEGIN RSA PRIVATE KEY-
[...]
  -END RSA PRIVATE KEY-
  owner: root:root
  path: /etc/salt/pki/minion/minion.pem
  permissions: '0400'

[...]

# Enabled und Startet den Minion
runcmd:
  - rm -f /etc/machine-id
  - systemd-machine-id-setup
  - [ systemctl, enable, salt-minion.service ]
  - [ systemctl, start, --no-block, salt-minion.service ]
  - [ systemctl, daemon-reload ]
---cut here---

This both writes the desired files and also executes required  
commands. We use this on openSUSE machines, I'm not sure if this  
differs in your environment, but worth a shot, I guess.


Regards,
Eugen


Zitat von "Huang, Haibin" :


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: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==
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@onap-hhb7:~$ sudo cloud-init --version

sudo: unable to resolve host onap-hhb7

cloud-init 0.7.5



security-groupsubuntu@onap-hhb7:~$ curl   
http://169.254.169.254/2009-04-04/user-data


#cloud-config

write_files:

-   encoding: b64

content: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==

owner: root:root

path: /root/hhb.gz

permissions: '0644'



#!/bin/bash

mkdir -p /home/ubuntu/config



ubuntu@onap-hhb7:~$ sudo ls /root/ -a

.  ..  .bashrc  .profile  .ssh



ubuntu@onap-hhb7:/var/lib/cloud/instance$ ls

boot-finished datasource  obj.pkl  sem 
user-data.txt.i  vendor-data.txt.i


cloud-config.txt  handlersscripts  user-data.txt  vendor-data.txt

ubuntu@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: H4sICMxh2VoAA2hoYgCzKE5JK07hAgDCo1pOBw==

owner: root:root

path: /root/hhb.gz

permissions: '0644'



#!/bin/bash

mkdir -p /home/ubuntu/config



---
Huang.haibin
11628530
86+18106533356





___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack