unable to create tosca templates with scaling policy

Asked by Daniel Raj

Hi Team,

when I try to on-board following yaml files

https://github.com/openstack/tacker/blob/master/samples/tosca-templates/vnfd/tosca-vnfd-scale.yaml

https://github.com/openstack/tacker/blob/master/samples/tosca-templates/vnfd/tosca-vnfd-alarm-scale.yaml

I get this error

Failed to create VNF: heat-translator failed: - [Errno 13] Permission denied: 'SP1_res.yaml'

can you please suggest how to solve this.

Thanks,
Daniel Raj.

Question information

Language:
English Edit question
Status:
Answered
For:
tacker Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Michael Kashin (mkashin) said :
#1

I'm also seeing this with the master tacker branch. some additional logs from tacker server:

2017-10-12 16:54:25.155 31 DEBUG heat-translator [req-9a9f43dd-a126-4c5a-aaa0-72d9e42870d3 6b3c22147bd74f0082f1db34aba8c2ae b4d0233ae07d4ebbb9dc90eaa4fc26ae - - -] Translating TOSCA outputs to HOT outputs. __init__ /var/lib/kolla/venv/lib/python2.7/site-packages/translator/hot/translate_outputs.py:26
2017-10-12 16:54:25.156 31 DEBUG heat-translator [req-9a9f43dd-a126-4c5a-aaa0-72d9e42870d3 6b3c22147bd74f0082f1db34aba8c2ae b4d0233ae07d4ebbb9dc90eaa4fc26ae - - -] Converting translated output to yaml format. output_to_yaml /var/lib/kolla/venv/lib/python2.7/site-packages/translator/hot/syntax/hot_template.py:67
2017-10-12 16:54:25.163 31 DEBUG tacker.vnfm.infra_drivers.openstack.translate_template [req-9a9f43dd-a126-4c5a-aaa0-72d9e42870d3 6b3c22147bd74f0082f1db34aba8c2ae b4d0233ae07d4ebbb9dc90eaa4fc26ae - - -] heat-translator error: [Errno 13] Permission denied: 'POLICY_SCALING_res.yaml' _generate_hot_from_tosca /var/lib/kolla/venv/lib/python2.7/site-packages/tacker/vnfm/infra_drivers/openstack/translate_template.py:292
2017-10-12 16:54:25.163 31 DEBUG tacker.vnfm.plugin [req-9a9f43dd-a126-4c5a-aaa0-72d9e42870d3 6b3c22147bd74f0082f1db34aba8c2ae b4d0233ae07d4ebbb9dc90eaa4fc26ae - - -] Fail to create vnf e30ada02-ebf6-4754-bfd6-54b4869310a0 in infra_driver, so delete this vnf _create_vnf /var/lib/kolla/venv/lib/python2.7/site-packages/tacker/vnfm/plugin.py:339
2017-10-12 16:54:25.192 31 DEBUG tacker.db.vnfm.vnfm_db [req-9a9f43dd-a126-4c5a-aaa0-72d9e42870d3 6b3c22147bd74f0082f1db34aba8c2ae b4d0233ae07d4ebbb9dc90eaa4fc26ae - - -] vnf_db <tacker.db.vnfm.vnfm_db.VNF[object at 7264fd0] {tenant_id=u'b4d0233ae07d4ebbb9dc90eaa4fc26ae', id=u'e30ada02-ebf6-4754-bfd6-54b4869310a0', created_at=datetime.datetime(2017, 10, 12, 16, 54, 23), updated_at=None, deleted_at=datetime.datetime(1, 1, 1, 0, 0), vnfd_id=u'978b86e0-3fc8-4616-a65c-1ed4b16af5e9', name=u'vIDS-1', description=u'Cirros vIDS example', instance_id=None, mgmt_url=None, status='PENDING_DELETE', vim_id=u'2de30ce5-5060-4251-87db-49f86511c183', placement_attr={u'vim_name': u'KOLLA-OPENSTACK'}, error_reason=None}> _make_vnf_dict /var/lib/kolla/venv/lib/python2.7/site-packages/tacker/db/vnfm/vnfm_db.py:218

Revision history for this message
Daniel Raj (dnelaturi) said :
#2

Hi Team

can you provide any resolution?

Daniel Raj.

Revision history for this message
Bob Haddleton (bob-haddleton) said :
#3

It sounds like maybe you don't have write permissions in the directory you're in or maybe in the directory that contains the template.

Make sure you have write permission in your local directory and maybe copy the template into the local directory if it's not there already.

Hope this helps

Revision history for this message
Daniel Raj (dnelaturi) said :
#4

Hi Bob,

The set-up is based on latest release with devstack
I have given permission to output folder but still unable to create vn. Can you please suggest

stack@devstack:/usr/local/lib/python2.7/dist-packages/translator/tests/data/hot_output/nfv$ tacker vnf-create --vnfd-id 1cb327da-161c-4ff6-bb5b-79f1d3fb0395 --vim-id 62c0b537-eb87-457e-8b30-555b122db178 --vim-region-name RegionOne tst
heat-translator failed: - [Errno 13] Permission denied: 'SP1_res.yaml'
stack@devstack:/usr/local/lib/python2.7/dist-packages/translator/tests/data/hot_output/nfv$ ls -alrt
total 20
-rwxrwxrwx 1 root staff 767 Oct 5 17:47 hot_tosca_nfv_autoscaling.yaml
-rwxrwxrwx 1 root staff 1612 Oct 5 17:47 hot_nfv_sample.yaml
drwxrwsr-x 9 root staff 4096 Oct 5 17:47 ..
-rwxrwxrwx 1 stack stack 907 Oct 24 18:33 SP1_res.yaml
drwxrwsr-x 2 root staff 4096 Oct 24 19:21 .
stack@devstack:/usr/local/lib/python2.7/dist-packages/translator/tests/data/hot_output/nfv$ touch test.txt
stack@devstack:/usr/local/lib/python2.7/dist-packages/translator/tests/data/hot_output/nfv$ ls -lart
total 20
-rwxrwxrwx 1 root staff 767 Oct 5 17:47 hot_tosca_nfv_autoscaling.yaml
-rwxrwxrwx 1 root staff 1612 Oct 5 17:47 hot_nfv_sample.yaml
drwxrwsr-x 9 root staff 4096 Oct 5 17:47 ..
-rwxrwxrwx 1 stack stack 907 Oct 24 18:33 SP1_res.yaml
-rw-rw-r-- 1 stack staff 0 Oct 24 19:54 test.txt
drwxrwsr-x 2 root staff 4096 Oct 24 19:54 .
stack@devstack:/usr/local/lib/python2.7/dist-packages/translator/tests/data/hot_output/nfv$

Revision history for this message
Daniel Raj (dnelaturi) said :
#5

Hi,

Please find strace output

stat("/usr/share/locale/en_US/LC_MESSAGES/messages.mo", 0x7ffe13d25a80) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale-langpack/en_US/LC_MESSAGES/messages.mo", 0x7ffe13d25a80) = -1 ENOENT (No such file or directory)
stat("/opt/stack/.netrc", 0x7ffe13d24620) = -1 ENOENT (No such file or directory)
stat("/opt/stack/_netrc", 0x7ffe13d24620) = -1 ENOENT (No such file or directory)
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
setsockopt(3, SOL_TCP, TCP_KEEPIDLE, [60], 4) = 0
setsockopt(3, SOL_TCP, TCP_KEEPCNT, [4], 4) = 0
setsockopt(3, SOL_TCP, TCP_KEEPINTVL, [15], 4) = 0
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(9890), sin_addr=inet_addr("10.10.20.152")}, 16) = 0
sendto(3, "POST /v1.0/vnfs.json HTTP/1.1\r\nH"..., 616, 0, NULL, 0) = 616
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR) = 0
recvfrom(3, "HTTP/1.1 400 Bad Request\r\nConten"..., 8192, 0, NULL, NULL) = 356
write(2, "heat-translator failed: - [Errno"..., 71heat-translator failed: - [Errno 13] Permission denied: 'SP1_res.yaml'
) = 71
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x7f805e1c6390}, {0x53e110, [], SA_RESTORER, 0x7f805e1c6390}, 8) = 0
close(13) = 0
futex(0x7f805a247ea4, FUTEX_WAKE_PRIVATE, 2147483647) = 0
fstat(10, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 9), ...}) = 0
exit_group(1) = ?
+++ exited with 1 +++
stack@devstack:~$

Revision history for this message
jayashree (rupeedas) said :
#6

is there any solution for this ?

Revision history for this message
jayashree (rupeedas) said :
#7

is there any solution for this ?

Revision history for this message
Trinh Nguyen (dangtrinhnt) said :
#8

Look like this bug has been fixed.

https://review.openstack.org/#/c/545435/

Can you help with this problem?

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

To post a message you must log in.