OpenStack Compute (Nova)
Go to file
Chris Dent 43cc59abe2 Provide a direct interface to placement
This is a method of using wsgi-intercept to provide a context
manager that allows talking to placement over requests, but without
a network. It is a quick and dirty way to talk to and make changes
in the placement database where the only network traffic is with the
placement database.

This is expected to be useful in the creation of tools for
performing fast forward upgrades where each compute node may need to
"migrate" its resource providers, inventory and allocations in the
face of changing representations of hardware (for example
pre-existing VGPUs being represented as nested providers) but would
like to do so when all non-database services are stopped. A system
like this would allow code on the compute node to update the
placement database, using well known HTTP interactions, without the
placement service being up.

The basic idea is that we spin up the WSGI stack with no auth,
configured using whatever already loaded CONF we happen to have
available. That CONF points to the placement database and all the
usual stuff. The context manager provides a keystoneauth1 Adapter
class that operates as a client for accessing placement. The full
WSGI stack is brought up because we need various bits of middleware
to help ensure that policy calls don't explode and so JSON
validation is in place.

In this model everything else is left up to the caller: constructing
the JSON, choosing which URIs to call with what methods (see
test_direct for minimal examples that ought to give an idea of what
real callers could expect).

To make things friendly in the nova context and ease creation of fast
forward upgrade tools, SchedulerReportClient is tweaked to take an
optional adapter kwarg on construction. If specified, this is used
instead of creating one with get_ksa_adapter(), using settings from
[placement] conf.

Doing things in this way draws a clear line between the placement parts
and the nova parts while keeping the nova parts straightforward.

NoAuthReportClient is replaced with a base test class,
test_report_client.SchedulerReportClientTestBase. This provides an
_interceptor() context manager which is a wrapper around
PlacementDirect, but instead of producing an Adapter, it produces a
SchedulerReportClient (which has been passed the Adapter provided by
PlacementDirect). test_resource_tracker and test_report_client are
updated accordingly.

Caveats to be aware of:

* This is (intentionally) set up to circumvent authentication and
  authorization. If you have access to the necessary database
  connection string, then you are good to go. That's what we want,
  right?

* CONF construction being left up to the caller is on purpose
  because right now placement itself is not super flexible in this
  area and flexibility is desired here.

This is not (by a long shot) the only way to do this. Other options
include:

* Constructing a WSGI environ that has all the necessary bits to
  allow calling the methods in the handlers directly (as python
  commands).  This would duplicate a fair bit of the middleware and
  seems error prone, because it's hard to discern what parts of the
  environ need to be filled. It's also weird for data input: we need
  to use a BytesIO to pass in data on PUTs and POSTs.

* Using either the WSGI environ or wsgi-intercept models but wrap it
  with a pythonic library that exposes a "pretty" interface to
  callers. Something like:

      placement.direct.allocations.update(consumer_uuid, {data})

* Creating a python library that assembles the necessary data for
  calling the methods in the resource provider objects and exposing
  that to:
  a) the callers who want this direct stuff
  b) the existing handlers in placement (which remain responsible
     for json manipulation and validation and microversion handling,
     and marshal data appropriately for the python lib)

I've chosen the simplest thing as a starting point because it gives
us something to talk over and could solve the immediate problem. If
we were to eventually pursue the 4th option, I would hope that we
had some significant discussion before doing so as I think it is a)
harder than it might seem at first glance, b) likely to lead to many
asking "why bother with the http interface at all?". Both require
thought.

Partially implements blueprint reshape-provider-tree
Co-Authored-By: Eric Fried <efried@us.ibm.com>
Change-Id: I075785abcd4f4a8e180959daeadf215b9cd175c8
2018-06-12 11:04:50 -05:00
api-guide/source Enhance api-guide general info some updates 2018-06-05 16:54:18 +08:00
api-ref/source Merge "Remove support for /os-virtual-interfaces REST API" 2018-06-11 04:19:16 +00:00
contrib trivial: Remove "vif" script 2017-08-07 16:00:10 +01:00
devstack Skip ServerActionsTestJSON.test_rebuild_server for cells v1 job 2018-05-09 11:17:28 -04:00
doc Merge "Fix bug to doc:nova-status" 2018-06-07 21:26:38 +00:00
etc/nova Implement granular policy rules for placement 2018-05-17 11:12:16 -04:00
gate Make nova-manage db purge take --all-cells 2018-03-08 09:26:49 -08:00
nova Provide a direct interface to placement 2018-06-12 11:04:50 -05:00
placement-api-ref/source api-ref: mention that you can't re-parent a resource provider 2018-06-05 13:44:15 -04:00
playbooks/legacy Merge "Migrate tempest-dsvm-multinode-live-migration job in-tree" 2018-05-10 04:39:52 +00:00
releasenotes placement: always create consumer records 2018-06-11 12:45:41 -04:00
tools Remove deprecated monkey_patch config options 2018-05-16 11:40:41 -04:00
.coveragerc Remove nova/openstack/* from .coveragerc 2016-10-12 16:20:49 -04:00
.gitignore Implement granular policy rules for placement 2018-05-17 11:12:16 -04:00
.gitreview Add .gitreview config file for gerrit. 2011-10-24 15:07:19 -04:00
.mailmap Add mailmap entry 2014-05-07 12:14:26 -07:00
.stestr.conf Finish stestr migration 2017-11-24 16:51:12 -05:00
.zuul.yaml Merge "add lower-constraints job" 2018-05-15 01:12:25 +00:00
CONTRIBUTING.rst Update links in documents 2018-01-12 17:05:11 +08:00
HACKING.rst Removed unnecessary parantheses in yield statements 2018-03-07 16:44:36 +09:00
LICENSE initial commit 2010-05-27 23:05:26 -07:00
MAINTAINERS Fix broken URLs 2017-09-07 15:42:31 +02:00
README.rst Docs: modernise links 2018-03-24 20:27:11 +08:00
babel.cfg Get rid of distutils.extra. 2012-02-08 19:30:39 -08:00
bindep.txt Merge "Bindep does not catch missing libpcre3-dev on Ubuntu" 2018-02-14 07:31:09 +00:00
lower-constraints.txt Merge "Implement granular policy rules for placement" 2018-06-01 21:06:42 +00:00
requirements.txt Merge "Implement granular policy rules for placement" 2018-06-01 21:06:42 +00:00
setup.cfg Implement granular policy rules for placement 2018-05-17 11:12:16 -04:00
setup.py Updated from global requirements 2017-03-02 11:50:48 +00:00
test-requirements.txt Cleanup ugly stub in TestLocalDeleteAllocations 2018-05-16 09:23:55 -04:00
tests-py3.txt Remove mox in unit/virt/xenapi/test_vmops.py 2018-05-06 22:31:05 +00:00
tox.ini Implement granular policy rules for placement 2018-05-17 11:12:16 -04:00

README.rst

Team and repository tags

image

OpenStack Nova

OpenStack Nova provides a cloud computing fabric controller, supporting a wide variety of compute technologies, including: libvirt (KVM, Xen, LXC and more), Hyper-V, VMware, XenServer, OpenStack Ironic and PowerVM.

Use the following resources to learn more.

API

To learn how to use Nova's API, consult the documentation available online at:

For more information on OpenStack APIs, SDKs and CLIs in general, refer to:

Operators

To learn how to deploy and configure OpenStack Nova, consult the documentation available online at:

In the unfortunate event that bugs are discovered, they should be reported to the appropriate bug tracker. If you obtained the software from a 3rd party operating system vendor, it is often wise to use their own bug tracker for reporting problems. In all other cases use the master OpenStack bug tracker, available at:

Developers

For information on how to contribute to Nova, please see the contents of the CONTRIBUTING.rst.

Any new code must follow the development guidelines detailed in the HACKING.rst file, and pass all unit tests.

Further developer focused documentation is available at:

Other Information

During each Summit and Project Team Gathering, we agree on what the whole community wants to focus on for the upcoming release. The plans for nova can be found at: