Commit Graph

196 Commits

Author SHA1 Message Date
OpenDev Sysadmins da3272f8b5 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:36:34 +00:00
Ian Wienand 280696b020 Replace openstack.org git:// URLs with https://
This is a mechanically generated change to replace openstack.org
git:// URLs with https:// equivalents.

This is in aid of a planned future move of the git hosting
infrastructure to a self-hosted instance of gitea (https://gitea.io),
which does not support the git wire protocol at this stage.

This update should result in no functional change.

For more information see the thread at

 http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003825.html

Change-Id: I74e78bc8a7c9ad8c0c41b6693bd642f182214ca6
2019-03-24 20:34:11 +00:00
Nguyen Hai 0202624dc3 import zuul job settings from project-config
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.

Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.

Because this patch is generated by a script, there may be some
cosmetic changes to the layout of the YAML file(s) as the contents are
normalized.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I0d7b94ec4aa23791dc48d6e92507364a4897a57a
Story: #2002586
Task: #24310
2018-08-17 19:21:27 +09:00
Zuul 725094c632 Merge "Updated from global requirements" into stable/pike 2017-11-20 07:25:34 +00:00
OpenStack Proposal Bot 1750c3c073 Updated from global requirements
Change-Id: I2903653a13313b0eee7ba30705a453064b1e4991
2017-11-15 01:37:42 +00:00
Sampath Priyankara f8354d8a45 Add upper-constraints stable/pike to test requirements
Normally, OpenStack Release Bot propose this change [1].
However, masakari did not get that proposal. This is maybe,
when pike released, masakari was not an official project.
This patch propose stable/pike cap for upper-constraints.txt

[1] https://review.openstack.org/#/c/492981/

Needed-By: I2903653a13313b0eee7ba30705a453064b1e4991
Change-Id: Ifc30770a20e819c531d5e85ff3bc8e9be088166d
2017-11-14 19:35:31 +09:00
Jenkins 93556d3116 Merge "Make 'error' instances recovery configurable" 2017-08-17 06:08:52 +00:00
Dinesh Bhor a67e0c5038 Make 'error' instances recovery configurable
Currently on master error instances are evacuated from failed
compute host and stopped at the destination host after evacuation.
Some operators may not want to evacuate error instances in some
cases like below:
If user is running 1ACT/n SBY application on instances, launching
error instances will cause unexpected effect.

This patch adds a new config option 'ignore_instances_in_error_state'
under [host_failure] section which makes the recovery of error
instances configurable. If this config option set to True, masakari
will skip the recovery of error instances otherwise it will evacuate
error instances from a failed source compute node along with other
instances. The default value for this config option is set to False.

Change-Id: I24f8282357f28544fd1b56f270da22c7329a9f3d
2017-08-17 10:24:52 +05:30
Jenkins f9d67962e7 Merge "Add missing domain name to novaclient" 2017-08-16 07:11:18 +00:00
Jenkins cba0222522 Merge "Update the documentation link for doc migration" 2017-08-16 07:05:10 +00:00
liyingjun 6139da28da Add missing domain name to novaclient
Domain name is needed when using keystone v3 to create keystoneauth
session[1], otherwise the following error will be raised:

InvalidInput: Invalid input received: Expecting to find domain in
project - the server could not comply with the request since it is
either malformed or otherwise incorrect

[1]: https://docs.openstack.org/keystoneauth/latest/authentication-plugins.html#v3-identity-plugins

Change-Id: I557a7107b51ae4ffab15d045a4be6e3ed1940bd8
Closes-bug: #1710570
2017-08-16 14:34:09 +08:00
Jenkins 778cac30cd Merge "Make provision to evacuate all instances" 2017-08-14 05:19:24 +00:00
Jenkins 540887159b Merge "Fix 'host delete' delete's host of another segment" 2017-08-10 16:17:48 +00:00
dineshbhor 4173aaf039 Make provision to evacuate all instances
As of now host failure workflow was evacuating instances which were
having vm_state as active, stopped, error and resize. It was ignoring
other vm_states such as shelved, rescued, paused and suspended. Made
provision to evacuate instances which are having vm_states such as
shelved, rescued, paused and suspended by changing its vm_state to
error and after evacuating those instances will be stopped.

NOTE:
On master if the instance is in error or resized state then after
recovery it was becoming active. With this patch error instances
will be stopped and then set to error after recovery. For resized
instance if it's previous power_state is 4(SHUTDOWN) then we can
say that before failure the instance was is stopped state and then
it was resized so masakari will stop that instance to maintain
consistency of instance states as the instance was not fully
resized(resize operation was not confirmed). Resized instance which
was in active state before failure will become active again after
recovery.

Closes-Bug: #1693731
Closes-Bug: #1692435
Closes-Bug: #1690995
Closes-Bug: #1690768
Change-Id: I134e8b6ee7315935bd8ce418ef6241be0b9450b3
2017-08-08 16:51:25 +05:30
Jenkins 4ce94ec6ed Merge "Enable global hacking checks and remove local checks" 2017-08-08 00:15:02 +00:00
Dinesh Bhor 66c607c6e8 Enable global hacking checks and remove local checks
In newer hacking version 0.12.0 [1], we can enable some of the
non-default hacking rules (one by one), which are disabled by
default. The enabled rules are the following:

* [H106] Don’t put vim configuration in source files (off by default).
* [H203] Use assertIs(Not)None to check for None (off by default).
* [H904] Delay string interpolations at logging calls (off by default).

Enabled these hacking rules by adding them in the list of
'enable-extensions' in tox.ini [flake8] section. Removed the local
implementation of those hacking rules from hacking/checks.py.

The test-requirements.txt is already updated to use the newer
hacking version 0.12.0 with this commit:
cc44a33f3d

[1] See "Enabling off-by-default checks" section:
    https://pypi.python.org/pypi/hacking/0.12.0

Change-Id: Ieccd5a84ebd80ba3313016c9caeb036eaa37769b
2017-08-04 04:55:18 +00:00
Dinesh Bhor a1bbcd4d98 Fix 'host delete' delete's host of another segment
Currently masakari delete's the host which doesn't belong to the
segment requested in the 'host delete' API's request URL because
host was not getting filtered on the basis of failover_segment_id.

Filtered the host based on 'failover_segment_id'. Added a new
exception 'HostNotFoundUnderFailoverSegment' which will be raised
from db API 'host_get_by_uuid' if the host is not found under the
requested failover_segment. This exception is not caught at API
controller layer as it is a subclass of 'HostNotFound' which is
already caught in controller.

Closes-Bug: #1697629
Change-Id: I3d3e8cffa2f8ea443ccd13b1db61fda55bc07a0d
2017-08-01 12:28:56 +05:30
Jenkins 237bee37f8 Merge "conf: Deprecate 'masakari_topic' RPC options" 2017-07-27 09:48:51 +00:00
Dinesh Bhor 62128ecf4b conf: Deprecate 'masakari_topic' RPC options
Giving provision to operators to configure RPC topic for
masakari-engine service can lead to some errors pointed by the
bug: 1643834. So there is no need to let operators choose the RPC
topic for engine service. It's best to deprecate and remove this
option as it's really easy to break masakari by using this option,
and there is little gain for deployers in changing this option.

Change-Id: Ie8e55762201cbf69f90838217098860ded51a307
2017-07-27 09:59:52 +05:30
Dinesh Bhor 5d34fb847e Send global_request_id to nova when calls are made
This patch adds the global_request_id to the constructor for nova
client, which will pass the global_request_id into nova services
on all API calls. Supporting global_request_id makes debugging [1]
easier when request touches many services in cloud. The masakari
request-id will be sent to nova in the request header like below and
it will be available with context.global_id:

-H "X-OpenStack-Request-ID: req-1a9b7b24-02ed-4400-bcc3-cc1bcbb59147"

Masakari is already using newer python-novacliant which supports
global_request_id [2].

This patch also fixes the below debug log message which gets emitted
when any argument gets dropped while creating request context:

"Arguments dropped when creating context: {u'global_request_id': None}"

As decided earlier while fixing the issue [3] this patch adds the
'global_request_id' to the base RequestContext hence removes the
earlier debug log message.

[1] I65de8261746b25d45e105394f4eeb95b9cb3bd42
[2] I5b247f75edeea9da50fe524eadf5f9a2c626d665
[3] d4dd11d7bd

Change-Id: I2139976f6774b10518c7455a9af1b32b1e7b3e7d
2017-07-27 09:53:25 +05:30
Jenkins 3dfa413f00 Merge "Remove unused methods" 2017-07-26 05:59:36 +00:00
Hangdong Zhang 5ef40b8a8f Update the documentation link for doc migration
Change-Id: If3ea8caadd5923e6222ce292a8dc0bf2561435b4
2017-07-24 16:34:45 +08:00
Dinesh Bhor 212d254da1 Remove 'on_shared_storage' parameter from nova evacuate
Starting since version 2.14, Nova automatically detects whether the
server data is on shared storage or not.

Removed 'on_shared_storage' parameter from nova evacuate call and
bumped nova api version from 2.9 to 2.14 so that shared storage
deployment can be detected by nova. Also added a related note in
README.rst to point out. Operators should configure shared storage
to use maskari otherwise instance data will be lost after evacuation.

Change-Id: I0b0581a5c84143fc91c9fc6e2c440096013c7438
2017-07-21 05:44:49 +00:00
Dinesh Bhor d69cea4975 Remove unused methods
Removed following methods as these methods are not called from anywhere
in the entire code:

 * is_user_context
 * require_admin_context
 * require_context
 * authorize_project_context
 * authorize_user_context

'is_user_context' method [1] was getting used to check whether the
requested context is of normal user or not. Masakari doesn't allow
normal user to call any API so the code was unreachable. Moreover
masakari don't have any sqlalchemy model having 'project_id' as it's
attribute. So it is safe to remove this code.

[1] https://github.com/openstack/masakari/blob/master/masakari/db/sqlalchemy/api.py#L131-L136

Change-Id: I60f68cbdd80dbce9d3ea95441cf1926ebec1cc8c
2017-07-19 04:50:15 +00:00
Vu Cong Tuan b26ba43f72 Remove support for py34
The gating on python 3.4 is restricted to <= Mitaka. This is due to
the change from Ubuntu Trusty to Xenial, where only python3.5 is
available. There is no need to continue to keep these settings.

Change-Id: Ieecf7342152cc813ec3585a3b1873ac0dc13d804
2017-07-11 15:33:14 +07:00
Jenkins 1ad9c148cd Merge "Use os-testr instead of testr" 2017-07-10 06:56:14 +00:00
Dinesh Bhor d4f982449e Use os-testr instead of testr
Masakari should use ostestr instead of testr. ostestr is more
powerful and provide much prettier output than testr. Other
projects like cinder, nova, glance, neutron etc already uses
the ostestr wrapper.

Using ostestr shows each tests execution separately because of
which it has shown errors related to "KeyError" in existing test
cases. The error looks like below:

"Exception in string format operation: KeyError: u'id'"

This happens if we don't pass keyword argument like "id" to
exception which we expect to be raised from test through
side_effect [1]. This doesn't lead to test failure but it
appears in test logs. This patch fixes such issues by passing
expected keyword arguments to exceptions.

[1] https://github.com/openstack/masakari/blob/master/masakari/tests/unit/api/openstack/ha/test_hosts.py#L364
Change-Id: I91603ea3dcf35fd20a00dcf477b93d612edca362
2017-07-05 17:37:52 +05:30
pooja jadhav 3076b10202 Enable code coverage report in console output
Modified tox configuration to enable code coverage
report in console output.

Change-Id: I64684f312612681552b511962a3366d832880106
2017-07-04 14:22:51 +05:30
Jenkins 166abca802 Merge "Fix race condition between evacuation and its confirmation" 2017-06-23 10:21:37 +00:00
dineshbhor 25d33d2cb1 Fix race condition between evacuation and its confirmation
Masakari can face a race condition where after evacuation of an
instance to other host user might perform some actions on that
instance which gives wrong instance vm_state to ConfirmEvacuationTask
that results into notification failure.

To fix this issue this patch proposes to lock the instance before
evacuation till its confirmation so that any normal user will not
be able to perform any actions on it. To achieve this the
ConfirmEvacuationTask is completly removed and the confirmation is
done in the EvacuateInstancesTask itself by per instance.
Evacuating an instance and confirming it's evacuation immediately
can reduce the performance so this patch uses the
eventlet.greenpool.GreenPool which executes the complete evacuation
and confirmation of an instance in a separate thread.
To check if the server is already locked or not upgraded the
novaclient's NOVA_API_VERSION from 2.1 to 2.9  as the 'locked'
property is available in nova api_version 2.9 and above.

This patch introduces a new config option
'host_failure_recovery_threads' which will be the number of threads
to be used for evacuating and confirming the instances evacuation.
The default value for this config option is 3.

Closes-Bug: #1693728
Change-Id: Ib5145878633fd424bca5bcbd5cfed13d20362f94
2017-06-23 13:08:03 +05:30
Jenkins ca1e4bd021 Merge "Fix identity_admin" 2017-06-22 05:36:27 +00:00
Jenkins 0b94c2d46a Merge "Updated from global requirements" 2017-06-21 07:28:22 +00:00
Jenkins 44553b5005 Merge "Exclude on maintenance reserved_hosts for host_failure recovery" 2017-06-21 07:25:57 +00:00
OpenStack Proposal Bot bf4d82bf99 Updated from global requirements
Change-Id: Ib61928aa9845060cc5c01960093d80051df547d8
2017-06-20 11:45:10 +00:00
Dinesh Bhor 81ed98101e Exclude on maintenance reserved_hosts for host_failure recovery
masakari-engine considers reserved_hosts which are under maintenance
for host failure recovery when recovery_method is reserved_host,
auto_priority or rh_priority and passes it to workflow for processing.

If the reserved_host is under maintenance then it should not be used
for evacuating the instances for host_failure recovery.

This patch excludes reserved_hosts which are on maintenance for
host_failure recovery by filtering host_list with
'on_maintenance'=False.

Closes-Bug: #1697902
Change-Id: Ie6beff110d03b67d6f5d8694603816c0db017660
2017-06-19 12:49:54 +05:30
Van Hung Pham 7edf071253 Optimize the link address
Update link address to ensure safety and preciseness

Change-Id: Iae7efd7e026dfe0b167154ca38cf9cc1e0b84cc0
2017-06-08 18:37:08 +07:00
Takahiro Izumi a61af823be Fix identity_admin
Remove the use of identity admin endpoint.

The following patch removed the use of identity admin endpoint from devstack.
Try to remove /identity_admin
https://review.openstack.org/#/c/458226/

So this patch removes the use of identity admin endpoint from masakari
in accordance with the above patch.

Change-Id: I809c6323b68a97095dc904c65627535083ad08cc
2017-06-06 17:24:13 +00:00
Jenkins 00969f0bf2 Merge "Revert "Fix os_privileged_user_auth_url"" 2017-06-06 05:08:01 +00:00
Rikimaru Honjo 171b4d271d Revert "Fix os_privileged_user_auth_url"
This reverts commit 0ce3811e02.

Change-Id: I12be4b3f33c6e49ccd62b242b4e5144b3684b3ab
2017-06-06 04:27:04 +00:00
Jenkins 1e5fab1edb Merge "Fix os_privileged_user_auth_url" 2017-06-06 04:22:53 +00:00
dineshbhor 2d4c349b16 Fix failing test cases
Patch: I334da33385b5d6a387824056a5ba6aa982759314 released a new
version of oslo.context which includes the change to add global
request_id to context: I1521188ae627fa2e7d35aa2ffffbcb620c527765.

This patch fixes the failing test cases by adding global_request_id
to context in tests assertion.

Reference to failing logs: http://logs.openstack.org/08/462108/6/check/gate-masakari-python27-ubuntu-xenial/210acc8/
Change-Id: I6e8fe2b3963f4ffdc751c241f03bd47d230f2a98
2017-05-29 10:28:25 +05:30
Takahiro Izumi 0ce3811e02 Fix os_privileged_user_auth_url
Fixed os_privileged_user_auth_url "PROTOCOL://HOST/identity_admin"
to "PROTOCOL://HOST/identity".
Current devstack keystone service endpoint url is "PROTOCOL://HOST/identity".
So this patch fixes it.

Change-Id: I2700d541b8c72806e814d10d229032fabde2b38e
2017-05-18 13:05:44 +00:00
Jenkins bfb4888f18 Merge "Ignore instance recovery for 'paused' or 'rescued' instance" 2017-04-25 12:18:14 +00:00
Jenkins af870cc72d Merge "Use DDT to reduce test code duplication" 2017-04-25 12:11:06 +00:00
dineshbhor 7aef2966f5 Ignore instance recovery for 'paused' or 'rescued' instance
If masakari receives instance failure notification it fails to
recover that instance if it is in 'paused' or 'rescued' state.
As a recovery action masakari-engine gives call to nova to stop
the instance but as nova doesn't allow this it returns 409 which
result into instance recovery failure and masakari marks that
notification status as "error".

This can be solved by maintaning consistency between the vm_state
before and after recovery but it requires to start the instance
again to gain the qemu process of an instance back alive which
might change the internal state of the instance which results into
inconsistency between instance state before and after recovery.
So as a solution this patch proposes to ignore the instance recovery
and logs a warning if the instance is in 'paused' or 'rescued' state.

Closes-Bug: #1663513
Change-Id: Id1cce45aad253527bedb58ab32f3d89637e02582
2017-04-20 12:02:12 +05:30
hussainchachuliya 72e6d5596b Use DDT to reduce test code duplication
DDT can ease up error tracing and auto generates tests on
basis of different input data.
Reduce test code data by using DDT for segments, hosts, and
notifications.

Co-author: Dinesh Bhor <dinesh.bhor@nttdata.com>
Change-Id: Ie3ce3316c6e2fc3f98df3a51db59ca7f1f1625b8
2017-04-19 16:27:44 +05:30
OpenStack Proposal Bot e24ceff47a Updated from global requirements
Change-Id: I5a8b676a4a636fb8c925da1a8a24d8185d9f6d5b
2017-04-12 04:13:53 +00:00
lcsong c9f7a3c56d Remove log translations
Log messages are no longer being translated. This removes all use of
the _LC, _LE, _LI and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I4c96f3590d46205c45d12ee4ead8c208e11c52c5
2017-04-05 08:11:09 +00:00
Jenkins 2525205c24 Merge "Implement auto_priority and rh_priority recovery_methods" 2017-04-04 18:30:21 +00:00
Dinesh Bhor 4861413682 Implement auto_priority and rh_priority recovery_methods
This patch adds support of 'auto_priority' and 'rh_priority'
recovery_methods in case of host failure recovery.

Instances will be recovered on the basis of recovery_method set
by operator for the respective failed_host's failover_segment.

Implements: blueprint implement-recovery-methods
Change-Id: Ib01ad624f5931f177e4e838494ea772449a35b70
2017-04-04 17:28:35 +05:30