VMware: Remove some unused variables

Remove unused variables from the following files:

* nova/tests/virt/vmwareapi/test_driver_api.py
* nova/virt/vmwareapi/driver.py
* nova/virt/vmwareapi/volumeops.py

There is no design to the above selection of files: this is simply as
I have encountered them.

Change-Id: I43ee2f71edf5872bfe1b1fe010e83435689501bb
Remove vi modelines

We don't need to have the vi modelines in each source file,
it can be set in a user's vimrc if required.

Also a check is added to hacking to detect if they are re-added.

Change-Id: I347307a5145b2760c69085b6ca850d6a9137ffc6
Closes-Bug: #1229324
Fix scheduler_hints parameter of v3 API

"create a server" API contains a scheduler_hints parameter which is
a hint where a server should boot.
According to scheduler-hints-post-req.json API sample, the parameter
name is "os-scheduler-hints:scheduler_hints":
  {
    "server" : {
      "name" : "new-server-test",
      "image_ref" : "..",
      "flavor_ref" : "..",
      "os-scheduler-hints:scheduler_hints": {
        "hypervisor": "xen",
        "near": "48e6a9f6-30af-47e0-bc04-acaed113bb4e"
      }
    }
  }

However create() of SchedulerHintsController tries to get its value
from invalid position where is the same level as "server":
  {
    "server" : {
      [..]
    },
    "os-scheduler-hints:scheduler_hints": {
      "hypervisor": "xen",
      "near": "48e6a9f6-30af-47e0-bc04-acaed113bb4e"
    }
  }

As the result, Nova cannot get the value from the right parameter.
To fix the problem, this patch merges both the parameter parser and
the validation code to server_create() like the other API extensions.
SchedulerHintsController becomes unnecessary, then this patch removes
the class.

Partially implements bp v3-api-inconsistencies

Change-Id: I4e0bcbde8e2d2171d0b2e18b72d2c2b3d88d7239
Enforce FlavorExtraSpecs Key format.

When creating a key name with characters like '/' that are not
being encoded or cannot be handled as expected by routes when
matching the url, then it's not possible to remove them anymore.
The new format apply the restriction: "[\w\.\- :]+$"

This change will fix the bug without API change.

Change-Id: I64bc098c4bde33c40fa149191a751ea3eb19f932
Closes-Bug: #1256119
Set SCSI as the default cdrom bus for PowerKVM

Set the default cdrom bus to scsi when the guest architecture is
ppc64 and the hypervisor is kvm|qemu. Checks the arch from
image_meta. Fallback to host arch if arch is not present in the
metadata associated with the image.

KVM unit tests without image_meta unified in a loop.

Change-Id: I62d1490ee8c9ba45a087f934342f14386ddb7cb2
Merge "Sync unhandled exception logging change from Oslo"
Merge "Fix string formatting of exception.NoUniqueMatch message"
Merge "docstring fix"
Merge "Remove vi modelines"
Add ESX quality warning

In line with the other drivers we've been marking as untested,
this patch marks the ESX driver as "not tested" in the logs to
alert admins to the fact. The VCenter driver is being tested
with minesweeper, and thus does not emit a similar message on
startup.

Change-Id: I9217bab01761f68b716cdce3b21c2653abd9afa1
Update nova.conf.sample for python-keystoneclient 0.5.0

python-keystoneclient 0.5.0 added a new oslo.config option:

 enforce_token_bind=permissive

Change-Id: If719600866561e03b037b1eb1f58e14103a99385
Add instance_get_active_by_window_joined to InstanceList

This is needed to remove get_active_by_window from nova compute API and
allow us to make the simple_tenant_usage API use Flavor objects.

Related to blueprint compute-manager-objects

Change-Id: I93354db2775f08346f9b812f1f1e78a4050efd4a
Make the simple_tenant_usage API use objects

This change makes the simple_tenant_usage V2 and V3 APIs use Instance
and Flavor objects.

Related to blueprint compute-manager-objects

Change-Id: I8e0e870727d687da165c809ffb7a4456bff81122
Remove get_instance_type and get_active_by_window from nova compute API

Commit 013b301c1c makes both methods vestigial since the
simple_tenant_usage API was the only thing using them.

Change-Id: Idbe8183760edd57b58564761c30f2f6e3ad0086e
Merge "Update nova.conf.sample for python-keystoneclient 0.5.0"
Use new images when spawning BM instances.

With nova-BM the TFTP files (kernel and ramdisk) are cached between
instances but disks never are (today). We were treating the disk image
the same way but this is incorrect because its filename is 'disk'
rather than '$uuid' and as such it has to be cleaned out whenever a
deploy request is being processed.

Change-Id: I15c8fc25a4c064341b9f1ed51e6df8d1494fbdff
Co-Authored-By: Robert Collins <rbtcollins@hp.com>
Merge "Enforce FlavorExtraSpecs Key format."
Fixed naming issue of variable in a debug statement formatting

Closes-bug: 1275802

Change-Id: I5bf57290ff3023f6d3332a92114cc4f235e1f4af
Rename API schema modules with removing "_schema"

The paths of API schema modules include "/schemas" and they show
API schema clearly. It is not necessary to include "_schema" in
module names. This patch renames the modules with removing "_schema"
from module names.

@validaiton.schema() takes 1 parameter, so calling it by name
is excessive. Then, this patch removes the specified argument.

By applying these changes, we can specify API schema module in one
line with @validation.schema().

Partially implements blueprint nova-api-validation-fw

Change-Id: Ia646e1c2466fa0a1418f757a48d2e6b4f84f7c98
Hyper-V: Change variable in debug log message

The variable used in the log message is incorrect. The log message
outputs the file size instead of the internal VHD size.

Closes-bug #1275805

Change-Id: I270709098e058cf51bbe6494b903a461b3938d15