Allows libvirt to set a serial number for a volume

The serial number defaults to the volume_id of the volume being
attached. We may expose a method in the future to set a different
serial number when creating or attaching a volume.

The purpose of this change is to give users a consistent place
they can find their volume. It should show up now in most flavors
of linux under /disk/by-id/virtio-<volume_uuid>

Fixes bug 1004328

Change-Id: Id1c56b5b23d799deb7da2d39ae57ecb48965c55f
Ignoring *.sw[op] files

Change-Id: I3a059106a32f36374da787bc36a3721463189e6d
Fix typo in call in cinder.API unreserve_volume

Fixes bug #1038599

def unreserve_volume(self, context, volume):
-    cinderclient(context).volumes.reserve(volume['id'])
+    cinderclient(context).volumes.unreserve(volume['id'])

Change-Id: Ida96b01d93f2e82fe842fa93c1a8edbc27434279
Implement network creation in compute API

Implements blueprint os-api-network-create

The ability to create new networks is currently only exposed by the
nova-manage CLI. Here we add support for network creation in the
os-networks API extension.

With the exception of num_networks and network_size, all the parameters
supported by 'nova-manage network create' are supported. Only a single
network may be created by each API call.

To avoid code duplication, the nova-manage code is refactored and moved
into NetworkManager so that it can be re-used by the API.

DocImpact
Change-Id: I682d498ab35ea43b553b64e13e677fe9eeb8e08b
XCP-XAPI version fix

Fixes bug 1033933.

On an Kronos installation (Ubuntu + XCP-XAPI), the reported
software_version dictionary did not contain both product_version and
product_brand. This caused a KeyError. With this fix, the session's
product_version and product_brand will default to None in such cases.
The resize operation's name in these cases will default to VDI.resize.

Change-Id: Ic0db4128a7b27c08c24461562423bcecd1373e58
Add nosehtmloutput as a test dependency.

Adding nosehtmloutput as a test dependency allows nose to output its
results to an html file. This will be used by Jenkins to save logs on
a different server.

Change-Id: I45191e872a41eed8e6a9e14757675ee7a28b3836
continue deleting instance even if quantum port delete fails

bug 1040385

Change-Id: Idb289437e40c7a1522b3a3f34f6c14ffe420c077
Add two prereq pkgs to nova devref env guide

fixes bug 1024903

As noted in the bug report, without libxml2-dev and libxslt-dev
installed on ubuntu 12.04, the virtualenv creation will fail.

This fix simply adds the packages to the first
"Install the prerequisite packages." line

Change-Id: I588ce14f63fa75d54405562f83d202d05c8a05c6
Add public network support when launching an instance.

Fixes bug 1039419.

A concept of public network has been implemented in Quantum.
To launch an instance connected to public network, we need to check public
network (whose 'shared' attribute is True) in addition to network owned by
the current tenant.

Change-Id: I128e68a8b9404056f74153bf8f576cfa8b438e19
Check association when removing floating ip.

Fixes bug 1032558 and returns 404 when trying to delete a floating ip
from an instance to which it is not associated.

Change-Id: I30b4d8a318597d38c7afc01ee6d2e6842b999157
Provide a hint for missing EC2 image ids

EC2 image ids are allocated when the images are listed for the first
time. Remind users of this if they specify an image id which does
not exist. Resolves bug 961451.

Change-Id: Id7326ba32e58051dbbf25c3c940fd0c9cc611ff3
Return actual availability zones

Report on real availability zones, not a hard coded "nova" zone in
the output of ec2 DescribeAvailabilityZones when the output is
verbose. Resolves bug 1032890.

Change-Id: Ie85cfa1c3638fc490f52f48c8238b3162732647d
Let admin list instances in vm_states.DELETED

Command 'nova list --status DELETED' returns nothing at the moment.
Make 'nova list --status DELETED' work and work for admin only.

Fixes LP Bug #1037885

Change-Id: I0bace95df713a767bb17e470e66361e1891e628c
Allow generate_sample.sh to be run from toplevel dir

I hit an issue where extract_opts.py couldn't import importutils
since it's not in my sys.path, so it's clear we need to set
PYTHONPATH before running.

The whole business of running the tool from the tools/conf dir
is fairly awkward, so change it to run from the top-level dir
instead.

Change-Id: I89b4d874a6ee3732234a9704a8ee6001a293ed71
Don't include hostname and IP in generated sample conf

Avoid including the hostname and IP address of the machine generating
the sample config file.

Change-Id: Idf791efef8b0bf760c4c95f6f5f53d20bdf5ee7a
Ensure log formats are quoted in sample conf

Fixes bug #1040583

This ensures the sample conf has:

  # instance_format="[instance: %(uuid)s] "

rather than:

  # instance_format=[instance: %(uuid)s]

Fix suggested by Vish.

Change-Id: If20aa7276d6868a6885abc85f046733adc40331f
DocImpact: update nova.conf docs
Re-generate nova.conf.sample

It looks like this hasn't been regenerated in a looong time.

DocImpact: update nova.conf docs
Change-Id: I64832ca79b3456e64237bfa0b1b130201a3f678b
Include CommonConfigOpts options in sample config

Options defined by CommonConfigOpts are declared within the class rather
than at module level, so they weren't being included in the sample conf.

Also, in essex (and up until commit 991614add8), the sample conf file
didn't contain these options but they included the hyphen in the name.
The hyphen is only used on the command line, it is converted to an
underscore automatically in the config file. Use opt.dest rather than
opt.name as the config file key. Fixes bug #1034970.

DocImpact: update nova.conf docs
Change-Id: Ia7f3dded9148deedeb198c19a8d343db6dd93f99
Re-work the handling of firewall_driver default

Fixes bug #1040430

We have a different default firewall driver for libvirt and
xenapi, yet the sample config file currently contains:

  firewall_driver=nova.virt.firewall.IptablesFirewallDriver

In the case of libvirt, it should actually be:

  firewall_driver=nova.virt.firewall.libvirt.IptablesFirewallDriver

This is really easy for users to get confused about.

Since we don't have a different sample config file for each hypervisor,
the best we can do is to just not include the default in the sample
config and have each hypervisor supply its default at runtime.

DocImpact: update nova.conf docs
Change-Id: Ie78371bcceac5a65978d695934e0246022f748a3
Remove unused instance id-to-uuid function

This has been unused since commit 0d9d2487e2.

Change-Id: I5a3171d566da60e1d4aaadc8a442e88103501ad6