Change force_dhcp_release default to True

Historically it was was false because it requires the dnsmasq binary
'dhcp_release' which was not present in all distros.

Related to bug 970893

DocImpact

Change-Id: I4975d85a66fb930d6a56900dd569cec2a1874439
Fix v3 hypervisor extension servers action follow REST principles

The orignial hypervisor servers action as below:
'/os-hypervisors/[filters]/servers'

Change it as:
'/os-hypervisors/[hypervisor id]/servers'
And tt will return all the servers on the specific hypervisor.

Partially implements: bp v3-api-extension-versioning

DocImpact

Change-Id: I6c252372af67eda79f670199deb6592c02603c33
XenAPI: Refactor Fake to create pools, SRs and VIFs automatically

Required for changing the default SR to be the pool default - see
I116f65ece94f839e63b085480ba4f8974119d2bb
This also fixes some minor bugs in fake.py shown up by the tests

Change-Id: I19fc0747648b97a0912d28008981a84f70107d7b
Code dedup in class ServersControllerCreateTest

Externed common parts to setUp():
- request body
- request object
- test image UUID
- test flavor URL
These parts were equal in the most part of the methods.

bp nova-tests-code-duplication

Change-Id: I091f14a9753059d759ba2f7b05ff33f5abea0f00
Make ServersViewBuilderTest DRYer.

Move detail and brief info about server from test methods to setUp()
to expected_detailed_server and expected_server respectively. Every
test modifies the particular fields in the variables to create
appropriate test environment.

Blueprint: nova-tests-code-duplication
Change-Id: I31bf6ed3c266da99c57b128c298cf7beae9a6db4
Fix mig 186 downgrade when using sqlalchemy >= 0.8

This patch fixes an issue that cause tests to break when using
SQLAlchemy 0.8 and newer. The migration was using non-existing column
names in an update query. Referring to a non-existent column in an
insert() or update() construct will raise an error instead of a warning
in SQLAlchemy 0.8.

As an added bonus - this patch adds the downgrade tests for migration
186 (which were missed in the original patch) to ensure there are no
further regressions.

Fixes bug: #1201453

Change-Id: I3c679e95583ee0c1bded5a01ddec6d6212904195
Add expected_errors for extension evacuate v3

Partially implements bp v3-api-extension-versioning

Change-Id: I1a36c7f6ca517b9696c90fc35ae5c0fb74975159
Add validation of available_zone during instance create

When using nova boot command with --availability_zone parameter and only
input the zone without host and node, now will check if the zone is
available, if not, then return an error message directly rather than
create an instance with an Error state

Add a get_only_available option to function get_availability_zones

To disable available zone, one should have to disable both the scheduler
filter and the API extension, if the API extension is not disabled, this
patch will still do the validation of available zone

DocImpact

Change-Id: Ibff117d48b60ac4f4ae33e3b3d2840d7313ce0d4
port baremetal_nodes API into v3 part1

This changeset only copies the v2 files into the appropriate v3
directories unchanged. The copy as-is will not be loaded by either
the v2 or v3 extension loaders. The second changeset will then
make the changes required for it to work as a v3 extension.

This is being tried in order to make reviewing of extension
porting easier as gerrit will display only what is actually
changed for v3 rather than entirely new files.

Change-Id: I180bbf7306e7d3bffa4d6093fedfd52e4baf5215
port BaremetalNodes API into v3 part2

This patch contains the changes required to adapt the BaremetalNodes
extension and the corresponding unittest to the v3 framework

Change-Id: Iceef736a3821a4628afc34be29a04766421d3e47
Add expected_errors for extension extended_volumes v3

Partially implements bp v3-api-extension-versioning

Change-Id: I724cf10f23eead727ad3a91ab0b313524f68ca52
Add rpcapi tests for shelving calls

Adds tests to verify that compute RPC calls have the correct version and
pass the correct arguments.

Change-Id: Idb931139d3a7e6f47cbb474807c619f0ae3cd4fb
xenapi: Pass string arguments to popen

The current BitTorrent code was passing integer arguments to `make_subprocess`
which would in turn pass those to `popen`. This would cause a failure because
the semantics of the underlying `execve` function is to only accept a list of
strings.

The solution is to cast the arguments to a string before passing them into
`make_subrpocess`.

Fixes bug 1201594

Change-Id: I8372795ca032420641c449cb07bb47f9252ff4ef
Use valid IP addresses values in tests

Currently we use strings like 'fake_address', 'localhost', etc
as IP addresses values in DP API tests. This works great when
running tests on SQLite or MySQL backends, where IP addresses
are stored as plain strings. But in PostgreSQL there is a special
column type (INET), which checks inserted values to be valid IP
addresses, so tests fail.

This patch ensures we use valid IP addresses values instead of
arbitrary strings in DB API tests.

Blueprint: db-api-tests-on-all-backends

Change-Id: I2026bab612fcac09b245f6745810b6200f1f2443
Change EC2 client tokens to use system_metadata

An EC2 client token is created as a result of RunInstances. The initial
implementation called create_tags which uses per-instance metadata.
However, we can't update per-instance metadata while an instance is still
building because put the metadata updates in the messaging queue.

We avoid this problem by using system_metadata instead of per-instance
metadata. As an added bonus, users can't tamper with the token via the tags
API.

Fixes bug #1202404

Change-Id: I8ff28d75154a30fe3b521926453b9e9cbdd9fead
Config drive attached as cdrom

Some guest OSes (e.g. Windows) require config drive to be a cdrom device
to access the iso9660 filesystem on it. Option config_drive_format is
therefore set to also control the device type of config drive. If it's
set to 'iso9660', config drive will be cdrom; if it's 'vfat', config
drive will be disk.

DocImpact
Fixes: bug #1155842
Change-Id: I6c08b1b8040a1fd0db8e2b3b1fc798060733001f
Fix iptables rules when metadata_host=127.0.0.1

When metadata_host is set to 127.0.0.1 metdata_forward will use the
REDIRECT target instead of the DNAT target in iptables rules. The
REDIRECT target results in an implicit DNAT to the primary address
of the incoming interface. As a result requests coming in from VMs
will have a destination address of the gateway brought up by
nova-network.

metadate_accept will now allow traffic destinatined for any local
address on the metadata_port when metadata_host is set to
127.0.0.1.

Change-Id: I877befe6f7c1020d2160194b6f6cab8297cb086c
Fixes: bug #1202356
Implements host uptime API call for cell setup.

Fixes bug os-hypervisors/<id>/uptime fails in cell setup.Implements
'get_host_uptime' for cells_api, which returns hypervisor uptime
from the target child cell.

Fixes bug LP 1192911

Change-Id: Iac75e46e565f17c91117dcb810f6d2f2e62708d8
Fix up trivial license mismatches

This prepares Nova for Hacking 0.6 by fixing all occurences
of H103 - license header does not match Apache 2.x license.

Change-Id: I413d46c6940716fed39542b35a6ddc02a87f5196
Sync eventlet_backdoor from oslo-incubator

Includes this commit:

 c7c55b2 Improve usability when backdoor_port is nonzero

Change-Id: I06c0af7179bc2d0078e2cb757bef8551d8ce8b77