Remove warn log in quota function on API layer

An API layer function in quotas print warn message when in input
is not valid, it's useless since an exception will be raised.

Change-Id: I707416aae29e56ad1c7d2cc55ca8c662bf5547f5
Improved logs for add/remove security group rules.

Added more details - protocol and port information to AUDIT log
messages on add/remove rule actions for security groups.

Change-Id: Ib446a63976dade90c51c13f30367a3ee17a739ea
Closes-Bug: #1154303
Remove unnecessary passing of task_state to check_instance_state

Remove cases where task_state=[None] was passed to check_instance_state
when that is essentially the default value anyway

Change-Id: I49b6449b9ae43a5cfcf5a1ccac5ee9a64d2b3f3c
VMware: remove unused variable

The flag was never used since it was added in commit
24d609447399e468937f8a278854690864ffabcd

Change-Id: Ia034ccff1220783c2dd8c37c76fce24063f12682
Deprecate nova-manage flavor subcommand

The nova client already has the following flavor commands:

flavor-access-add    Add flavor access for the given tenant.
flavor-access-list   Print access information about the given flavor.
flavor-access-remove Remove flavor access for the given tenant.
flavor-create        Create a new flavor
flavor-delete        Delete a specific flavor
flavor-key           Set or unset extra_spec for a flavor.
flavor-list          Print a list of available 'flavors' (sizes of
flavor-show          Show details about the given flavor.

This covers what nova-manage flavor was providing so let's deprecate the
legacy nova-manage subcommand and mark it for removal in the K release.

There is not a bug or blueprint for this. The flavor subcommand is
completely duplicated in nova client. It is accessing the database
directly and we want to move to using flavor objects which would go
through conductor. So this could be considered part of the objects
conversion for flavors.

For some other commands like service, db and host it makes sense to
leave those so you can access the database before the api service is
running, but that's not the case for flavors.

UpgradeImpact: nova-manage flavor command is deprecated, use nova client

Change-Id: I8709bc9af4e490142e44c6dc61fd0aaa3a392b68
Fix a typo in compute/manager::remove_volume_connection()

A typo made in the placement of a paren in a recent refactoring
resulted in definitely broken code. Unfortunately, this was not
in a tested path and so went unnoticed. This adds a test and fixes
the problem.

Change-Id: Id24169894ffda6da0301d1dc38b2f2bb29ebbd58
Remove comments and to-do for quota inconsistency

There are comments for quota inconsistency in function
_complete_deletion and considering race conditions.

_complete_deletion was called by _complete_partial_deletion
and_delete_instance only if the instance state is DELETED
compute can enter _complete_partial_deletion
while if _complete_deletion called in _delete_instance,
that means instance vm state already become DELETED

also, if the _delete_instance was called with instance
state SOFT_DELETED, the quotas.rollback() will be called
it will make quotas.commit later take no effect
since the quotas.reservations is already None

so there is no race conditions and the comments can be removed

Change-Id: Iddb9e5197ca7ca9bd4692d63bb5c7f9a2ab44be5
Partial-Bug: #1296414
DescribeInstances in ec2 shows wrong image-message

If one instance boots from a volume,
the value of 'image_id' by 'DescribeInstances' in ec2,
will be a wrong number.

The value of 'image_ref' for this type of instances, is '', not None.
So the original protected codes can't take efforts.

Change-Id: I8c5e1c626f2b7873e7720f3615db1ee1ec6c681a
Closes-Bug: #1278696
Spice proxy config setting to be read from the spice group in nova.conf

All spice configuration should be read from the spice group
in the nova config. As it's currently being done in the nova.spice
module.
Renaming spicehtml5proxy_{host, port} parameters to
html5proxy_{host, port}

DocImpact
Change-Id: I36c014c8b8a0796cda494f9450a1fc30104504a1
Closes-Bug: #1308418
replace NovaException with VirtualInterfaceCreate when neutron fails

Currently NovaException is being raised by the _neutron_failed_callback()
and being treated in a try..except block that wraps the _crate_domain method.
The exception is too generic and will catch any exceptions, which are
subclasses of NovaException (for example: ObjectActionError),
making the domain variable not be defined and will mask the original exception.

Suggesting to raise and catch the VirtualInterfaceCreateException and
treat the domain destroy and cleanup with save_and_reraise_exception
in the except block.

Change-Id: Ic972e286ded4e8b9d79ce1b0aa514bb4623d5f0b
Set default auth_strategy to keystone

It doesn't make much sense to default to no authentication in
production. We should always have production ready defaults.

DocImpact Changing default config option.

Change-Id: Ife63dc7ab680fcf0588d95c98fc9f29901485c64
Fix bad param name in method docstring

Fix tiny nits in a couple of methods.

Change-Id: I327bd78d232ffd5c8d2d1dd60724397430192a61
Don't translate debug level logs in nova.network

Our translation policy
(https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation) calls
for not translating debug level logs. This is to help prioritize log
translation. Furthermore translation has a performance overhead, even if
the log isn't used (since nova doesn't support lazy translation yet).

Change-Id: I8973992d0dd2348f9c657c3caa1cc9c7d79a4c7b
Deprecate instance_get_all_by_filters() from conductor

This deprecates the instance_get_all_by_filters() method from
conductor, which is no longer used.

This also removes a test that was mocking the conductor method,
but that really tests nothing at all. Perhaps a new test to ensure
that the period=0 case is handled properly is in order, but this
test definitely wasn't doing that.

Related to blueprint compute-manager-objects-juno

Change-Id: I1e7bc19296d1773bbc2f5f9e77a1faf0e6ac1fe6
Deprecate instance_get_active_by_window_joined() from conductor

This deprecates the instance_get_active_by_window_joined() method
from conductor which is no longer used.

Related to blueprint compute-manager-objects-juno

Change-Id: Ia9ce0cf49180806da64cc034ad12ddf2b3f1c424
Remove legacy block device usage in ec2 API

This patch makes the single place that would get the block device
mappings from the database, not convert objects to legacy format,

Also fixes fake values in tests.

Change-Id: I77ecd8782deeec42963b5b1dd16bd85923b4d261
Add new ec2 volume db API calls

The existing API calls for the EC2 volume ID mappings only returned
the EC2 ID or the UUID, not the full mapping.  We really want APIs
that return the whole mapping for use with a nova object.  This patch
adds those APIs which will be used by the VolumeMapping nova object.

Change-Id: I86361a557254dbddeae2ea49e986add813e5a934
Add VolumeMapping object for use in EC2

The EC2 code has a table mapping volume UUIDs to EC2 IDs.  This patch
creates the Nova object for this so that we can remove direct use of
these db.api calls from the EC2 code.

Change-Id: I80e5d9c8e33c1f0c5ef8a9f7c54935c8c329ed25
ec2: create volume mapping using nova object

Update the EC2 code that creates a mapping in the db between the
volume UUID and an EC2 ID to use the nova object for this.

Change-Id: I2b02c9f639519a7835ffcf27be704b4810334e6d
ec2utils: Use VolumeMapping object

Update ec2utils to use the VolumeMapping object instead of direct db
API calls for getting the ec2 ID to UUID mappings.

Change-Id: Id653fc16fffc1c416379087228a0b053b8868cac