Commit Graph

89 Commits

Author SHA1 Message Date
Arun Mani 6c2a535a22 Fix flavorsync issue during nova-powervc startup
During nova-powervc service startup, if the flavor sync
fails for some reasons, the code is blowing up causing
the service to get restarted abruptly. This fix is
to handle the same.

Change-Id: I3ce98153d0d3c0e184fd5ae44d7f0e54c19cebe2
Closes-Bug: #1819873
Signed-off-by: Arun Mani <arun.mani@in.ibm.com>
2019-03-13 05:58:19 -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
Zuo ZongMing 0f39087e97 Fixed neutron misspelling
Change-Id: Ic5440bb86448b5846e70f4dd802c6ed384773b05
2017-12-15 11:10:53 +08:00
arunmani b04397a642 Test review bug fix
Closes-Bug: #1671156

Change-Id: Icf43b6a34a48405666edda2451e45adb79057c71
2017-03-10 03:49:26 -05: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 e5babcc287 sync driver problem for 1.3.x
sync driver problem for 1.3.x 

Closes-bug: #1647588
Change-Id: I93c8e808d8ab7f542bf9d1ac9517ebb6e804aafc
2016-12-06 16:32:52 +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 444dfcca9a boot instance with server name case insensitive
boot instance with server name case insensitive, it should use
display_name which is case sensitive rather than hostname.

Change-Id: I742d83236ea3268fc64629e48c08f02562c7b11a
Closes-Bug: #1628404
2016-09-28 16:18:41 +08:00
Jerry Cai 90586b97e2 Remove setting first scg id to boot parameter
Remove setting first scg id to boot parameter, 
or this will fail in mult-scg environment.

Change-Id: I4e7349a2f5b6cbb6f59b629841442c9b8efe2fe4
Closes-Bug: #1608395
2016-08-01 15:14:25 +08:00
Jerry Cai 0ae7803b61 Change default spawn defer placement to True
By default we use the host and available zone that ICM chooses, now I
will change it to the design that "Ignore the host that ICM selected,
defer it to powervc scheduler".

Change-Id: Ieaa53ebc425452ac5bad73441a32862373e456b9
Closes-Bug: #1538452
2016-01-27 17:22:20 +08:00
Jerry Cai 6478bd1764 Git configuration verify for moving stackforge to openstack repository
This is a test checkin to verify git process success that move the
repository from stackforge to openstack.

Change-Id: Ie79f79ce6428c517f20d8602ef8d1016ea9796fa
Closes-Bug: #1507455
2015-10-19 14:06:30 +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 d0be0b27d7 List all resources across different service
List all resources across different service by adding "all-tenant"
when call restAPI

Change-Id: Ie29e0bac6fa4c3fe4b771489a722b6712edc3a28
Closes-Bug: #1496781
2015-09-17 18:05:06 +08:00
Jerry Cai 276880ece8 Catch quota reserve exception to avoid function break
Catch quota reserve exception to avoid function break,
and catch get_info() excption to avoid startup break.

Change-Id: If2f8f535caeef81264f323df73927f0cfb4ecfb2
Closes-bug: #1493726
2015-09-09 17:38:59 +08:00
Jerry Cai 50d97fd983 quotas are not updated from powervc side
quotas are not updated when the volumes/instances are synced from
powervc side, this fix help to sync the quota during sync resources
from powervc side, increase quota when insert to local resource,
deduct quota when delete local resources.

Change-Id: Ic5a77e7d154b247d253db19d59ee66a7aa473995
Closes-Bug: 1493232
2015-09-09 11:14:28 +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
Jerry Cai d96ff4ab09 [Fix]Quotas are not properly updated initially for on-boarded...
fix a problem for previous check-in

Change-Id: I06c6f173618ccc5de3601aff0ca4b4f7b3a9e784
Closes-Bug: #1472923
2015-07-09 15:15:36 +08:00
Jerry Cai cffe6e26ba Quotas are not properly updated initially for on-boarded VMs from PowerVC
Quotas are not properly updated initially for on-boarded VMs from PowerVC,
when using powervc driver, need to commit quota after insert a pvc instance
when sync from powervc side.

Change-Id: I29916631129f9c3c1bb25b7fda947668328c57fd
Closes-Bug: #1472845
2015-07-09 10:49:32 +08:00
Jerry Cai b8cc4d3065 Fix neutron V2 No valid authentication is available problem
neutron v2 client need admin context, or it will cause the failure

Change-Id: I3a7d1eee60dd513756755f1da29c131e543cebb0
Closes-Bug: #1469625
2015-06-29 16:03:43 +08:00
Jerry Cai 6d39c193f7 instance flavor need to map to 'cpus' instead of 'vcpus'
instance flavor need to map to 'cpus' instead of 'vcpus'

Change-Id: I4fa60bf77979fbf995a278ff1d4ad883637a3254
Closes-Bug: #1464960
2015-06-15 14:12:57 +08:00
Jerry Cai 73362092e6 Update nova driver due to API changed
Update nova driver due to API changed

Change-Id: I661ce2fcb8915634aae4af69b04ee59a10507c33
Closes-Bug: #1460934
2015-06-02 14:41:08 +08:00
Jerry Cai 8825cfb4db Block device mapping object mismatches with the latest community API
Block device mapping object mismatches with the latest community API,
which causes the sync problem.

Change-Id: I1e5059b1fb6f98e73b5fabbeb839a3281f8f29b5
Closes-Bug: #1455331
2015-05-15 14:29:02 +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 6e2e506a7e Tempest failed due to openstack interface changed
Tempest failed due to openstack interface changed, fix it as replace all
unused driver method parameters with "*args, **kwargs"

Change-Id: I25c7e0f0eee7c8d16ac4de4e5918fa690544e33c
Closes-Bugs: #1451717
2015-05-05 17:05:40 +08:00
Jerry Cai 9708bca3fb vm update failed due to nova api removed
vm update failed due to nova api removed, need to use
instance object API instead

Change-Id: I5bdac5ec6b6af3340d3af3aff0cd4ae4859bd442
Closes-Bug: #1451131
2015-05-03 13:17:15 +08:00
Jerry Cai 1baeb54222 Instance object convertion breaks the driver sync up function
The way of get flavor is change to get it from instance object,
need to update code to meet this change or driver sync up code
will fail. Also fix some other problem.

Change-Id: I8e79d7859b79e9d9736a1ba3c25ca56752cae6f8
Closes-Bug: #1432947
2015-03-17 14:09:37 +08:00
Jerry Cai 7777699e4a Fix powervc driver according to community code change
This defect is to fix for powervc driver according to community
code change.

Change-Id: If0c069cf53f9718e48a4b2f24a97380281a15422
Closes-Bug: #1431173
2015-03-12 15:38:18 +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
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
terryyao a717ce4cec Remove configuration_data from instance.system_metadata before save
For Activation Engine, instance would have a configuration_data in its
system metadata, powervc driver does not need this and before save nova
instance, we need to remove this system metdata. Otherwise db will not
throw exception.

Closes-Bug: #1410649
Change-Id: I3fef4ae8c2d99dc103164fa346a2424185e773f5
2015-01-26 14:58:34 +08:00
Jerry Cai b06a892915 Failed to sync nova-powervc as kilo source codes change
Provides some fixes for kilo nova base code changed.

Change-Id: I2b7da3b688e88084939f10cf060c2b7ecc5e0a55
Closes-Bug:1408888
2015-01-12 14:45:34 +08:00
Jenkins 608276af70 Merge "Spawn() method signature mismatches with latest kilo release codes" 2014-12-24 02:50:08 +00:00
Jenkins d278ca1de4 Merge "Fail to snapshot PowerVC image" 2014-12-23 01:03:58 +00:00
Jerry Cai 589178f739 Fail to snapshot PowerVC image
When powervc driver found there is no or deleted image associated
during sync instances, it will set a default image which causes
exploiter crash, this patch will keep original image_ref when no
related image found.

Change-Id: I191d31cfdecaedd22b449728be732ca54057c5f9
Closes-Bug: 1404777
2014-12-22 16:37:32 +08:00
Jerry Cai 1d990b80ee Spawn() method signature mismatches with latest kilo release codes
Consider after a while this "instance_type" has been changed to "flavor",
and we never use them, to avoid frequently update the powervc-driver
signature, append "**kwargs" to spawn() method.

Change-Id: I44c664c4e1650955e1eaa1f619223c00ade6f999
Closes-Bug: 1403378
2014-12-17 16:06:17 +08:00
terryyao 9b9d3d05a7 Complete volume attachment until volume become to 'in-use'
1. Move the wait volume state logic from nova to cinder
2. Wait volume state to be "in-use", then complete volume attachment
3. Change volume sync code to not sync "attaching" or "detaching" state
as if sync code change such state, then volume attach/detach will be
broken



Closes-Bug: #1402467
Change-Id: I3640afe9ad4aba8788a932d05e94f55a3b8d6333
2014-12-15 09:45:29 +08:00
terryyao 3699879307 fix pep8 and UT issue
fix latest pep8 and UT issues

Change-Id: I9a3b7f55ec68a9944eb7513fca4c7f521642e49e
2014-12-08 10:52:56 +08:00
terryyao e506e9a9b4 Clear pvc_id during instance spawn failing
1. In powevc nova driver, it's better to use instance.save() instead of
db call

2. clear pvc_id after destory the powervc instance.

3. override pvc_id regardless powervc instance's metadata pvc_id.

Closes-Bug: #1395731
Change-Id: I2bb2494a8a2976064494101af811f6be22379472
2014-11-24 23:02:33 +08:00
Terry Yao 5a255d5d95 fix pep8 issue on powervc driver
Fix some pep8 issue introduced in recent code change

Closes-Bug: #1393663
Change-Id: I6f18600d000725122f6c6cc4f27ca0b37c2037f4
2014-11-18 14:12:02 +08:00
Yi Ming Yin 3fbb8abd9a Add unittest for detach interface with no local port id case
1. Fix the previous unittest issue
2. Add test case to check no local port id found

Change-Id: I95674b45a6db64359a1d8a47bfc5aa367ab8594d
(cherry picked from commit 2919c4ef28)
2014-11-18 05:47:23 +00:00
terryyao 4c72a1fdba Fix infinite loop wait for live-migration completion
PowerVC will set VM state to "Active" if the live migration failed as
the source host or dest host is running live migration. With our current
code, we are looping wait for the migration to be completed until the
powervc instance's host has been changed. That's definitely wrong..

Closes-Bug: #1393663
Change-Id: Ifb826bafa692b51f3d5997d427e10fbe17a21ca6
2014-11-18 13:31:14 +08:00
terryyao 51e72085fa Avoid to create deleted instances during sync
If the powervc instance is removed from driver's call or powervc side,
there will be a timing issue between the sync call and driver call, the
sync call still list the powervc instance before it insert the local
record. Add a global list to keep the removed powervc instance ids, and
avoid to create such local instance if the powervc instance has already
been deleted.

Closes-Bug: #13918752
Change-Id: If1e7993f4ae1517577c909fb71134ba50c88083f
2014-11-17 20:51:50 +08:00
Yi Ming Yin 7fc7fc17e9 Add extra logic to handle port detach issue
nova manager will first delete local neutron port before call driver to
detach port on PowerVC. This behavior will trigger a local port deleted
event and cause current driver code failed to retrieve remote PowerVC
port id when doing interface detach

1. First priority is to use local port id to retrieve remote PowerVC
port id, which is the current logic.
2. If local port id cannot be retrieved, it will call interface_list on
remote PowerVC instance and get all attached interface information. Then
the code will scan all the local port IP addresses and compare to remote
IP addresses and find the matched port id to detach.

Change-Id: I3a87f3780c2cb949a0dc80380a37ab17bb98e059
Closes-Bug: #1392540
(cherry picked from commit 8c766d0861)
2014-11-16 04:21:25 +00:00
terryyao 7a82ac4a32 Fix the issue for two instances sometimes after booting vm
1. Add debug logs to sync code
2. fix an issue found the new added instance scg_id is None, there will
be an AttributeError thrown. 

Closes-Bug: #1391875
Change-Id: Idaa6ec9982e915d8fec0e2e6d32d5bb5e49a674f
2014-11-13 13:33:32 +08:00
Jenkins 041b1987fc Merge "Add debug info for deploy/delete/resize" 2014-11-10 08:27:45 +00:00
Zhao_Jian 13085fefd5 Add debug info for deploy/delete/resize
To make debug process conveniently , add more debug logs into
deploy/delete/resize methods , at the top of method and at the
end of the method , to make the process clearly , and print exception
stacktrace if necessary.

The log info should be like this :
1. Enter to $method instance of $instance_uuid
2. Exit to $method instance of $instance_uuid

Change-Id: I6678976c09ba923a0ada68a37a706642c18ed0f0
2014-11-10 16:19:54 +08:00
Jenkins 1d2ad25751 Merge "add pool name while register notification listener" 2014-11-06 09:07:43 +00: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
Jenkins 9a8157d7a5 Merge "nova boot failure while the vm state/task_state is set by sync code" 2014-11-04 01:45:18 +00:00
Jerry Cai 9492f9637e nova boot failure while the vm state/task_state is set by sync code
For spawning, it will loop to check the powervc vm instance status,
there will be a timing window that the VM because active, then the sync
is running here, but the driver's spawning is till sleeping, then after
this sync code run, nova framework will fail with above exception..

This sync code need to be retained there as the VM might stick with
build/spawning state like the nova-powervc is abnormal killed...,
the fix solution can be:
1. create a dict in sync code, and put such state instance id to
this dict,
2. in next sync sycle, check if the instance is still in build/spawning,
 but the powervc state is in acitve/none, then update status and remove
the id from the dict, this will delay the state updating in sync
process to avoid the time window that driver.spawning is sleeping
to poll the powervc instance state.

Change-Id: I7fe9f5f2b48c9758bc102ebf209d631c0308a316
Closes-Bug: 1388683
2014-11-04 09:22:20 +08:00