Uniqueness checks for floating ip addresses.

Fixes bug 1003392.

Change-Id: I3f4554659c68476539c82d359cc080b34088b3ae
Implement network association in OS API

Networks are associated with projects automatically during launch
of an instance. The network is chosen rather randomly.
This commit adds support for association of given network and project.

DocImpact - when this lands, need to update openstack-manuals repo:
doc/src/docbkx/openstack-api-site/src/wadls/compute-api/src/ext/os-networks.wadl

Implements: blueprint os-api-network-associate
Change-Id: Iafaf4a5ae3d3e16a6c649f1d7850fceba732efab
update python-quantumclient dependency to >=2.0

Nova should depend on a version of quantum client that includes
API v2.0 support.  That means the client version should be 2.0+ .

This was just pushed to PyPi today:

http://pypi.python.org/pypi/python-quantumclient/2.0

Change-Id: Ib9d997ceff92f2da6986d184b7b0da9e564800aa
Simple checks for instance user data.

Check that instance user data wont be truncated, and that it is
valid base64 data. This partially resolves bug 1035055. I don't
love the hard coded maximum length, but I haven't worked out how
to get sqlalchemy to tell me the maximum size of the data type.

Change-Id: I045d6b4481563d01cae371cf61a91781cfed6f4b
Allow XML payload for volume creation.

Fixes nova-volume aspect of LP 1030330

Tolerate volume size attribute of type string as opposed to int.

Change-Id: I7cccb760a246d562792dec1669d634803bb9bc57
Return values from wrapped functions in decorators

Calling compute manager methods requires that the decorators
return the value from the underlying function.

This doesn't actually change any return values from methods, because
all existing methods effectively return None.

Fixes bug 1036793

Change-Id: I64eea506ee1395678a7de3c6963a3da8e40d6962
continue config-drive-v2, add openstack metadata api

This continues the work Michael did on blueprint config-drive-v2

Things added:
 * web service /openstack/2012-08-10 with:
   user_data
   meta_data.json
 * web service supporting /openstack/content

Things changed:
 * Changed the name 'files' (/openstack/files) to be 'content'
   This is to be more generic and apply to future re-use of it
   for some purpose other than personalities (injected_files)
 * 'meta_data.json' and 'user_data' are used for openstack
 * 'user-data' (without .raw) in the ec2 config drive rendering
 * 'content_path' is a attribute of each of the entries in the 'files'
   its value is the path from the openstack metadata service root to
   where the content is located.

   This means that the user does not have to know anything explicit about
   '/content'.  They just have to take the 'content_path' and append it
   to the top level entry point of metadata service.

   Explicit example:
   http://169.254.169.254/openstack/2012-08-10/meta_data.json
   has:
     files[{path: "/etc/passwd", content_path: "/content/0001"}]
   To get the file, user appends 'content_path' to
     http://169.254.169.254/openstack
 * network config (Template) is available in /content also, and
   the key that points to it is 'network_config'. This occurs only
   if there are network's that are "injected" (same behavior as previously)

The meta_data.json now contains
  uuid: <instance uuid>
  meta: meta tags provided they will appear in a dict here
  files:
     This is a list of dicts, where each dict has 2 fields:
       * 'path' (the path provided)
       * 'content_id': the location in /content/ that will give the content
  public-keys:
     Dict of keyname : value
  network_config:
     This is a dict, containing 'content_path' and 'name' (network_config)
  hostname: the hostname
  name: the nova boot name

TODO:
 * want to add other items into openstack metadata
   * public-hostname
   * IP addresses
   * keystone-endpoint
   * url of metadata service: ideally only show this if there
     is a web service available.  the path seems hard coded at the moment
     to be http://169.254.169.254/openstack, but I do not know if there
     is a way to determine if one is present or not.
 * document config-drive-v2

Change-Id: I6b9097624a9c1a972e4851d79f6d557376f59d32
Implement get_host_uptime in libvirt driver.

Updates the libvirt compute driver to support the
host uptime call.

Change-Id: Ife6aad55c5544177b4172487b4cae02f02dc247f
Merge "continue config-drive-v2, add openstack metadata api"
Set task_state=None when finished snapshotting.

Reverts part of recent reverts_task_state commit
d8d7100f8c10ecd388d1943bee9298a913a6990a which removed
code that resets the task_state to None once a snapshot has
been completed.

Fixes LP Bug #1036835.

Change-Id: I7d30d16ca110f022b0d1f6b2fb05ba3aa52fa4d1
Added several operators on instance_type_extra_specs.

The following operators on instance_type_extra_specs were added in
compute_capabilities_filter.py:

    = (equal to or greater than as a number; same as vcpus case)
    == (equal to as a number)
    != (not equal to as a number)
    >= (greater than or equal to as a number)
    <= (less than or equal to as a number)
    s== (equal to as a string)
    s!= (not equal to as a string)
    s>= (greater than or equal to as a string)
    s> (greater than as a string)
    s<= (less than or equal to as a string)
    s< (less than as a string)
    <in> (substring)
    <or> (find one of these)

If the first word in the instance_type_extra_spec is not one of the
keywords above, it is ignored.

E.g.: ">= 5", "s== 2.1.0", "<in> gcc", and "<or> fpu <or> gpu"

For more information, please refer:
    blueprint instance-type-extra-specs-extension.

Change-Id: Ief23d00449798577c6910aaef85f0cba26323c61
Merge "Simple checks for instance user data."
xenapi: Support live migration without pools

Implement blueprint xenapi-live-block-migration.
Add ability to live migrate VMs to hosts that are not
a part of a host aggregate (block migration).

This requires XenServer 6.1/later, or XCP 1.6/later. As
of this change, we still do not support instances with
(nova/cinder) volumes attached. External kernels are also
not supported.

Change-Id: I5feb6756d78804aa37780a7d0cda1600f7060afe
Remove assigned, but unused variables from nova/db/sqlalchemy/api.py

model_query already create session if it's not supplied in kwargs.
So there was no point in creating session and even not passing it to model_query.
Also, nobody even cares about 'specs' in volume_type_create.

Change-Id: Ic60dca9bbfcf908fa50a43424e7d93319b2f210b
Merge "Implement network association in OS API"
Merge "xenapi: Support live migration without pools"
Add support for NFS-based virtual block devices

This code is required in Nova to support the new NFS-based
volume drivers in Cinder.

blueprint nfs-files-as-virtual-block-devices

Change-Id: Ib815817939628275c04634e8b9cabffa1c419f23
Adding port attribute in network parameter of boot.

Example is (network:[{‘port’:<uuid>}] )
The specified port will be used.
A port who have already device_id can not be used to be boot.
This fix is for isolating functionalities between Quantum and Nova.
There are no need update nova side if port model will be changed
in future quantum model.  This function is for QuantumV2 api use only.
Added port attribute in requested_network attribute. Fixes bug 1031096.

Change-Id: Id2c86228edb0c22f536f8b36a955c87870e9d98b
Merge "Allow XML payload for volume creation."
Merge "Add support for NFS-based virtual block devices"