Num instances scheduler filter

Allow for scheduler filtering based on number of instances already assigned to
that host.

FLAGS.max_instances_per_host controls the maximum number of instances allowed
per host.

Change-Id: Id3e8973311ea5ac8db2d9e4e594a5288a9e3f94d
Update tools hacking for pep8 1.2 and beyond

* https://github.com/jcrocholl/pep8/commit/b9f72b16011aac981ce9e3a47fd0ffb1d3d2e085
  broke tools/hacking.py
* Upgrade pep8 to 1.2 and disable the following new tests: E12,E711,E712,E721,E502

Change-Id: I32a8808c6c9cccfedcc4d2a26649333aca1cd713
Remove unneeded lines from aggregates extension API sample tests.

In change I8f0f5b022795dc1d766e585cab8fe5f8445a3722 there was an unneeded
entry in the subs dictionary for 2 different tests.

Change-Id: I2dd5286acbde57499a1594d2c09e38d9ba6254f7
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
Return proper error messages while associating floating IP

Handled the FloatingIpNotFoundForAddress, NotAuthorized exceptions
raised while associating floating IPs which are not allocated
or allocated to another project.

Fixes bug 1057906

Change-Id: I2d6eba9159b4e855fe615ed4dfa23c388d28c6d0
Fix reserve_block_device_name while attach volume

The block device name will not be reserved in current implementation
due to missing volume_id in block_device_mapping. This will cause
block_device.instance_block_mapping does not return the ebs device
which should be reserved.

This patch adds the volume_id to block_device_mapping while reserving
block device name and changes the rpcapi to send the volume_id.

Fixes bug 1062033

Change-Id: I8f08b568619fefa99850de0bee7d605749d53b0a
Add Multiple Create extension to API sample tests.

Change-Id: Ifa5cf31cc61e4269502ff692508866948670e46f
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
Update kernel_id and ramdisk_id while rebuilding instance

While rebuilding an instances if kernel_id and ramdisk_id associated
with new image_ref then update instances table for instance_id
with the new kernel and ramdisk.

Fixes bug 1060925

Change-Id: I07dfdbed8580411adea14fd6c5be1a9569a7a021
Merge "Num instances scheduler filter"
Drop claim timeouts from resource tracker

Removed the claim timeouts.  The timeouts are basically irrelevant
since the re-work done here: https://review.openstack.org/#/c/13182/

Each claim is a marker of an operation consuming resources, valid
until the next invocation of the audit process
update_available_resource(), which does a full reconciliation of all
resource usage values from the DB.

Change-Id: I5cb0dd8903d358272ec223cf73f6eb4c06371a96
powervm: add polling timeout for LPAR stop command

We need to poll the LPAR state after a stop command is sent to
verify that the LPAR actually stops. Optionally, a timeout
value in seconds can be specified.

Also, fixes power_on and power_off calling the wrong
start/stop functions

bp powervm-compute-enhancements

Change-Id: I9ffd0125c1968e9a656d9456ea3eb85f5db8f1ab
Set instance host field after resource claim

Set the 'host' field on the instance after the resource tracker
on the compute node has accepted the build.

The field is set after resources are confirmed to be available while the
COMPUTE_RESOURCES_SEMAPHORE is held.  The semaphore ensures the
resources usage values will be consistent even if the
update_available_resource periodic task audit runs.

bug 1060255

Change-Id: I92105ec14924960ac8ef7ca8c810783085314e10
Fix pep8 error in bin/nova-manage

Also remove unused imports.

Change-Id: I6a5379ef9493fe39ba9442e809d0aeeaa97fb7b1
Clarify trusted_filter conf options

The trusted_filter conf options are vague with names like 'port' and 'server'.
Clarified that options are for the attestation server

* Prepend conf options with 'attestation'
* deprecate old names for Grizzly.

Change-Id: I6ad6c6731343e87e058a9f4e6bb7aa8decf1847a
XenAPI should only snapshot root disk

Change ID I3e2973 broke XenAPI migrations (resizes) as it caused snapshots
of all disks (including swap and ephemeral disks, if enabled) to be sent
over to the destination host.  The destination only expects vhds for the
root disk, named by sequence numbers.  swap and ephemeral disks ended up
with sequence numbers, also, messing up the re-building of the chain on
the destination.

Fixes bug 1064083

Change ID I3e2973 also didn't change the stub of VM.snapshot to
VDI.snapshot, but tests still passed due to the new code ignoring all
exceptions while snapshotting.  Potential issues in
snapshot_attached_here() would also be ignored due to excessive stubbing
in the xenapi migration testing.  This is also addressed here.

Change-Id: I145030f92a75615d056a30cabcb6ca97e34a8b6c
Imported Translations from Transifex

Change-Id: Icc57f190f53df71160d549903a93eef4d0908add
handle IPv6 race condition due to hairpin mode

bug 1011134

When using IPv6 an instance sees its own neighbour advertisement,
because of the reflective property of the hairpin mode.

Because of this the trigger-happy duplicate address detection in
the instance's kernel deconfigures the IPv6 address on the interface,
resulting in no IPv6 connectivity.

Approach of this commit is to to add an nwfilter to libvirt which
identifies this particular scenario and filters it.

Change-Id: I28f9b49cee4b2ab6ff591fae4feee623955f845f
Add api-samples to Used limits extension

Change-Id: I67069637db35eeb5a87026bf62252d006ed11b98
Handle invalid xml request to return BadRequest

Handled ExpatError,LookupError to return BadRequest
if the user inputs the invalid xml

fixes bug 1032092

Change-Id: I7374532d91e3d7675bc80730031a195f50bb2abc
Proxy floating IP calls to quantum

Fixes bug 1023169. Also fixes bug 1031119.

In Folsom, floating IP support is moved to Quantum. By this commit floating IP
calls to nova are proxied to Quantum and nova command can be used to manage
floating IPs.

pip-requires is also updated and now requires python-quantumclient >=2.1 which
supports floating IP feature in Quantum.

Change-Id: I2c32948a8fe291601216dc62d546da64a8fb8428
Dis-associate an auto-assigned floating IP should return proper warning

Added new exception class CannotDissociateAutoAssignedFloatingIP and raised
exception instead of return.

Fixes bug 1061499

Change-Id: I348573a235c6b81653837267072b5c48fa15b8af