Ask Your Question
0

tacker user_data not working for OpenWRT image

asked 2017-01-12 05:47:01 -0500

abhilash-goyal gravatar image

Following tosca template is not working as expected for OpenWRT image. It is not updating the /etc/hosts file. In contrast when I am using cirros image instead, it is working perfectly.

Any help regarding would be appreciated.

> tosca_definitions_version:
> tosca_simple_profile_for_nfv_1_0_0
> 
> description: OpenWRT with services
> 
> metadata:   template_name: OpenWRT
> 
> topology_template:   node_templates:
> 
>     VDU1:
>       type: tosca.nodes.nfv.VDU.Tacker
>       properties:
>         image: OpenWRT
>         flavor: m1.tiny
>         config: |
>           param0: key1
>           param1: key2
>         mgmt_driver: openwrt
>         user_data_format: RAW
>         user_data: |
>           #!/bin/sh
>           i=$(ifconfig eth0|grep 'inet addr'|awk -F: '{print $2}'| awk '{print $1}')
>           w="OpenWRT"
>           y=$i"  "$w
>           sed -i -e "\$a$y" /etc/hosts
>           sed -i -e "s/cirros/$w/g" /etc/hosts
>         monitoring_policy:
>           name: ping
>           parameters:
>             count: 3
>             interval: 10
> 
>     CP1:
>       type: tosca.nodes.nfv.CP.Tacker
>       properties:
>         management: true
>         anti_spoofing_protection: false
>       requirements:
>         - virtualLink:
>             node: VL1
>         - virtualBinding:
>             node: VDU1
> 
>     CP2:
>       type: tosca.nodes.nfv.CP.Tacker
>       properties:
>         anti_spoofing_protection: false
>       requirements:
>         - virtualLink:
>             node: VL2
>         - virtualBinding:
>             node: VDU1
> 
>     CP3:
>       type: tosca.nodes.nfv.CP.Tacker
>       properties:
>         anti_spoofing_protection: false
>       requirements:
>         - virtualLink:
>             node: VL3
>         - virtualBinding:
>             node: VDU1
> 
>     VL1:
>       type: tosca.nodes.nfv.VL
>       properties:
>         network_name: net_mgmt
>         vendor: Tacker
> 
>     VL2:
>       type: tosca.nodes.nfv.VL
>       properties:
>         network_name: net0
>         vendor: Tacker
> 
>     VL3:
>       type: tosca.nodes.nfv.VL
>       properties:
>         network_name: net1
>         vendor: Tacker
edit retag flag offensive close merge delete

Comments

Hi,

Can you please provide me some instructions to inject configuration to vnf since i was unable to push configuration to openwrt vnf

Best Regards,

-Vishnu

vishnu430 gravatar imagevishnu430 ( 2017-04-17 04:11:34 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-01-29 13:52:11 -0500

Hi ! I think it's because the OpenWRT's eth0 is bridged by default, so you would have to refer to 'br-lan' here:

i = $(ifconfig br-lan|grep 'inet addr'|awk -F: '{print $2}'| awk '{print $1}')
edit flag offensive delete link more

Comments

Hi I am also facing the same issue as I can able to execute shell commands on cirros-0.3.5-x86_64-disk.img image but when I am trying to do the same on OpenWRT image I was not happening.

Do I need to take any special care to OpenWRT? Kindly suggest me to move forward.

Thanks in advance -Vishnu

vishnu430 gravatar imagevishnu430 ( 2017-05-19 09:21:22 -0500 )edit

Hi @Vishnu, what would you like to configure through the OpenWRT shell?

gianpietro gravatar imagegianpietro ( 2017-05-19 16:41:41 -0500 )edit

Hi @gianpietro below is yaml user_data content

    user_data: |
      #!/bin/sh
      echo "my hostname is `hostname`" > /tmp/hostname
      df -h > /tmp/diskinfo

I'm trying very minimal basic commands.

Regards,

-Vishnu

vishnu430 gravatar imagevishnu430 ( 2017-05-22 01:35:01 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2017-01-12 05:47:01 -0500

Seen: 171 times

Last updated: Jan 29 '17