Commit Graph

985 Commits

Author SHA1 Message Date
Andrea Rosa fa00292546 Abort an ongoing live migration
This change adds a DELETE call on the server-migrations object to cancel
a running live migration of a specific instance.
TO perform the cancellation the virtualization driver needs to support
it, in case that the feature is not supported we return an error.
We allow a cancellation of a migration only if the migration is
running at the moment of the request and if the migration type is equal
to 'live-migration'.
In this change we implement this feature for the libvirt driver.
When the cancellation of a live migration succeeded we rollback the live
migration and we set the state of the Migration object equals to
'cancelled'.
The implementation of this change is based on the work done by the
implementation of the feature called 'force live migration':
https://review.openstack.org/245921

DocImpact
ApiImpact

Implements blueprint: abort-live-migration
Change-Id: I1ff861e54997a069894b542bd764ac3ef1b3dbb2
2016-02-26 15:11:41 +00:00
ShaoHe Feng 98e4a64ad3 Add new APIs and deprecate old API for migrations
This patch does two things:
1. Add two APIs /servers/migrations:index/show for server migrations.
Two new novaclient commands server-migration-list and
server-migration-show will also be added.
ref: I071198fa9ba0699383bdebf4fab54714a435e6c3

2. Add ref link for /os-migrations
The old top-level resource `/os-migrations` won't be extended anymore.
It is deprecated.
Adding migration_type for it, also add ref link to
/servers/{uuid}/migrations/{id} for it when the migration is an
in progress migration.

Partially implements blueprint live-migration-progress-report

Change-Id: Ia92ecbe3c99082e3a34adf4fd29041b1a95ef21e
Co-authored-by: ShaoHe Feng <shaohe.feng@intel.com>
2016-02-26 14:25:48 +00:00
Jenkins 4a62ab8c8d Merge "Default "discoverable" policies to "@"" 2016-02-22 18:05:08 +00:00
Jenkins 8aa60ba501 Merge "Update example policy.json to remove "" policies" 2016-02-22 18:04:15 +00:00
Jenkins beb3a9dff5 Merge "Add /usr/local/{sbin,bin} to rootwrap exec_dirs" 2016-02-22 05:04:58 +00:00
Andrew Laski 014bb50c2b Default "discoverable" policies to "@"
The "os_compute_api:<extension>:discoverable" policies control whether
or not the extension is advertised as being available. By default they
should all be advertised so the policy should make it clear that it's
explicitly allowed.

Change-Id: I8aaeea571165f4052ecd6ad4348673e0f9a187ac
2016-02-18 10:21:34 -05:00
Andrew Laski 90b34f021a Update example policy.json to remove "" policies
A blank policy is equivalent to a policy that allows everything. In
practice this is probably not what you want, and there is no indication
that the policies were set this way for that reason, except for one
case. It appears to be a matter of copy/paste.

The exception is the policy check for default quota-sets. The default
quota set is not scoped to a project or user so checking for ownership
does not make sense. And since it is the same for every project there's
no reason to require an admin context in order to view it. So it's set
to "@" here to be visible to all.

The rest of the calls end up having ownership verified in the db api by
filtering on project_id, unless it's an admin context. So admin_or_owner
ends up being equivalent to what's in place, but verification happens at
the policy level which is where it should be checked.

Change-Id: I698c8aa54e90fc285a4a6e0a9105e8d1ccb90c8a
2016-02-17 17:27:39 -05:00
Angus Lees 1fed955fa4 Add /usr/local/{sbin,bin} to rootwrap exec_dirs
/usr/local/{sbin,bin} is a standardised location for admins to install
non-distro executables, and these executables are no less "trustworthy"
than /usr/bin and friends.  See neutron and cinder's rootwrap.conf (and
probably others), and typical distro default values for
sudoers/secure_path for extremely similar precedents that all include
/usr/local/*bin.

In particular, some sort of change like this is required for
oslo.privsep to find its "privsep-helper" executable in
devstack (installed into /usr/local/bin via pip).  The only open
question (imo) is whether this change is made here in nova (and any
other project that doesn't already have this), or rootwrap.conf is
modified in the same way at "deployment time" by devstack and other
deployment methods.  Doing it here means it is far more likely to "just
work" for the common case of installing at least one affected command
into /usr/local.

See I710cf142b834381c00e651cfc062299ae755c33f for some brief discussion
of doing this via devstack, and pointers to earlier neutron, etc
discussion.

Change-Id: I6a0a4b7f952193ce0f4ed2594613188854d36bf1
2016-02-15 14:08:24 +11:00
Davanum Srinivas 205fb7c8b3 Switch to oslo.cache lib
Common memorycache was replaced by analogous tool
from oslo.cache lib. In-memory cache was replaced
by oslo.cache.dict backend. Memcached was replaced
by dogpile.cache.memcached backend.

Implements blueprint oslo-for-mitaka

Closes-Bug: #1483322
Co-Authored-By: Sergey Nikitin <snikitin@mirantis.com>
Co-Authored-By: Pavel Kholkin <pkholkin@mirantis.com>

Change-Id: I371f7a68e6a6c1c4cd101f61b9ad96c15187a80e
2016-02-02 08:20:13 -05:00
Jenkins c74c305f34 Merge "Remove mm-ctl from network.filters" 2016-01-28 18:06:32 +00:00
jichenjc 69c9ed0229 relocate os_compute_api:servers:discoverable
move os_compute_api:servers:discoverable to other
policy defined position to make them easier
to be recognized and used by end user.

Change-Id: I5fc4b55418f187817e81343e9224b731f8eea5e2
2016-01-28 22:28:05 +08:00
Pawel Koniszewski 6c604a6891 Remove discoverable policy from server:migrations resource
Change-Id: If484da23a11ee0f7a71205b1008cc8da21df9fe7
2016-02-10 13:58:45 +01:00
Jenkins 137ddac8ef Merge "Add new API to force live migration to complete" 2016-02-10 12:54:48 +00:00
Jenkins fec55f21dc Merge "libvirt: Race condition leads to instance in error" 2016-02-10 09:15:58 +00:00
Pawel Koniszewski c9091d0871 Add new API to force live migration to complete
This change adds manual knob to force ongoing live migration to
complete. It is implemented as a new server-migrations API.

DocImpact
ApiImpact

Implements: blueprint pause-vm-during-live-migration
Change-Id: I034b4041414a797f65ede52db2963107f2ef7456
2016-02-08 08:59:52 +01:00
Ankit Agrawal ec9d5e375e libvirt: Race condition leads to instance in error
ImageCacheManager deletes base image while image backend is copying
image to the instance path leading instance to go in the error state.

Acquired lock before removing image from cache. If libvirt is copying
image to the instance path, image cache manager won't be able to remove
it until libvirt finishes copying image completely.

Closes-Bug: 1256838
Closes-Bug: 1470437
Co-Authored-By: Michael Still <mikal@stillhq.com>
Depends-On: I337ce28e2fc516c91bec61ca3639ebff0029ad49
Change-Id: I376cc951922c338669fdf3f83da83e0d3cea1532
2016-02-05 20:48:58 +00:00
Jenkins 526844dd3c Merge "Add mm-ctl to compute.filters" 2016-01-28 12:52:36 +00:00
Jenkins 833face153 Merge "Add a REST API to trigger crash dump in an instance." 2016-01-22 23:45:08 +00:00
Jenkins e466e610dd Merge "Libvirt: Support fp plug in vhostuser vif" 2016-01-22 11:20:16 +00:00
Tang Chen 30c6f49817 Add a REST API to trigger crash dump in an instance.
Change I9b649aafba011d537e3fe4eebef7a678ff6733e4 has added a
compute API to trigger crash dump in instance. This patch adds
the REST API to nova. It enables users to trigger crash dump in
an instance through REST API.

Change-Id: I6ed777ff637254b4b79417008f9055dd19fc7405
Implements: blueprint instance-crash-dump
Co-Authored-By: Hironori Shiina <shiina.hironori@jp.fujitsu.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
2016-01-20 09:42:50 +08:00
Tomi Juvonen 9345d5835f Add host_status attribute for servers/detail and servers/{server_id}
When a compute service fails, the power states of the hosted VMs are not
updated. A normal user querying his or her VMs does not get any indication
about the failure. Also there is no indication about maintenance.

This change will expose new attribute host_status to user querying his
VMs. Attribute is only seen if policy allows.

DocImpact: This adds API microversion
Implements blueprint get-valid-server-state
APIImpact

Change-Id: I5abea08bdc27624a7f23a7db8964f8c2a7b0eaa7
2016-01-16 20:07:49 +02:00
YAMAMOTO Takashi f5f8e8fd76 Remove mm-ctl from network.filters
MidoNet is not supported by nova-network.

Related-Bug: #1533473
Related-Bug: #1235132
Change-Id: I6e31c7051d941d2948913c5a9cf6e7bf431d67f5
2016-01-13 13:36:24 +09:00
YAMAMOTO Takashi eee50beaaf Add mm-ctl to compute.filters
It's used to plug/unplug VIF_TYPE_MIDONET vifs on compute nodes.

Closes-Bug: #1533473
Related-Bug: #1235132
Change-Id: Ic8e8b19ec1083d1c9cdab3d17dcaddbe43bb76b4
2016-01-13 13:12:41 +09:00
Jenkins d4ae85db7f Merge "single point of entry for sample config generation" 2016-01-11 21:50:36 +00:00
Markus Zoeller 627fde8832 single point of entry for sample config generation
To create a "nova.conf.sample" file, we use "tox -e genconfig".
This command triggers the generator from "oslo.config" which needs
entry points in "setup.cfg". Right now we have multiple entry points
to "opts.py" files which are going to be consolidated to one single
point of entry "nova/conf/opts.py". Until all config options are
moved to that central place, we would often face merge conflicts
when multiple contributors commit patches to that one "opts.py".

To prevent that, and to make it easier for future config option
moduls in "nova/conf/", the new "nova/conf/opts.py" module collects
the config options in a dynamic way.

Co-Author: EdLeafe <ed@leafe.com>

bp centralize-config-options

Change-Id: I4e5d643cd93bb2822ff59c71669cedf3de7f86fc
2016-01-08 13:55:26 +00:00
Lauren Taylor 38d29f184a Remove get_lock method and policy action
The get_lock method in compute/api.py is no longer in use.
Need to remove the get_lock method and the get_lock policy
action from the default policy.json file.

Change-Id: I6a8bb58f749ecb64bd22be1fc8f96beebd75e38b
2016-01-05 12:26:46 -08:00
Jenkins 98aa1adb6a Merge "remove /v1.1 from default paste.ini" 2016-01-05 09:14:02 +00:00
Jenkins 1a6c4cfc68 Merge "Remove the unused sginfo rootwrap filter" 2016-01-05 02:48:51 +00:00
Sean Dague 8c72d8f1de remove /v1.1 from default paste.ini
We stopped talking about /v1.1 nearly 3 years ago, it's in no
documentation. It should not be in our default deployed paste.ini as
it will only confuse folks.

Change-Id: Id695f60e30b14f939973e3610c7750b83a14d0d0
2016-01-04 06:09:43 -05:00
Davanum Srinivas eec7a55319 Nuke EC2 API from api-paste and remove wsgi support
Tempest has already removed the EC2 API tests in:
Ib5e24e19bcba9808a9f49fe7f328668df77fe4f9

We have a review in devstack below that removes EC2
API service by default.

In this review, we are removing support for the really
old EC2 API support in Nova. Anyone who needs EC2 support
should use the new EC2-API project:
http://git.openstack.org/cgit/openstack/ec2-api/

The necessary changes in Tempest and DevStack are
already merged.  In a follow on review, will remove
the EC2 specific options, code and tests from Nova.

DocImpact

Change-Id: Id7936be290b6febd18deb4c2db8ea4d678d4d9b1
2015-12-21 18:48:15 -05:00
Jenkins 0d28ab4671 Merge "Make lock policy default to admin or owner" 2015-12-18 17:10:34 +00:00
Jenkins 317f474c6d Merge "Revert "Enable options for oslo.reports"" 2015-12-17 23:48:04 +00:00
Jenkins a88436384e Merge "Fix the bug of "Error spelling of 'explicitely'"" 2015-12-08 23:51:32 +00:00
Matt Riedemann 8b65185c14 Revert "Enable options for oslo.reports"
This reverts commit 6ed3bd2b24

Something regressed with this because the GMRs that are in
the liberty side n-cpu logs in the grenade job [1] are no
longer in the mitaka side [2] after this change.

I think that needs to be sorted out before we can land
this code, or at least know where the GMRs are now.

[1] http://logs.openstack.org/17/216917/26/check/gate-grenade-dsvm/f3832b9/logs/old/screen-n-cpu.txt.gz
[2] http://logs.openstack.org/17/216917/26/check/gate-grenade-dsvm/f3832b9/logs/new/screen-n-cpu.txt.gz

Change-Id: I817b8d0f6c6fa71dc56b031c717bd7a63193f847
2015-12-05 16:12:52 +00:00
Jenkins c5bd342d33 Merge "OpenStack typo" 2015-12-04 15:07:28 +00:00
Lee Yarwood a61eac7e7d Remove the unused sginfo rootwrap filter
This call was removed for Liberty with the move to os-brick.

Change-Id: I714720e78be168f9b51e0a02e2fcfa55c1a50981
2015-12-04 12:22:18 +00:00
Jenkins 76cc283dde Merge "use graduated oslo.policy" 2015-12-02 05:53:02 +00:00
Maxime Leroy 1bf6a8760f Libvirt: Support fp plug in vhostuser vif
This commit adds support for create/delete a fp netdevice interface
when a vhostuser port is plug/unplug.

Implements: blueprint libvirt-vif-vhostuser-ovs-lb-fp
Change-Id: I53a182461b38d4cc79dbf9a6031b4953cc1ba089
Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
2015-12-01 18:02:05 +01:00
Jeffrey Zhang a4b2ade479 use graduated oslo.policy
- Add oslo.policy to requirements.txt
- Remove in-tree copy of oslo.policy

Change-Id: Ia6fef939cfe0df33476ccee365934a5d2878f90d
Partial-Bug: #1458945
2015-11-26 13:04:52 +08:00
Davanum Srinivas 6ed3bd2b24 Enable options for oslo.reports
Use the new oslo.report config option for specifying a
log_dir in which the GMR reports can be generated in.
consolidate the gmr related setup code in config.py

Introduced in oslo.reports change id:
I9ed0191628f2d552acd8130687b636671bc07a3e

Change-Id: Ib5edf65fd33ce86757f7cb1a6546a6f00738c9a3
2015-11-18 22:16:30 -05:00
JuPing 712366f761 Fix the bug of "Error spelling of 'explicitely'"
The word "explicitely" should be spelled as "explicitly".
So it is changed.

(df) Ran spell-check on entire file and fixed a few more
misspellings.

Change-Id: I25d2accc2e0a1aaff71011944a62dadceb508b47
Closes-Bug: #1501202
2015-11-13 08:18:32 -06:00
Jenkins e1f0575041 Merge "Remove useless get_instance_faults()" 2015-11-12 15:01:37 +00:00
Jenkins af17939764 Merge "Added CORS support to Nova" 2015-11-12 15:00:27 +00:00
Jenkins 104f031055 Merge "Add missing policy rules" 2015-11-12 12:46:02 +00:00
Michael Krotscheck e37e738aae Added CORS support to Nova
This adds the CORS support middleware to Nova, allowing a deployer
to optionally configure rules under which a javascript client may
break the single-origin policy and access the API directly.

The paste.ini method of deploying the middleware was
chosen, because it needs to be able to annotate responses created
by keystonemiddleware. If the middleware were explicitly included,
keystone would reject the request before the cross-domain headers
could be annotated, resulting in an error response that was
unreadable by the user agent.

The test suite was expanded, to permit the inclusion of
HTTP headers, and to add the ability to send an OPTIONS request.

OpenStack CrossProject Spec:
   http://specs.openstack.org/openstack/openstack-specs/specs/cors-support.html
Oslo_Middleware Docs:
   http://docs.openstack.org/developer/oslo.middleware/cors.html
OpenStack Cloud Admin Guide:
   http://docs.openstack.org/admin-guide-cloud/cross_project_cors.html

bp:nova-cors 
Change-Id: Ibc95df0860799ff36f682da7d032d5422b0c39c1
2015-11-11 14:28:50 -08:00
venkatamahesh c6ac4cbdc2 OpenStack typo
Change Openstack to OpenStack as per
standard and
change "stackforge/ec2-api to
openstack/ec2-api" because ec2-api had
moved to openstack

Change-Id: I59c8524e8de8b80cf13e076967e68f5edf8b507e
2015-11-09 15:52:22 +00:00
Davanum Srinivas 7d3259ddd8 Remove duplicate keys in policy.json
In I8d58be7f3cb1bdefc3b783a256c21ed216cdbad7, we added
"compute:delete", "compute:soft_delete" and "compute:force_delete",
So let's remove the older lines that have the an empty "" target.

Change-Id: I239ca596cca4631e311d7afe45de7ffcc60f70b9
2015-11-09 08:23:37 -05:00
Davanum Srinivas 555c9df65f Add missing policy rules
Added a LOG.info nova.policy:enforce method to print
what exactly we are testing in our gate jobs (see
I62d8572e36b8ebb5ece218d858679e93ca0f8c7e) and found
these two rules were missing.

Change-Id: I94780b5173a72c93cf3f7e0dabd429f40fcda46f
2015-11-09 08:04:55 -05:00
jichenjc ee7991489a Make lock policy default to admin or owner
compute:lock and compute:unlock are currently
used by compute.api function wrap_check_policy
this patch set the default value of them to be
same to os_compute_api:os-lock-server.

DocImpact: make the default policy to identical to v2.1 policy.
UpgradeImpact: old cloud need to care the default value change.

Change-Id: Ib862696bbfb7e979d6198f5ca3155f5d1e7b396b
2015-11-06 18:26:05 +08:00
Rui Chen 01e3a9de7e Remove useless get_instance_faults()
Instance faults is filled in Instance object, so
compute.api.get_instance_faults() isn't called by
any code logic. Remove it and related test cases.

Change-Id: I6309ab114246bd5a98c238ad6965f9a9bbeee437
2015-11-02 09:43:11 +00:00