Hyper-V:Preserve config drive image after the instance is resized

If we configure config_drive_cdrom=True in nova.conf,
the config drive image will be lost after the instance
is resized on hyperV. This is because nova compute will
not copy the disk file if the file's ResourceSubType
is not 'Virtual Hard Disk'.

This commit adds 'Virtual CD/DVD Disk' into disk_resources
to preserve the config drive image after the instance is
resized.

Closes-Bug: #1250324

Change-Id: Ia125a8b132d194ddc2230754fd1b813698b410a8
Allow deleting instances while uuid lock is held

Avoid issues where locked up operations on the instance prevent it
from being deleted by the user. Reasons for the lock up are a separate
issue and will be handled elsewhere, but terminating the instance
should not affect any tasks anyway. Any modification should already
gracefully handle the instance going away.

For more discussion about the issue see:
http://lists.openstack.org/pipermail/openstack-dev/2013-October/017454.html

Partial-Bug: #1248563

Change-Id: Ife26ffefccea11d6e9ca5fbd970192b322fc04fd
libvirt: move unnecesary comment

Remove a commented out line of code that was not used.

Change-Id: Ie4a331c8b0d1352be82a48d6a666aafb74f7dc6b
Use (# of CPUs) workers by default

Update the default value of the worker configuration options to be
equal to the number of CPUs on the system.  This is the most common
value that should be used to get ideal performance from nova-conductor
or nova-api.

The following options are updated in this change:

    [default]
    ec2_workers=
    osapi_compute_workers=
    metadata_workers=

    [conductor]
    workers=

DocImpact
UpgradeImpact

Change-Id: Id8009b5fd37cef03ca66cb5bf44211039ac895ba
Compact pre-Icehouse database migrations <= 190.

Compacts the pre-Icehouse database migrations <= 190 into a
single migration (190_havana.py).

Pre-Icehouse users will now need to upgrade to Havana before
running any Icehouse migrations.

Tested on MySQL and PostgreSQL schemas on Fedora 19 to ensure the
new compacted migration generates an identical schema to the
previous migrate scripts in Havana.

Specific changes include:

 1) Drop migrations 181 - 184 which synced up shadow table changes.
   We now accomodate these changes in the base migration.

 2) Rename unique contraints per 185_rename_unique_constraints.py

 3) Add a new BDM table format.

 4) Add instance groups tables.

 5) add reason column to service

 6) add cells unique constraint

 7) add security groups unique constraint

Change-Id: Ibf2289f37c2376f3bd564728db5400859523c619
Implements: blueprint compact-havana-db-migrations
Compact pre-Icehouse database migrations <= 200.

Compacts the pre-Icehouse database migrations <= 200 into a
single migration (200_havana.py).

Pre-Icehouse users will now need to upgrade to Havana before
running any Icehouse migrations.

Tested on MySQL and PostgreSQL schemas on Fedora 19 to ensure the
new compacted migration generates an identical schema to the
previous migrate scripts in Havana.

Specific changes include:

  1) Add unique constraint on quotas.

  2) cleanup virtual_interfaces unique constraints

  3) Remove a bunch of volume tables (cinder cleanup)

  4) Indexes cleanup per 194_fix_152_migration_indexes.py

  5) Add unique constraint on fixed_ips.address.

  6) Add unique constraint on services columns.

  7) Add unique constraint on agent_builds columns.

  8) Add unique constraint on console_pools columns.

  9) Add unique constraint on aggregate_hosts columns.

  10) Add transport_url column to cells. (removes RPC columns)

Implements: blueprint compact-havana-db-migrations

Change-Id: Ie14e9e5de6d7d43ebabfc4680ed6434d08ecee49
Compact pre-Icehouse database migrations <= 210.

Compacts the pre-Icehouse database migrations <= 210 into a
single migration (210_havana.py).

Pre-Icehouse users will now need to upgrade to Havana before
running any Icehouse migrations.

Tested on MySQL and PostgreSQL schemas on Fedora 19 to ensure the
new compacted migration generates an identical schema to the
previous migrate scripts in Havana.

Specific changes include:

 1) Add more indexes for SQLite DB (per 201).

 2) Add unique constraint on instance_type_extra_specs.

 3) Add project_user_quotas, indexes, and constraints.

 4) Add indexes to reservations.

 5) Add locked by to instances.

 6) Add cleaned column to instances.

 7) Add host_ip/supported_instances to compute_nodes.

 8) Add missing Fkeys.

 9) Fix project_user_quotas_user_id_deleted index.

Implements: blueprint compact-havana-db-migrations

Change-Id: I63e00cd29eb4c26717b5ebd7a1ff11a01c0085de
Finish compacting pre-Icehouse database migrations

Compacts the pre-Icehouse database migrations into a
single migration (216_havana.py).

Pre-Icehouse users will now need to upgrade to Havana before
running any Icehouse migrations.

Tested on MySQL and PostgreSQL schemas on Fedora 19 to ensure the
new compacted migration generates an identical schema to the
previous migrate scripts in Havana.

Specific changes include:

  1) Add aggregate metadata unique constraint.

  2) Fix migrations index (add deleted column).

  3) Add pci_devices table.

  4) fix migrations_instance_uuid_and_status_idx index.

Implements: blueprint compact-havana-db-migrations

Change-Id: Id96e13b0ed65837761bd173c9e32ebcc1ff5f376
Make service workers gracefully handle service creation race

Right now, service workers can race to create their service record
in the database. This makes a NotFound...Exists pattern not fail
when the service record shows up due to a successful sibling.

Change-Id: I3e912beeb953c85189f44171d958e9402abc01ae
Add Network object

This adds a Network object to provide services and modeling
for nova-network and its use of the current SQLAlchemy Network
model.

Related to blueprint nova-network-objects

Change-Id: I7f943cda32fc98b3b03cdbb5d68e0c741053afaa
Make obj_to_primitive() handle netaddr types

This makes base.obj_to_primitive() handle netaddr.IPAddress() and
netaddr.IPNetwork() objects so that they properly become strings
in the primitive format, which provides compatibility with existing
network dicts.

Related to blueprint nova-network-objects

Change-Id: I098d775a2a792073b2777495d665846f399ecf3e
Make nova-network use Network to create networks

This makes nova-network manager use the Network.create() method
to do the work of creating networks. It also makes the rpcapi
use the NovaObjectSerializer since this is the first change that
makes nova-network return or take an object via RPC.

Related to blueprint nova-network-objects

Change-Id: Ida9a05ac249ff168075f87e5dbdad6bc23e69561
disk/api.py: refactors extends and adds missing tests

The method extend does not log any information if there is a
problem during the resize with "resize2fs".

This patch refactor extend and adds missing tests.

Change-Id: I81079a79e0449381440f202f6143b48f96453a11
Related-Bug: #1270086
Merge "Allow deleting instances while uuid lock is held"
Adds ephemeral_key_uuid field to instance

Patch adds a field to instance for storing the uuid of
the key used to encrypt instance's ephemeral storage.

Implements: blueprint encrypt-ephemeral-storage
Change-Id: Id5b1e272d4461875bb231839e4714d3ed0899d3f
Adds dmcrypt utility module

Patch adds a module for manipulating dmcrypt devices.

Implements: blueprint encrypt-ephemeral-storage
Change-Id: I308b9f26c382b332c02f13aa1d5f0a830e9ef277
Merge "disk/api.py: refactors extends and adds missing tests"
Remove v3 xml API sample tests

This is a step toward removing XML support from the v3 compute API.
First, we need to remove all of the tests that would fail once we start
ripping out the real code.

Part of blueprint remove-v3-xml-api

Change-Id: Ie2c280d5ea1e6b8756535deb05982a92561552db
Remove xml unit tests for v3 api plugins

Remove a bunch of unit tests for XML support in v3 compute API plugins.
This is another step towarding removing XML support completely from this
API.

Part of blueprint remove-v3-xml-api

Change-Id: Ibc35791cd8593b523ff21d9f604d0263e6da2b0a
removing xml from servers.py

this change is the beginning of the tear down of the xml v3 code.
removing xml from servers.py and still passing unit tests means
that we're done with the unit test tear down we need, as nothing
can be touching xml anywhere, as the root controller is no longer
there.

one additional test had to be removed to make this pass.

Part of blueprint remove-v3-xml-api

Change-Id: I7f04255ecc91f2aba045dc0c38992bc6d8a5b82a