Launching a sample program on a VNF

Asked by Basavaraj


I am a newbie to the Tacker world and have a little knowledge on its usage.
I just wanted to clarify my doubts on Tacker or probably Openstack.

Is there any way to automatically run a sample program (a c program that prints some lines on stdout) once the VNF is up and running?

Thanks in Advance,

Question information

English Edit question
tacker Edit question
Bob Haddleton Edit question
Last query:
Last reply:
Revision history for this message
Bob Haddleton (bob-haddleton) said :

Hi Basavaraj:

The easy way to do this is to use the "user_data" section of the template to run a shell command:

    id: vdu1
    vm_image: cirros-0.3.4-x86_64-uec
    instance_type: m1.tiny
    user_data_format: RAW
    user_data: |
       echo "Hello World!" | tee /dev/console

        network: net_mgmt
        management: true

Revision history for this message
Yubo Luo (luo65900) said :

Hi, I have a follow-up question.

I tried to implement this but got no output on the console. I am using PuTTY to ssh the server. I am also using the command line to create vnfd and vnf. After I executed"tacker vnf-create ...", not "hello world" showing in the console. I changed the code line

echo "Hello World!" | tee /dev/console --> echo "Hello World!" | tee /root/output.txt

no output.txt file generated.

My question is: when is this user_data command executed? right after the vnf is created?


Revision history for this message
dharmendra (dharmendra-kushwaha) said :

Hi Yubo,

I feel there is an understanding gap.
Once VNF created, neutron-metadata-agent executes the scripts/commands of user_data section inside the instance of VNF, not on the terminal from where you are executing commands(like. tacker vnf-create...).

If you are on the same track, Please verify if neutron-metadata-agent running, and check its logs.

Revision history for this message
Yubo Luo (luo65900) said :

Hi Dharmendra,

After I saw your message, I think there is an understanding gap. I am new to Tacker and OpenStack. I just followed the OpenStack tacker installation guide to successfully install Tacker and then read some articles under "Tacker User Guide".

 My goal is simple: I just want to test if my VNF works. Those articles under "Tacker User Guide" do not tell us how to verify if the VNF works and I can not see anything output once the VNF is on. The only thing I can see is that the VNF is active after I executed "tacker vnf-create ...". So, I googled how to test vnf and came to this post.

I thought once the VNF is created and active, it will execute the commands in the user_data, which seems wrong. Based on your reply, I now know the user_data is processed by neutron-metadata-agent. But how about other stuff? e.g. scaling, placement? I mean if I use VNF to implement a scalling or placement strategy and the vnf is active, does this mean the strategy is on?

Let's get back to the original issue. I checked neutron-metadata-agent by "service neutron-metadata-agent status" and it is active. Also, I checked the log under "/var/log/neutron/", there are two log files "neutron-metadata-agent.log" and "neutron-metadata-agent.log1". They are all empty. I checked this after the vnf became active.

Can you help with this problem?

Provide an answer of your own, or ask Basavaraj for more information if necessary.

To post a message you must log in.