script for configuring a vif in Xen in non-bridged mode

Creates a new vif device without attaching it to a
bridge. Quantum Linux Bridge Agent will attach the
created device to the belonging bridge.

Change-Id: I1818a92a47882d98e384b57e0fa84a0fa09d40ea
Fix pyflakes issues in integrated tests

Change-Id: I8d483319d0a20a2c8fb7a5e0e22c83048b7399dc
Adds a flag to allow configuring a region

If multiple regions contain an endpoint, extract
the correct endpoint URL from the os_region_name parameter
in nova.conf

Fixes LP Bug #1087735

Change-Id: Id4e4f56f336cd2b092a173b3c8e695b173c76f2a
Move libvirt VIF XML config into designer.py

There are a fixed set of sensible XML configurations for
network VIFs. Create some helper methods for configuring
these configurations. Then update the VIF drivers to call
these APIs. The 'designer.py' file will serve as a place
for any policy based XML configuration helpers, as distinct
from config.py which is purely dealing with XML parsing
and formatting

Blueprint: libvirt-vif-driver
Change-Id: I857607c15ed576c65f898df4eb7533505742324b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add some constants to the network model for drivers to use

Following on from

  commit 85f857e62a5edacbf467c19add6e51565ae3669f
  Author: Gary Kotton <gkotton@redhat.com>
  Date:   Sat Dec 8 08:54:16 2012 +0000

    Add vif_type to the VIF model

add some constants to nova.network.model to enumerate the valid
values for 'vif_type'. Also add a constant for max bridge name
length

Blueprint: libvirt-vif-driver
Change-Id: I47949c06fee732681bf0b547577f22a319d4e408
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Make nova network manager fill in vif_type

Make the Nova network manager impl fill in the 'vif_type' parameter
in the VIF configuration for instances. This is hardcoded to
VIF_TYPE_BRIDGE, since that's all Nova network supports.

Blueprint: libvirt-vif-driver
Change-Id: I46d1f0edc820ccc198e5a5c876ea25644ebedd86
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Make Quantum plugin fill in the 'bridge' name

There is a comment in the quantum driver code that says it
ignores the 'bridge' name field. This is misleading, because
the bridge name is still required by any virt drivers when
configuring VIFs so they know how to connect them.

Currently the libvirt Bridge driver invents a bridge name
based on 'qbr' and network['id'], while the OVS drivers
use the libvirt_ovs_bridge config. Move this logic into
the Quantum driver, renaming the config option to
quantum_ovs_bridge. The config option should go away completely
once Quantum can pass across the name, as it does for vif_type

Blueprint: libvirt-vif-driver
Change-Id: Ib043e1e6af5712ae1d1665cdca2e9fdbc89d4351
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Expand quota logging

Change-Id: Ied8bdbe2b15aebb313868b65f7660ba7ad0cb3c8
Make it clearer that network.api.API is nova-network specific.

This may save confusion for new folk, as the indirection to rpcapi
isn't intended to be used to plug quantum in - instead the whole API
object is replaced.

Change-Id: Ib3680826b2ab1e18d249f447828fd1ac9e81132f
Implements getPasswordData for ec2

This allows commands like euca-get-password to work.

Related to blueprint get-password

Change-Id: Ifad7f699849694b395e018231f9d94985625eae9
Cleanup reboot_instance tests

Convert the reboot_instance compute manager tests into true unit tests.

Change-Id: Ife10bda2726a8f84a0a81df3268894bf3e8a0a12
Make sure reboot_instance uses updated instance

compute manager's reboot_instance() was doing a check on a stale version
of instance['power_state'] as well as passing stale instance data to the
driver and notification calls.

Fixes bug 1098727

Change-Id: I59f12f09d6e8a364e65f53912c09132a249c88c0
Fix incorrect comment, and move a variable close to use.

Change-Id: Ifd10df2d6ce3844fb676cfb5c294de170cf375bf
Move network call from compute API to the manager

reboot gets network info from the network manager in the API only to pass
it to the manager.  This causes an un-needed delay on the API call.  It
also causes issues with cells, as with cells you should query the network
service close to that cell.

Fixes bug 1098741

Change-Id: If6badc007ad812e5539a3738911011685cf9df35
instances_path is now defined here.

Remove comment which is now inaccurate.

Change-Id: Ie1aa2167ef2e53f0a1c90ec9727b3580bab8f851
Chown doesn't work on mounted vfat.

As reported by a user. Resolves bug 1092560.

Change-Id: I44c847d5e7f3242ca46a7436bcbc6e519baa88fc
Centralize instance directory logic.

This is the first step to being able to change the name of the instance
directories to something more unique than instance name.

Sneaks up on bug 1023865.

Change-Id: I1340a6b8644680325cba1e90a208e4be33ace6b4
Fix logic error in periodic task wait code.

I was calculating the time to wait for the next run of a periodic
task incorrectly.

Resolves bug 1098819.

Change-Id: Ida60b69014aa06229111e58024e35268262f18fb
Clean up compute API image_create

The _image_create() code in compute manager is the only place where
db.instance_test_and_set is used.. which was added before
'expected_task_state' support was added to instance_update.  By
switching to use self.update(), we can also take advantage of it doing
the state change notification for us.

The instance update and the compute RPC call have been moved out of
_create_image() and into snapshot() and backup() to support a future
cells patch.

Change-Id: Ib6603f732d28e49cb6f351447da5f6e41615dea5
Cells: Reduce the create_image call depth for cells

This patch reduces the create image call depth (for snapshot/backup) by
returning the basic image details to the user before we call down to
the child cell.  The image entry is created in glance immediately, and
the child cell will finish up the rest.

Implements blueprint nova-compute-cells

Change-Id: I048cc532614c602f3aa6b539fb51e951174e4598