aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/common/openstack_utils.py
AgeCommit message (Collapse)AuthorFilesLines
2018-06-26Extended Context class with get_physical_nodes functionalityChornyi, TarasX1-0/+9
JIRA: YARDSTICK-1255 Change-Id: I446d715dc6cf716a4fcbc1b809c1b1d6303071e0 Signed-off-by: Chornyi, TarasX <tarasx.chornyi@intel.com>
2018-05-31Replace glance delete image with shade client.Shobhi Jain1-11/+8
Remove get_image_id function. Function delete_image now uses shade client. JIRA: YARDSTICK-892 Change-Id: I6e8510dfa49aa14786ed7ac3382b85c4e699fb9e Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-29Replace glance create image with shade client.Shobhi Jain1-23/+53
Function create_image now uses shade client. JIRA: YARDSTICK-892 Change-Id: Ia41d9ce702a1f24031080f8a365c1b2bd9ac9faa Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-08Replace cinder detach volume with shade client.Shobhi Jain1-5/+17
Function detach volume now uses shade client. JIRA: YARDSTICK-891 Change-Id: Ie437ccf1172cb82dc869963f0d62e31a5ab23ebb Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-08Replace cinder delete volume with shade client.Shobhi Jain1-18/+14
Function delete volume now uses shade client. JIRA: YARDSTICK-891 Change-Id: I016e1d3bf5972879cad176b56c7282e35413945e Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-08Replace cinder create volume with shade client.Shobhi Jain1-14/+31
Adds get_volume function. Function create volume now uses shade client. JIRA: YARDSTICK-891 Change-Id: I0b2fae5f2cf52eaf2e4a0062c858d49bc4ce9ccd Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-08Replace cinder get_volume_id with shade client.Shobhi Jain1-3/+2
Function get_volume_id now uses shade client. JIRA: YARDSTICK-891 Change-Id: I45ae40982a64f677dbbdeb6c9510a0ec9ac973f1 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-04Merge "Add "os_cloud_config" as a new context flag parameter"Emma Foley1-7/+22
2018-05-03Replace nova get flavor with shade client.Shobhi Jain1-5/+15
Rename get_flavor_by_name with get_flavor. Function get_flavor now uses shade client. JIRA: YARDSTICK-1088 Change-Id: Ic82127e475baf39643be0a254b177f3058b85748 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-03Replace nova get server with shade client.Shobhi Jain1-5/+19
Rename get_server_by_name with get_server. Function get_server now uses shade client. JIRA: YARDSTICK-1088 Change-Id: I69c59145cefdb565f3ece27baaaf932905e1b757 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-05-03Add "os_cloud_config" as a new context flag parameterRodolfo Alonso Hernandez1-7/+22
This new parameter will contain the OpenStack cloud specific configuration used by Shade client. This new flag is used only in Heat context. By default, this new parameter (dict) will contain this content: 'os_cloud_config': {'verify': False} This field will be used by HeatStack [1] to create a Shade cloud. Shade retrieves, if not defined, the OpenStack configuration from "os_client_config". This configuration is used to generate the cloud configuration, which is the description of the OpenStackCloud returned. The default parameter defined, "verify", refers to the related bug. By default, in case of using SSL certificate it will not be verified. [1] https://github.com/opnfv/yardstick/blob/b338d3091bb0beb89d4ad9f7c144f43a31a19a74/yardstick/orchestrator/heat.py#L47 JIRA: YARDSTICK-1139 Change-Id: I875a7018401b84e51dab775b8194174645d27e06 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-04-30Replace nova attach volume to server with shade client.Shobhi Jain1-9/+28
Function attach_volume_to_server now uses shade client instead of nova client. JIRA: YARDSTICK-1088 Change-Id: Id00df672c2c195b5c338cbbc30ddf2742a4e4d29 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-23Replace nova delete keypair with shade client.Shobhi Jain1-5/+11
Function delete_keypair now uses shade client. JIRA: YARDSTICK-1088 Change-Id: I46b895748c5c44b0bf7d5b035395676ebff48d7f Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-23Replace nova client create keypair with shade.Shobhi Jain1-7/+12
Function create_keypair now uses shade client instead of nova client. JIRA: YARDSTICK-1088 Change-Id: I060580504d6969c5ba859ed4494082feb998d37d Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-23Remove unused nova client functions.Shobhi Jain1-136/+0
Following funtions are not required by shade client also not been used in any of the scenario files: *create_aggregate *create_aggregate_with_host *create_instance *add_host_to_aggregate *create_aggregate_with_host *get_availability_zones *get_availability_zone_names *remove_hosts_from_aggregate *remove_host_from_aggregate *delete_aggregate *get_image_by_name *check_status JIRA: YARDSTICK-1088 Change-Id: I7ba0fbce6aa3e636aa55581a993c1ec1b48fbead Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-23Replace nova delete instance with shade client.Shobhi Jain1-7/+21
Function delete_instance now uses shade client. JIRA: YARDSTICK-1088 Change-Id: I5772a74c6dc2d103edd410042a8eaf721d1bcc5c Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-23Replace nova create instance with shade client.Shobhi Jain1-37/+85
Remove redundant functions: *get_instances *get_instance_status *get_instance_by_name Function create_instance_and_wait_for_active now uses shade client. JIRA: YARDSTICK-1088 Change-Id: I766da333dabbb1b83a7b4ede4bf73567ec70eb8c Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-16Replace neutron create security group full with shade.Shobhi Jain1-68/+45
Function create_security_group_full now uses shade client. Remove openstack util's private 'get_security_groups', 'get_security_group_id' & 'create_security_group' functions as 'create_security_group_full' now uses 'get_security_group' & 'create_security_group' function defined in shade client library. JIRA: YARDSTICK-890 Change-Id: Ibd5b9ca9b7ce99b3e40c5dcc545f2af672ce2203 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-04-12Bugfix: Can't get image list in APIchenjiankun1-1/+13
JIRA: YARDSTICK-1110 To match OpenStack Pike release, we upgrade novaclient from 7.1.1 to 9.1.1. And the client interface has changed, it no longer has nova_client.images attribute. So I use shade instead. Later will change all same issue. Change-Id: Ie4f54069d4346e44e2ad925439930504b945cbad Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2018-03-27Replace neutron create security group rule with shade.Shobhi Jain1-38/+51
Rename create_secgroup_rule with create_security_group_rule. Function create_security_group_rule now uses shade client. JIRA: YARDSTICK-890 Change-Id: Ie0ebac67a281e55dc95c0e3e33ba43de80aba9ec Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-27Replace neutron floating ip deletion with shade.Shobhi Jain1-6/+6
Function delete_floating_ip now uses shade client. JIRA: YARDSTICK-890 Change-Id: I960630926b664266afbe7be00bb1352243b41be0 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-20Replace neutron floating ip creation with shade.Shobhi Jain1-15/+31
Function create_floating_ip now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I3defd691dad998cebf98442b52f0555b176f1af4 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-20Replace neutron router interface deletion with shade.Shobhi Jain1-8/+19
Function remove_interface_router now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I6bd36e35a339cce64dfa8b69c1e7b56cd70af956 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-20Replace neutron router creation with shade.Shobhi Jain1-6/+22
Function create_neutron_router now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I819d26f4edb3af5e50f777e8ddbadf4d24820b7f Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-12Replace neutron router deletion with shade.Shobhi Jain1-6/+5
Function delete_neutron_router now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I5b557b640396f343b85b5f5eff415384decc083c Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-12Replace neutron subnet creation with shade.Shobhi Jain1-6/+48
Function 'create_neutron_subnet' now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I8eb5295cecd73742bfb5a7d0764af6f45ef0685e Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-03-12Replace neutron network creation with shade.Shobhi Jain1-6/+22
Function create_neutron_net now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I456078e98550901c1f736640c9f9bd0d5f9c3df6 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-02-28Deprecate authentication variable OS_TENANT_NAMERodolfo Alonso Hernandez1-34/+17
OS_TENANT_NAME was deprecated as authentication variable in Keystone when moved from v2 to v3, in Icehouse (2014). Because this project doesn't support oldest versions, by default the only identification API version supported is v3. JIRA: YARDSTICK-902 Change-Id: I273fb0151ba583f7c8a5a809e5e8864e92c27d31 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-02-19Replace neutron network deletion with shade.Shobhi Jain1-25/+27
Function delete_neutron_net now uses shade client instead of neutron client. JIRA: YARDSTICK-890 Change-Id: I99b6f3ecd37d6e3b783f7eb3da9f971398fc3bdd Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2018-02-09Replace neutron get network id with shade.Shobhi Jain1-75/+72
Function get_network_id now uses shade client instead of shade client. Removed redundant function: get_port_id. JIRA: YARDSTICK-890 Change-Id: I6081477fee39fa78131187e65daf3d7d3a9e439f Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
2017-08-25Add common openstack opertation scenarios: router & portJingLu51-0/+40
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: Id436a201aa04f8f6b98576e8fbf599ca3654827c Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-23Add common openstack opertation scenarios: volume & floating ipJingLu51-0/+49
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: I1300a61b389202242f112b6d280ab47746379546 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-21Add common openstack opertation scenarios: subnet & portJingLu51-0/+144
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: Ie59f0d5ae0842f8347824c961436b889a95b1a72 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-21Merge "Add common openstack opertation scenarios: network"Jing Lu1-0/+32
2017-08-11Merge "Add common openstack opertation scenarios: image & volume"Jing Lu1-0/+60
2017-08-11Add common openstack opertation scenarios: networkJingLu51-0/+32
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: I854fc435a5c951245a5997cd4e3e63c5162030af Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-11Add common openstack opertation scenarios: image & volumeJingLu51-0/+60
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: I3de7dbb30eaebac4feebcf07dd6a0d2bdcf428d9 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-08-11Add common openstack opertation scenarios: flavor & serverJingLu51-62/+39
JIRA: YARDSTICK-781 This patch adds some common openstack opertation scenarios Change-Id: I9e84a8894fe9b9c1754a45a0ddfdf93739164b9a Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-07-29Heat: support create and attach volume in heat type contextJingLu51-0/+24
JIRA: YARDSTICK-756 Some test scenarios require VM with volume attached. This work is about supporting create and attach volume in heat type context. context: name: demo image: cirros-0.3.5 flavor: yardstick-flavor user: cirros placement_groups: pgrp1: policy: "availability" servers: athena: floating_ip: true # per-vm inline volume definition. if no volume size specified, then this # volume should be an existing volume in the openstack environment volume: yardstick-volume placement: "pgrp1" ares: # per-vm inline volume definition. if volume size is specified, then this # volume will be crated and attach to the vm volume: name: test-volume size: 10 # volume mountpoint is also configurable volume_mountpoint: /dev/vdb placement: "pgrp1" networks: test: cidr: '10.0.1.0/24' Change-Id: Ief87b313980a59eac229eb4780d93ffc929ceb66 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-06-30Use "OS_INSECURE" variable as the insecure mode indicatorJingLu51-1/+2
Now we use "OS_CACERT" as the insecure mode indicator, it is better to use "OS_INSECURE". Change-Id: I1406193e27510390b4b8fd8f4751d8361560172f Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-04-26Bugfix: fix multi-region supportRoss Brattain1-1/+5
When running with multiple regions we need to specify the region when we select the endpoint. the region is specified in the OS_REGION_NAME env variable Change-Id: I37853dd42f6d9013d4475b5e3b2b9f97b6bdc8d0 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-03-30Bugfix: cacert should suppot insecure mode if neededrexlee87761-0/+1
currently, we use env variable "OS_CACERT" to specify the location of cert file. but if there's no cacert and use for personal verification, it's better to also support insecure mode by set OS_CACERT=False JIRA: YARDSTICK-616 Change-Id: I73b0860863bf6386f9114328c52594ef87e02fa3 Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2017-03-10Bugfix: yardstick https supportchenjiankun1-15/+6
JIRA: YARDSTICK-587 When run in https environment, there is a bug: error: failed to deploy stack: '_init_() got an unexpected keyword argument 'ca_cert'' The reason is the key pass to Session() is cacert, but the key should be verify. Change-Id: Ia9fc1d7908c2fca9d827a5f64deac7cd333d5c07 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-02-24Add common method of openstack in openstack_utilschenjiankun1-5/+343
JIRA: YARDSTICK-569 We have much redundancy code when using nova/neutron/glance... python client. So I write this code in openstack_utils for calling. Change-Id: I322b7577de4933246a15e6742ae5a28bea16eb02 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-02-07more logging fixesRoss Brattain1-1/+1
don't use .format() with logging, use regular %s logginer formatter Change-Id: I1ce0d81cc3f81c35003ef453e82c57faeb46c49f Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-01-12Add support for Python 3Ross Brattain1-0/+1
Porting to Python3 using Openstack guidelines: https://wiki.openstack.org/wiki/Python3 This passes unittests on Python 3.5 and passes opnfv_smoke suite Updates: use six for urlparse and urlopen fix exception.message attribute removal run unittests on python3 use unitest.mock on python 3 fix open mock for vsperf fix float division by using delta/eplison comparison use unicode in StringIO use plugin/sample_config.yaml relative path from test case fixed apexlake unittests upgraded to mock 2.0.0 to match python3 unittest.mock features fixed flake8 issues implement safe JSON decode with oslo_serialization.jsonutils.dump_as_bytes() implement safe unicode encode/decode with oslo_utils.encodeutils heat: convert pub key file from bytes to unicode pkg_resources returns raw bytes, in python3 we have to decode this to utf-8 unicode so JSON can encode it for heat template JIRA: YARDSTICK-452 Change-Id: Ib80dd1d0c0eb0592acd832b82f6a7f8f7c20bfda Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2016-12-27BugFix: correct Copyright info in openstack_utils.pyJingLu51-1/+0
JIRA:YARDSTICK-513 the copyright info in openstack_utils.py is not accurate. (yardstick: this file is copied from rally and slightly modified) this line should be deleted. Change-Id: I6cf8205ee6b142ae87b268829e5ac7454239dd0d Signed-off-by: JingLu5 <lvjing5@huawei.com>
2016-12-13Add support for OpenSrack NewtonJingLu51-0/+97
JIRA: YARDSTICK-410 This patch uses keystoneauth1.session to initialize the client for Heat The keystoneauth1.session.Session class was introduced into keystoneauth1 as an attempt to bring a unified interface to the various OpenStack clients that share common authentication and request parameters between a variety of services. Change-Id: Ie6287b50a36cf03950fa1174791df826e9bdafd3 Signed-off-by: JingLu5 <lvjing5@huawei.com>