Commit Graph

50 Commits

Author SHA1 Message Date
arunmani 9a6a26a644 Fix build failure
Change-Id: I81df5c3fd085f71215a572e4d6b620afe50daeb5
Closes-Bug: #1754589
2018-03-09 04:29:38 -05:00
arunmani 7f8aabe246 Fix issue related to keystone version check
Update the keystone version check logic to use version
attribute to detect the keystone version. The current
check breaks the driver sync logic if the attribute
isn't present in the keystone client object.

Change-Id: I271f39b320aec080e84c47b41b53d32be6879af2
Closes-Bug: #1754589
2018-03-09 03:38:47 -05:00
arunmani 9ed13036de Fix minor issues with the driver sync logic
Update the if check in nova sync code to return instance
flavor from powervc, if the call to get the same from db
failed for some reasons. Also, update the keystone version
check in the common package.

Change-Id: Iafc489ad723ef6732bddda029f1976204deef37d
Closes-Bug: #1742377
2018-01-10 02:11:44 -05:00
Arun Mani 50d1123691 Revert "Modify incorrect method to translate error message"
This reverts commit 161721311a.

Change-Id: Ia57e7dc952d36e9f4d8c5158b8fae3e44a586cbc
2017-11-13 05:05:26 +00:00
guanzuoyu 161721311a Modify incorrect method to translate error message
When process of powervc-drver connecting keystone failed, it would
give the error message in factory.py, but message objects do not
support str(), so it needs to be modified by using unicode.

Change-Id: I45bbb488300a5fe5c4e4f71265c3abacd775f41d
Closes-Bug: #1730356
2017-11-06 19:21:54 +08:00
Jerry Cai 06a4141f8c Add support for scheduler hints
Add support for scheduler hints.

Change-Id: I31a0f362eb8b9f83972d53d011900d1a038ab65c
Closes-Bug: #1666145
2017-02-20 16:44:07 +08:00
Jerry Cai 27b8e9db04 Add support to pvc 131 and 132
Add support to pvc 131 and 132

Change-Id: I752f53f9d8abebab0de86890edd70b17d30b0297
Closes-Bug: #1643787
2016-11-25 09:43:52 +08:00
Jerry Cai 8b6a7a3544 Check host status that disable the host service if host is down
Check host status that disable the host service if host is down

Change-Id: I241262e3bf055821cde96a52bfbefa3018cb7b27
Closes-Bug: #1498369
2015-09-23 15:29:56 +08:00
Jerry Cai 2c5f580f48 Volume sync and create/attach/detach implement for multiattach function
This bug tracks the implementation for volume sync and create/attach/detach
for multiattach function. Host status update also fixed along with this bug.

Change-Id: I45a776775473818c75388c3554664982849c4fae
Closes-Bug: #1491723
2015-09-03 16:16:38 +08:00
terryyao a16ac6df90 Exclude non-bootable storage template from image-topology
PowerVC 1.2.3 added complex boot/data volume concepts and it's image
accessible storage connective group's volume type API will return all
volume types for boot and data volume, we expose the PowerVC storage
templates in image's image-topology property and that property need only
include the bootable storage templates based on PowerVC 1.2.3 introduced
boot/data volume concept as we just expose the volume only for boot
volume at this time. The fix is just to exclude the SCG accessible
storage template via it's
['extra_specs']['capabilities:volume_backend_name'] property, and only
include the the storage template with such property value in SCG's
boot_providers list which means that volume type is a bootable volume
types. If SCG does not have such boot_providers property, then we just
ignore such checking.

Close-Bug: #1460563
Change-Id: Ifa608a514ec70b831d04802b728dff14864578ab
2015-06-01 16:32:46 +08:00
Jerry Cai d43d07acbc Using volume v2 client instead of v1 to get local volume
There is something wrong with volume v1 api to get volume detail info,
need to use volume v2 client instead of v1 to get local volume.

Change-Id: I76d067d2b1ee13c363dd5c22332d99d277c83f47
Closes-Bug: #1453358
2015-05-09 15:10:24 +08:00
Jerry Cai ead42c5d1b Glance service lacks v1 endpoint that fails the glance-powervc sync
From the latest ICM, versions are stripped from image service,
only ip:port left, in this case only "CURRENT" status client can be
retrieved, that is to say, for image service only v2.3 url returned
but v1.1 is lost, this will fail glance sync progress as both of
v2.3 and v1.1 are necessary, add this workaround to fix the problem.

Change-Id: I2723ae80654a2daffe7e3f7af0dbf73843bbfea2
Closes-Bug: #1450974
2015-05-02 10:42:23 +08:00
Jerry Cai 0c18f3154e Image not synced to latest PowerVC
Image not synced to latest PowerVC due to design changed.
boot volumes in images now have is_boot_volume = True set in
their metadata. The is_image_volume tag can be used to determine
if the volume is an image volume.

Change-Id: I99c8ad8bc4dc672aa0a35a5ea13c91c527a3cb9d
Closes-Bug: #1436142
2015-03-25 10:46:43 +08:00
Jerry Cai 057058dea6 Rename nova.openstack.common.log to oslo_log.log
another fix.

Change-Id: I1ba743708dcb8e2c986bed38fbcf33f5bf18c60e
Closes-Bug: #1430662
2015-03-11 17:42:20 +08:00
Jenkins da9a35bcf3 Merge "Rename nova.openstack.common.log to oslo_log.log" 2015-03-11 01:19:43 +00:00
Jerry Cai 3f2af18c03 Rename nova.openstack.common.log to oslo_log.log
Rename nova.openstack.common.log to oslo_log.log per openstack
code change.

Closes-Bug: #1430155
Change-Id: Idf9630734ad897d1a4a102edb8a24d17bdfb706b
2015-03-10 16:09:52 +08:00
Jerry Cai 6181667fcd Fix powervc resources name out of ascii range
To fix powervc resources name out of ascii range:
UnicodeEncodeError: 'ascii' codec can't encode characters in
position 17-18: ordinal not in range(128)

Closes-Bug: #1430179
Change-Id: Icd3bb2d17dbeedbd06e04395cfee97b1eadf129b
2015-03-10 15:37:26 +08:00
Jerry Cai ecdc1066a7 powervc-glance fail to sync images due to glanceclient changed
This is due to glanceclient update. The glanceclient.common.http.HTTPClient
requires a string, but after the changes commited above,
the tuple is returned and causes the parameter mismatch.

Searched all related potential errors and found only this one. Will fix this on kilo release.

Change-Id: I3afef5ceee57b0c1aeb57696c7f73262f3bf16f1
Closes-Bug: 1407567
2015-01-05 07:43:35 +08:00
Terry Yao c780569e8c add pool name while register notification listener
oslo.messaging is exposing a new API allow creating listener by
supplying a pool name, then the listeners with that pool name will use
the queue name as the pool name, multiple listeners can be listening
with the same topic.

Change-Id: I220d50fad8cda6f6f50f31215a7a6b98523c35dc
Closes-Bug: #1388663
2014-11-06 16:39:36 +08:00
Jerry Cai 368e8f71a1 Merge the get_available_resource() and get_host_stat()
For better report the host status, I would like to merge the code
for get_host_stats() and get_available_resource(). As most of them
are similar, merge together to easily manage the code.

Change-Id: I1900da06576d2f066c6154306f77f7c721e64cdf
Closes-bug: 1387089
2014-10-31 10:15:40 +08:00
Jerry Cai 40e90593e3 Add nova CLI extension for host maintenance mode status query/evaucation
Add a nova cli "nova host-maintenance" to query and enable/disable
the host maintenance mode for a specified host.

For detail usage, please refer to: "nova help host-maintenance".

Change-Id: Ibc3f92521546a82672b1619f7b65416909d92dfc
Closes-Bug: 1386026
2014-10-27 15:24:28 +08:00
terryyao 7b84b07f0b move to use oslo.i18/utils/serialization
nova is switching to use oslo.i18n, oslo.utils, oslo.serialization with
change
d0e0ade702
nova.openstack.common removed some modules that has been replaced by the
ones from oslo.i18n, oslo.utils, oslo.serialization.

Closes-Bug: #1384039
Change-Id: I9fae9b61599a50b54fc40552b2c90fceb75d8522
2014-10-23 00:07:25 +08:00
Jenkins d3d8da98b3 Merge "fix neutron-powervc debug utility issue" 2014-10-13 05:01:17 +00:00
Eric_Zhao 4b7e6302fd Image updated failed during periodic sync
Image updated failed when the glance-powervc did the periodic
sync , it is because of the code changes of the component 
glanceclient in the openstack community.

Change-Id: I149faeb1631c0f996ff529325eb8a71d9d92efc0
Closes-Bug: #1379637
2014-10-10 13:47:50 +08:00
Terry Yao bcc67e4186 fix neutron-powervc debug utility issue
Fix the issue that neutron-powervc debug utility needs a conf file and
also remove other powervc python program needs to add config files
during startup, set the default configure file for ampq files if those
are not presented in CLI.

Closes-Bug: #1375618
Change-Id: Idfc1a43a5e583678106b8d1cbed2738c1863254c
2014-09-30 15:39:11 +08:00
Terry Yao d82a609c65 Remove the log.isEnabledFor check as neutron log is not support yet
Remove the log.isEnabledFor in message.py as neutron does not sync the
oslo-incubate as nova's level, there is no isEnabledFor at this time in
neutron openstack.common.log.

Closes-Bug: #1373416
Change-Id: I1abda8017f55785e807d20dfa4d574c0a7016f60
2014-09-24 21:26:45 +08:00
Jenkins ab21eb0a57 Merge "Add an extra property for selecting SCG / Storage Template" 2014-09-24 09:26:30 +00:00
Jenkins b1b733cdc0 Merge "Add Host Maintenance Mode Get and evacuation support" 2014-09-24 09:26:08 +00:00
Eric_Zhao 187efa1bbb Add an extra property for selecting SCG / Storage Template
In order to select an SCG / Storage Template , we add an extra
 propertity to image properties , UI could use this data to format
the data for user to select the specific SCG / Storage Template ,
and also, other components which consumes PowerVC images in
Openstack can also leverage this.

Change-Id: I4b9dba719dada3823dc159748d15a3266ca9efa3
Closes-Bug: #1362904
2014-09-23 23:40:24 +08:00
Jerry Cai 3b9f42bf53 Add Host Maintenance Mode Get and evacuation support
To support GET the "host maintenance mode" from PowerVC by
PowerVC Driver, and evacuation all host out of the maintenance
entered host by PowerVC Driver. The design finally goes to Implement a
new nova rest-API for Get/Set maintenance status, and evacuate
vm during maintenance.

Change-Id: I9fba6b47e143ae8ea2165573302448fcdc61406f
Closes-Bug: 1372730
2014-09-23 14:06:12 +08:00
Le Tian Ren ef4147a170 Need compare indexes when extract amqp conf files
* swap the indexes if argv1_index is bigger than argv2_index

Change-Id: Id93ef544c4a4280587edce3fb2d70e254ee2b860
Closes-Bug: 1371504
2014-09-19 17:36:40 +08:00
Terry Yao 2b714e12e5 fix the glance client not refresh token issue
glance client is not refreshing the keystone token after expiration with
it's commit:
dbb242b776,
we need to patch this in our glance client to refresh the auth_token in
it's session head.

Closes-Bug: #1370402
Change-Id: I9c7a6620a587e855d7f9df8ad83450489daa8247
2014-09-17 17:09:23 +08:00
Le Tian Ren 0eefba3f77 Add support for multiple AMQP rpc backends
This is based on Oslo messaging API that supports RPC and notifications over a
number of different messsaging transports.

* remove old powervc.common.messaging and create a new one to adapt to Oslo
messaging

* adapt all sync service managers to new messaging model

Change-Id: I0c9b4a9fa5bb5d0eaac1433e768a110871d8dab8
Closes-Bug: 1363618
2014-09-16 17:53:08 +08:00
Le Tian Ren 05a8443e12 New config strategy to adapt to oslo-messaging
* Extract and remove --config-file amqp_openstack.conf(or
  amqp-openstack-neutron and --config-file amqp-powervc.conf from sys.argv to
  create 2 AMQP cfg.ConfigOpts objects without conflicting with other options
  parsing as before, particularly those OpenStack AMQP configurations in
  [DEFAULT] section of nova.conf, cinder.conf.

* adapt all affected code to the new config strategy

Implements: blueprint
https://blueprints.launchpad.net/powervc-driver/+spec/new-configuration-strategy-needed-to-adapt-to-oslo-messaging

Closes-Bug: 1356225
Change-Id: I61a4fd0c28148e31a8cb85acea3793f40028dfb4
2014-09-16 17:53:07 +08:00
Eric_Zhao 5e0cd86117 Fix issue for glance image sync failed
Because of the code change of glanceclient , the component of glance-
powervc could not do the image sync sucessfully.

Change-Id: If0b31e20ec645478584c2dc08ad0aa48bb8db392
Closes-Bug: #1369817
2014-09-16 14:52:51 +08:00
Jenkins 33e09d2496 Merge "Add host maintenance mode support for PowerVC Driver" 2014-09-11 03:34:58 +00:00
Jerry Cai 1c7474486f Add host maintenance mode support for PowerVC Driver
As a cloud admin, it is able to set the host managed by PowerVC to
"maintenance mode" and disable the "maintenance mode" support, through
PowerVC Driver.
1. If set maintenance mode to "true" it responses: "on_maintenance"
2. If set maintenance mode to "false" it responses: "off_maintenance"
3. If set maintenance mode to "true" when the host is already in
maintenance mode, it will report the error message from PowerVC to user.

Change-Id: I59ef830244202a4337ad72292e6341406b8464d3
Closes-Bug: #1363912
2014-09-02 11:06:30 +08:00
Le Tian Ren 52947efccd Timing issue in remote-keystone deployment model
This is actually timing issue between openstack service endpoints becoming
active and powervc-driver's client initialization of those.

1. get_client() call with version_filter might runs into the 'None' client
error mentioned in the bug, which means *currently* only glance sync is
affected. When no version filtered, we do a rediscover for the svc_type.

2. get_client() call without version_filter or new_client() call just choose
the latest avaiable version service, so no 'None' client error, although the
chosen version might not be the real *latest* but the default hardcoded 'v1'
version, due to the timing issue mentioned in the bug. For the latter case,
unless there is an observation/notification mechanism or poll mechanism for
service versions update, based on current design, there is no perfect solution
as far as I can imagine.

Change-Id: I9ca0f906c8954ecd621be22445c12fd6a55a1ae7
Closes-Bug: 1358215
2014-09-01 13:54:48 +08:00
Eric_Zhao e48e36567f Change patched glance client to fit glance-client code change
In Juno Release , "python-glanceclient" component changes code in the
 dir "glanceclient/common" to replace the old http client implementation
 in favor of a new one based on python-request. This leads to glance
driver image sync failed because of lack of http client attributes and
using the method that has never been in new httpclient.

Change-Id: I06419f792e949fed353277851f9f0f67ba38729d
Closes-Bug: #1349651

(cherry-picked from 20152f86f9)

Change-Id: I9c7f80b9f5849ac5d9d5f4b20d0ddd62074f2bfd
2014-08-27 15:51:15 +08:00
Eric_Zhao 5de8b9d735 Fix flake8 checking issue in powervc-driver and Unittest
There are some flake8 issues in each component that are not based
 on coding style rules .
And There are some unittest issues in some component that need to
 be fixed

Change-Id: Ic9a3f2c3b779ced225a42f69a495a606cb62517e
Closes-Bug: #1350160
2014-08-24 23:14:44 -04:00
Zhao_Jian 001d845aa1 Revert "Change patched glance client to fit glance-client code change"
This reverts commit 20152f86f9.

Change-Id: Idd5bce85e39f213cc27bbb35a028df24d84840c9
2014-08-04 16:48:12 +08:00
Eric_Zhao 20152f86f9 Change patched glance client to fit glance-client code change
In Juno Release , "python-glanceclient" component changes code in the
 dir "glanceclient/common" to replace the old http client implementation
 in favor of a new one based on python-request. This leads to glance
driver image sync failed because of lack of http client attributes and
using the method that has never been in new httpclient.

Change-Id: I06419f792e949fed353277851f9f0f67ba38729d
Closes-Bug: #1349651
2014-07-29 02:46:20 -04:00
yinym f1fa4ba5ea Fix message listening issue in common component
Current message listening thread will die when it received unsupported
message format (e.g. application/json). The issue will cause remote qpid
broker backup all messages for this listener forever. When such backlog
comes to a limit, qpid broker will refuse to put through new messages.

Fix changes this behavior with following changes:
1. Add logic to parse application/json format messages.
2. Add extra path to ignore unsupported message format
3. Catch unexpected exceptions in listener loop to avoid unexpected
listener termination.

Change-Id: I666c596f5725df25b548d82c733aa853fce7147c
Closes-Bug: #1349227
2014-07-28 14:05:20 +08:00
yinym 8f6cb9fd23 Fix flake8 warning and error report
All the flake8 issues have been resolved with this commit.

Change-Id: I637f82c484b3dbecc4827731a13f79c2ba2b9240
Closes-Bug: #1346759
2014-07-22 14:35:24 +08:00
Jenkins c55bff26f0 Merge "Add retry logic while initializing local keystone client" 2014-07-08 02:16:01 +00:00
Lin Cai 1881aba31b Change to use projects instead of tenants for keystone V3
In keystone V3 client, the tenants attribute is replaced by projects.
Change the driver's usage to use this new attribute and be compatiable
with the V2 keystone at the same time.

Change-Id: Idf5c76d6dcdf866047b6b4ceb803149f6fbcfd8c
2014-07-07 13:21:00 +08:00
terryyao 24da1b38af Add retry logic while initializing local keystone client
PowerVC driver will authenticate hosting openstack's keystone, and we
need to add some retry logic while creating the keystone client for the
hosting openstack. 

Closes-bug: #1334508
Change-Id: Iae5936d1fdd75494ed8ec0057d8480c9626ed591
2014-06-26 13:53:41 +08:00
terryyao e91f6dffc5 Fix the multiple regions issue in common client
We need to supply the region_name while creating the various openstack
clients in the common client code, then the client will work well with
the multiple regions.

Closes-Bug: #1323172
Change-Id: Idb30739b84d3813dd970f735b5789c564eb0759d
2014-05-26 16:52:55 +08:00
Le Tian Ren bb7da09624 Fix copyright headline in the source files
Change-Id: Ie1b0dac8a8ec1e6d02217fe03159c78a69f6dc5d
Closes-Bug: #1317657
2014-05-09 13:05:20 +08:00
Le Tian Ren 5e1c266859 Initial code base commit.
Change-Id: Id1e336028fa662ddee865841ac7b6c31a316f854
Closes-Bug: #1317383
2014-05-08 22:00:29 +08:00