Commit Graph

131 Commits (ab50e471b976d2820b8f2ff30de1534491e79f3a)

Author SHA1 Message Date
asmita singh ab50e471b9 Auth parameters for uploading vnf package from URI
Upload VNF Package from uri REST API accepts userName and password
parameter but internally these parameters are not used while getting
the csar zip file from the URI as specified in the addressInformation.
If the server serving the CSAR zip requires authentication, it would
return 401 error and the uploading vnf package will fail to set the VNF
package to onboarded status.

This patch uses userName and password parameters to set "Authorization"
header as shown below if these parameters are passed in the request body.

* The userName and password are combined with a single colon (:).
This means that the username itself cannot contain a colon.
* The resulting string is encoded using a variant of Base64.
* The authorization method (Basic and a space (e.g. "Basic ") is then
prepended to the encoded string.

For example, if userName and password is "xyz" and "xyzpassword", then
the field's value is the base64-encoding of xyz:xyzpassword, or
eHl6Onh5enBhc3N3b3Jk. Then the Authorization header will appear as:

Authorization: Basic eHl6Onh5enBhc3N3b3Jk

Change-Id: Ie79d5e4659951f41db4a1003950c649acab8b439
3 years ago
Sameer d3cc82139e Fetch an on-boarded VNF package with HTTP_RANGE
The GET method fetches the content of a VNF package identified by
the VNF package identifier allocated by the NFVO.

The 'HTTP_RANGE' header is inspected for a valid value.
If it is present and valid, then the package content within
the range is fetched.If not present the entire content is
fetched

A 'size' column has been added to vnf_packages db table.
When the VNF package content is uploaded, the size of the
csar zip is persisted in this newly added 'size' column of
vnf_packages db table.

When VNF_Package content is fetched for the first time, its size is
retrieved from glance store and the size column in vnf packages table
is populated with this value. For subsequent fetch calls the size of
csar file content is retrieved from 'size' column in vnf_packages
table.

A lot of the content fetching code has been reused from
glance/api/v2/image_data.py ResponseSerializer class
download function

Blueprint: bp/enhance-vnf-package-support-part1

Change-Id: Ib49ef8b1e81ca4a4b7e3ac4a0836c111ce7da4a3
3 years ago
Andreas Jaeger 4a2fd6c292 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found by updated hacking version.

Update local hacking checks for new flake8.

Remove hacking and friends from lower-constraints, they are not
needed in installations.

Change-Id: If787d610315be6c973b4335e047242c3aa3caf2a
3 years ago
Shubham 70ac63d834 Remove 'vnf_packages' key from vnf package list response
As per ETSI GS NFV-SOL 005 V2.4.1 (2018-02) table 9.4.2.3.2-2, GET Vnf
Packages should return list of all Vnf packages, but as per current
implemention this api is returning dictionory with resource name as key
i.e {'vnf_packages': [{vnf_package1}, {vnf_package2},...]}. Hence
removing the resource key and returning api response as a list.

As per process to fix this issue we need to provide micro version
support in tacker as well as in python-tackerclient for command.
The list api was part of VNF package api which released in train cycle.
But we can not instantiate, terminate and Heal VNF as these feature is
not released yet and about to release in U cycle. The changes we have
proposed will be useful after U release and that is why we think we
should do these change without micro version support.

Closes-bug: #1871054
Change-Id: I7f5105fc7a49f9d31fb32119c725dae0421cfde7
3 years ago
Zuul ffee7ed0dc Merge "Support LCM operation with user data" 3 years ago
Hiroo Kitamura 62813239e1 Support LCM operation with user data
Implement new method of VNF lifecycle management using LCM operation
user data.

Change-Id: Ib2fbe341b5d26758f0b48dc19e3e05810c2c830f
Blueprint: support-etsi-nfv-specs
3 years ago
tpatil 3f5c81604e Support attribute filtering for GET /vnf_packages API
Certain resource representations can become quite big, in particular
``GET /vnfpackages`` API which is a container for multiple sub-resources.
In these cases, it can be desired to reduce the amount of data exchanged
over the interface and processed by the API consumer application.

An attribute selector i.e filter, allows the API consumer to choose
which attributes it wants to be contained in the response. Only
attributes that are not required to be present, i.e. those with
a lower bound of zero on their cardinality (e.g. 0..1, 0..N)
and that are not conditionally mandatory, are allowed to be omitted
as part of the selection process.

This patch implements attribute filtering for ``GET /vnfpackages`` API.

It will support following query parameters:-
* filter: Filter criterion built with attributes of VNF Package and
REST operators.
* all_fields: Return all fields
* fields=<list> : Return fields specified in the <list>
* exclude_fields=<list>: Return fields not specified in the <list>
* exclude_default parameters: Return all fields except default fields
* exclude_default and fields=<list>: Return all fields except default
fields and fields in the <list>
* When no parameter is specified it is treated as exclude_default.

You can find more details about supported query parameters in document:
ETSI GS NFV-SOL 013 V2.6.1 (2019-03 in section 5.2 and 5.3

Co-Authored-By: Prashant Bhole <prashant.bhole@nttdata.com>

Change-Id: I1513d7d87967de5248787cd298c3bec65c2dde9d
Implements: bp/enhance-vnf-package-support-part1
3 years ago
tpatil 428096a247 Add functional tests for vnflcm APIs
Added functional tests for all support vnflcm APIs:-
1. Create Vnf instance API
2. Instantiate Vnf API
3. Heal Vnf API
4. Terminate Vnf API
5. List Vnf API
6. Show API
7. Delete API

Change-Id: Id8aff0f41caed6d52b20e7e5604dc28d8c56c567
blueprint: bp/support-etsi-nfv-specs
3 years ago
tpatil 31beaa32b8 Fix FT vnf package functional tests
test_upload_from_file_and_delete functional test is failing
as the vnf package 'operationalState' is not DISABLED
before deletion.

To fix this issue, I have merged two existing FTs into new one
which will test the flow - create, upload, update, show and delete.

* Deleted existing FT
  test_upload_from_file_and_delete
  test_patch_in_onboarded_state
* Added new FT
  test_upload_from_file_update_show_and_delete.
* Fixed get vnfd related functional tests by setting package
  operational state to DISABLED before deleting
* assert_resp_contents method now uses assertCountEqual to compare
  list of string as it ignores order of items in the list.

Closes-bug: #1866776
Change-Id: I310f4206527cfe215116f8d85acdb1f519d67a97
3 years ago
Shubham Potale f03b615bfe Implement RestFul API to read VNFD of an on-boarded VNF package
The VNFD can be implemented as a single file or as a collection of
multiple files. If the VNFD is implemented in the form of multiple
files, a ZIP file embedding these files shall be returned. If the VNFD
is implemented as a single file, either that file or a ZIP file
embedding that file shall be returned.

Implemented below API:-

* GET /vnf_packages/{vnfPkgId}/vnfd

Change-Id: I4af9c8126fb7478da294bc99a176eabba3944564
Implements: bp enhance-vnf-package-support-part1
3 years ago
ajay.parja c74cad521c Add VNF package update API
Added API to update information of VNF package.

Implemented below API:-

* PATCH /vnf_packages/{vnfPkgId}

Co-authored-by: Shubham Potale <shubham.potale@nttdata.com>
Change-Id: I6d60e87b48a6703362dcd30975f300f524f8ca7a
Implements: bp enhance-vnf-package-support-part1
3 years ago
Hiroo Kitamura 3f3cee41c0 Support updating VNF parameters in tacker
Implementation to update parameters of created VNF in tacker.

Change-Id: I7746644f7340ea8e25150f9fd8fbc59ec4e5c720
Blueprint: https://blueprints.launchpad.net/tacker/+spec/reservation-vnfm
3 years ago
dharmendra af4cdf089d Fix gate job for test_vnf_param_with_artifacts_image_tosca_template
In functional test test_vnf_param_with_artifacts_image_tosca_template, heat create
task to fetch GlanceWebImage from param url value, and stuck in infinite loop of running
and sleeping task, due to which vnf creation could not be completed and VNF failed with
PENDING_CREATE. This issue occured due to bug #1847188, skipping test until bug fixed.

Change-Id: Ifeb3d46b8b78688687f53e2f17fecddef1ed4b3b
4 years ago
Niraj Singh 4fa204b370 Add vnf packages RestFul APIs
Implemented following APIs:-

* GET    /vnf_packages
* POST   /vnf_packages/
* GET    /vnf_packages/{vnfPkgId}
* DELETE /vnf_packages/{vnfPkgId}
* PUT    /vnf_packages/{vnfPkgId}/package_content
* POST   /vnf_packages/{vnfPkgId}/package_content/upload_from_uri

Partial-Implements: blueprint tosca-csar-mgmt-driver

Depends-On: If8155399df12a96cb86631dfa22eaca7a5a8d398

Co-Author: Neha Alhat <neha.alhat@nttdata.com>
Change-Id: Id3b4812e24a1ed84fe94429e074f96ae11530517
4 years ago
dharmendra ff00c86b1e Fix gate failure
Functional test test_vnf_with_placement_policy_invalid failing with
MismatchError on gate due to invalid string check. Please see [1].
Fixing it with correct string check.

[1]: http://logs.openstack.org/96/666496/7/check/tacker-functional-devstack-multinode-python3/fae7692/testr_results.html.gz

Change-Id: I3b448067036f122e16826d4729c59a65e70109ac
4 years ago
dharmendra fc8f7d2b18 FT to check SSH access after VNF is created.
Adding functional test case for cmd_executer.py to check SSH
access after VNF is created.

Closes-Bug:#1592235

Change-Id: I4e5e677aad59fc3fe6ea37ef339044b10e5792da
4 years ago
Cong Phuoc Hoang c981d65451 Fix issue in 'post_process_heat_template' function
If users specify parameters in 'flavor' or 'image' properties
of a VDU, HOT template can not be processed properly because
there is a missmatch between TOSCA and HOT template.

This patch will change 'get_input' to 'get_param' to fix that
issue.

Change-Id: I353e9d9d70dc6249a62dcdd1281b7b60d28d7d30
Closes-Bug: #1813135
Depends-On: Ib95ed31c70073cb732d41defe5bdc8027eadfeec
4 years ago
dharmendra c9fee0af8d Move to use only kestone v3 api
Currently Tacker usage a misxture of v2 v3 api, which is suboptimal
from both a performance and code-elegance perspective. In this patch
we refactor v2 apis from code.

Change-Id: I981887f3f5af6356aba45a6d128d3e4b23b10286
Implements: blueprint keystone-v3
4 years ago
niraj singh 1d7cd6f604 Add functional test for reservation support
Added functional test for reservation support.

Implements: blueprint reservation-vnfm
Change-Id: Ia09240875bd5c0ceb70602d73a0a5c94a4dde060
4 years ago
dharmendra 9cfab81c2c Python3 support
In order to achieve py3-first goals, upgrading code base that will be
compatible with py3 as well as py2.

Change-Id: I562c63c576cc2f5dc5d93b5ec6741152e1f80466
4 years ago
dharmendra 48a5f80be7 Update functional tests for tosca dict
As yaml strings had been depricated. In this patch redactor
functional test cases for depricated yaml strings and provide
tosca dict as input for create_vnfd.

Change-Id: I5d7411200c2cbff5a002dfa2d5e36a65d6b39332
Partial-Bug: #1634376
4 years ago
venkatamahesh 5a1e4a1ccb Parameter changed from mgmt_url to mgmt_ip_address
At present the VNF mgmt IP address is assigned to parameter name
of "mgmt_url". In this patch it is changed to "mgmt_ip_address"
which will be relevant one

Co-Authored-By: Dharmendra Kushwaha <dharmendra.kushwaha@india.nec.com>

Change-Id: I621b71d4af96a4bfa0f27442efe4d302c5afa96d
Partial-Bug: #1648327
4 years ago
bhagyashris 5f1e48ff46 Add new policy action: vdu_autoheal
This patch adds below functionality:

- New policy action ``vdu_autoheal`` for recovering failed VDUs
  as reported by the respective monitoring driver configured in
  the monitoring policy of the VNFD template.

- Add unit/functional tests.

- Added oslo_versioned library to implement HealVnfRequest object.

Note: The implementation of vdu_autoheal policy action will support
HealVnfRequest interface  as mentioned in the ETSI standard [1]

[1]: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.05.01_60/gs_NFV-SOL003v020501p.pdf

Implements: blueprint vdu-auto-healing
Change-Id: If62acbdac41c92842de0ae3b7dedcda9fd1f86e6
4 years ago
hoangphuocbk 0da9469017 Move usage from deprecated Ceilometer API to Gnocchi API
This removes usage of deprecated Ceilometer API

1. Changing trigger type from "OS::Ceilometer::Alarm"
to "OS::Aodh::GnocchiAggregationByResourcesAlarm"
2. Add "resource_type" fixed with value "instance"
3. Change some paramters (meter_name-> metric,
statistic ->aggregation_method, period-> granularity)
4. Change value from "average" to "mean" in method to
compare to the threshold

Change-Id: I486c14cbc9d05a0e826bbef1ad181bdcb2d8c951
Closes-Bug: #1735484
5 years ago
Zuul 7a0efa8007 Merge "Add placement policies support" 5 years ago
dineshbhor f47bf1ba32 Add placement policies support
- This patch aims to add support for following placement policies in
  addition to the default 'affinity' policy:
    anti-affinity
    soft-affinity
    soft-anti-affinity

- This patch adds respective functional/unit test cases. To test
  "anti-affinity" policy on the gate, changed the devstack functional
  jobs `nodeset` from the default single node to "openstack-two-node".

- This patch also adds respective documentation and usage guide for
  the above added policies.

Depends-On: I56a9cf4bb553c8026eec73212a3742d5eab17420
Co-Author: tpatil <tushar.vitthal.patil@gmail.com>
Implements: blueprint vdu-affinity-policy
Change-Id: I18aaa9d00c8539ccc60cb6e70570dee124df70a3
5 years ago
Nguyen Hai f16ac7c79f Update cirros to 0.4.0
Change-Id: Ie4ff403f803a16ca53c91c7d10d71ec80fbe1a9b
5 years ago
dharmendra c99fa62a9e Add functional test for ns-vnffg
Change-Id: Ie669da571a605a7635fd490475aeef80b75c9b2c
Partially-implements: blueprint vnffg-ns
5 years ago
gongysh fb50684adc Remove old style ssl setting
devstack is using apache as a ssl proxy for wsgi api service.
Current tacker does not support it. We remove it for the time being

This patch also skip scale unit tests which failed due to
heat translator change. The unit test will be enabled at
another patch.

Change-Id: If767d05a0241888663f0ff21282cebfd256efb49
Closes-bug: 1755664
5 years ago
dharmendra c6b758477c Permission issue with heat.
While deploying a vnf with autoscaling, heat translator failed with
premission denied error. This issue occured because [1] opening file
in root dir (i.e. '/'), due to which it giving permission denied.
Fixing it by setting current working dir as '/temp'

[1]: https://github.com/openstack/heat-translator/blob/master/translator/hot/tosca_translator.py#L69

Change-Id: Ib2b0fd6c4c32a523b9fb25f47eae19225b84439f
Closes-bug: #1749394
5 years ago
Zuul 8fb6b27faa Merge "replace the class path uuid based stack names with vnf names" 5 years ago
dharmendra c71ca9a01e replace the class path uuid based stack names with vnf names
Tacker uses the class path+file name+uuid as stack names to
uniquely identify the stacks for vnf create and vnf respawn workflow.
Tacker now mandates VNF names to be provided in API layer and will be
made unique. It is useful to base stack names based on vnf names for
debugging purposes. This affects the naming of nova instances as well.

Change-Id: If043ad8c6c356f3fa1d2f5648d3d861ff5006602
Closes-Bug: #1590215
5 years ago
gongysh 06f8504eee Skip alarm functional test until heat-translator supports gnocchi aodh alarm
Change-Id: I22ef2d771736a3656e38d785582668b96fbf2ec6
Partial-bug: 1744528
5 years ago
Bharath Thiruveedula 57c4847071 Implement Block Storage Support - Part 1
This patch adds support to attach volumes to VDU.
This patch does not deal with boot from volume case.

Change-Id: I4bee80610eaa4e2ec8a1ccb2a5d36fb723a09806
Implements: persistent-block-storage
6 years ago
doantungbk af7d3d7cb1 Refactor scaling and monitoring policies in Tacker
1. scaling and monitoring policy nodes got failed

From tosca-parser 0.8.0, tosca nodes required to be validated.
Unfortunately, the scaling and monitoring policies are not fully
leveraged tosca-parser. This patch will fix this issue.

2. Multiple alarm actions support

Closes-bug: #1682098

Change-Id: I29cb35edfe2447628fa93c64583e5cb4f7bee2f8
6 years ago
Saju Madhavan 52bdf321c4 Assign floating IP to the vdu
Assign floating IP to the vdu using TOSCA template

Change-Id: I53a89397c1ef676f1a21bc1378c91aece65a3d91
Closes-Bug: 1537636
6 years ago
Cong Phuoc Hoang d62364cbff Update creating directly VNFFG and NS from descriptor template.
Currently, Tacker only support creating VNFFG and NS from VNFFG descriptor
and NS descriptor. This patch will support creating directy VNFFG and NS
from template file without initiating VNFFG and NS descriptors before.

Change-Id: I4e8ec8405a291300aa6749cf814ad582786c285d
Closes-bug: #1681032
6 years ago
dharmendra 405579b01d Prevent to create duplicate entry
Closes-Bug: #1697818

Change-Id: Ie35ebb68a611a00632ba2ba860fd6a6cd7ec9dbb
6 years ago
Yan Xing'an 07428d4985 Support to use barbican to encode vim password
1. Add new option 'use_barbican' in config file [vim_keys] section,
   default value is False for Pike.
2. Use fernet to encrypt vim password, and save the fernet key into
   barbican as a secret.
3. Add new fields 'key_type', 'secret_uuid' into VimAuth.auth_cred
   json string. secret_uuid is masked in vim-show or vim-list response.
4. Set the vim's default 'shared' value to False,
   vim can only be used by who created it.
5. Add a devref to show how to test.
6. Add a release note.

Implements: blueprint encryption-with-barbican
Partial-bug: #1667652

Change-Id: I5c779041df5a08a361b9aaefac7d241369732551
6 years ago
Luong Anh Tuan ad54b62ef8 Replace assertRaisesRegexp with assertRaisesRegex
This replaces the deprecated (in python 3.2) unittest.TestCase
method assertRaisesRegexp() with assertRaisesRegex().

Change-Id: Ic04e7406610a3b3f1232bc08c0b1ce94adb06827
Closes-Bug: #1436957
6 years ago
Dharmendra Kushwaha 2aec2ae7e5 Adds unique constraint on deleted_at
After deleting a resource, while trying to create again with same
name, it was throwing error as DuplicateEntity.
Fixing this issue by adding unique constraint on deleted_at.

Change-Id: I0e31346a471556f08c4fc5a6cc7bc130a133c24d
Closes-bug: #1680689
6 years ago
Trinath Somanchi b6f4562732 'update-vim' - server side changes.
update to VIM attributes like, 'name', 'description' and 'is_default'
must not require config file.

This change addresses this issue.

client-side-fix: https://review.openstack.org/#/c/450100/

Closes-Bug: #1637360
Change-Id: I12b57f3a60e5a771f607de965f2ea8f4f37cdbf6
6 years ago
yong sheng gong 242c279091 Make vim test config file aware of devstack keystone setting
Closes-Bug: #1684335
Depends-On: I4b0836a6a241de2ddebf175445fd86a0bf8dcf85

Change-Id: I930bd3b7e177754db4011c3b096207d44a69d28c
6 years ago
doantungbk 2364523b79 Temporarily bypass Unit tests and Func. tests for scaling
and monitoring policcies

Tosca-parser was released. This made scaling policy node and
monitoring policy node failed.

Change-Id: I617f34ffeb68f24899786345e823bb022f1aaf13
6 years ago
doantungbk 72d7af1d6a Separating tosca driver out from VNFM
This patch is expected to have the separation of tosca driver
in the future.

Implements blueprint: #tosca-engine

Change-Id: Ieab0964f9a5936611a9b2288f2d6d44a42a725de
6 years ago
WangBinbin 4889515fcf Replace yaml.load with yaml.safe_load;
Replace yaml.dump with yaml.safe_dump;

In the file
 /vnfm/infra_drivers/openstack/translate_template.py#L453
 /vnfm/tosca/utils.py#L267

The default yaml.safe_dump does not support OrderedDict,
So Add one function for the yaml.safe_dump in the files above

yaml.safe_load is more safer than yaml.load, that's the patch meaning

Change-Id: Iab0e976b1163220bd78c2ceda83243c2da4c6624
Closes-Bug: #1673294
6 years ago
Jenkins d2badacda9 Merge "Skip image auto creation test" 6 years ago
yong sheng gong 6820836548 Skip image auto creation test
The heat OS::Glance::Image is relying on glance v1, and
the heat resource type is deprecated.

Devstack disables glance v1 API at https://review.openstack.org/#/c/343129/.

Skip this test until heat has new glance image resource type.

Change-Id: I4b1b127fc804fa9b93fff6b835bc2d5b8fa9aa4f
Closes-bug: 1673099
6 years ago
yong sheng gong e3f4d33f48 Skip VNFC test until vnfc image placement is fixed
Change-Id: I92e5afbc7c4be9e69c4267725ac76aa39af1a5fc
Partial-Bug: 1673012
6 years ago
Jenkins 4349df4ece Merge "Implement VNFC support" 6 years ago