Removed unnecessary call to ensure_export

Removed the extra call to 'ensure_export' from '_copy_image_to_volume' while
creating a volume from an image.

Fixes LP: #1044399

Change-Id: I189a4cb66b965367289c2f677147ee085e431190
Add admin actions extension

The optional os-admin-actions extension adds new wsgi_actions to the
volumes/action resource and a new snapshots/action endpoint.

With this extension both controllers will support an os-reset_status
action to force a database update of a volume or snapshot that is stuck
in a failed/incorrect status.  The os-reset_status action works
similarly to the compute api's os-reset_state action for instances.

The os-force_delete action behaves similarly to the "cinder-manage
volume delete" command and allows operators/admins to retry the delete
operation after it has gone into an error_deleting status with an admin
api call.

The os-admin-actions extension is enabled by default, but limited to the
admin api by the default policy.json rules.  Individual admin actions
can be disabled with policy rules as well.

Example of os-reset_status action on a volume:

curl http://localhost:8776/v1/${PROJECT_ID}/volumes/${VOLUME_ID}/action \
    -H 'x-auth-token: ${ADMIN_AUTH_TOKEN}' \
    -H 'content-type: application/json' \
    -d '{"os-reset_status": {"status": "error"}}'

The new admin only api can assist deployers who encounter bugs or
operational issues that result in failed actions.

It can also be used by future storage backends to support async callback
style status updates from long running actions or operations which have
encountered an error will be retried.

Also updates the api.openstack.wsgi.ControllerMetaclass to support
sub-classing wsgi.Controllers that define wsgi_actions.

Partial fix for bug #1039706

Change-Id: I29f4b892a99108b6c24eebc3eb58033a9e01e679
Update dev docs
  * Quick pass at implementing the basics for cinder dev docs
  * Remove the N/A compute related stuff
  * Clean up the architecture a bit to only show cinder related
  * Remove various modules form TOC's that aren't applicable

Change-Id: I0089c388524c9def7494658e836f4ed03a61f5b5
Fix xml metadata for volumes api in cinder.

Fixes bug 1040891.

Change-Id: Idf8cc641162617ade2aeb77b666270cf1ce54c54
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
Sync cfg changes from openstack-common

Syncs the following from stable/folsom:

 4dc2043 cfg: clean up None value handling
 513bd3a Allow set_default and set_override to use None
 0a36c92 Tilde expansion for --config-file and --config-dir
 038d597 Add import_opt() method to ConfigOpts

Change-Id: Ifa85280fdc072965f3e9ae8641bdf85268a9a6ac
Sync zmq changes from openstack-common

Syncs the following from stable/folsom:

 9f9e14c Update zmq context cleanup to use term.
 704fb8b Remove register_opts from client methods
 f88d38b Rename FLAGS to CONF; Remove self.conf

Change-Id: Ic6ab732d71420aba032554c51904dd71f1d23b78
Sync misc changes from openstack-common

Syncs the following changes from stable/folsom:

 769ec65 Don't trap then re-raise ImportError.
 202b8b7 Fix spelling typos
 01b4f31 Support for marshalling datetime while preserving microseconds.

Change-Id: I6ed5e71ed18cdf3c528351713a42645f31fd8965
Merge "Removed unnecessary call to ensure_export"
Sync improvements to config file generator tools.

We made some improvements to the config file generator in
Nova during Folsom including spacing and formatting changes.

This patch merges these into Cinder so we can make use of
them to generate a new sample config file.

Change-Id: I1e1166ac6e2a28cc179223e5af547995f58b36e6
Regenerate cinder.conf.sample.

Create a new version of cinder.conf.sample using
tools/conf/generate_sample.sh.

Old version had 475 options.

New version has 133 options (more accurate).

Change-Id: Id60aec1d91179a294e1969b7ab1f54051cb7a728
Remove memcached_servers config option.

We don't use this in Cinder.

Change-Id: Id8503ff373622a2667fe0575f79e089056677019
Remove default_schedule_zone.

We don't use this config options.

Change-Id: I94a7940dc74341580ab954ffcda1f91fb5433e3f
Remove null_kernel option.

This option was only used in the image/fake.py class. In this patch
I've updated the fake to use an inline 'nokernel' string instead of
this option which we don't make use of in the runtime Cinder code.

Change-Id: I05d4f227f1278c827ace2ce3c62319f9b18d04d4
Filter volumes and snapshots by query string

Fix query string search_opts filters in api.openstack.volume.volumes and
snapshots.  Fix get_all methods in volumes.api to adequately handle
parameter matching.

The current api does not properly apply query string filters by
display_name, status, or (in the case of snapshots) volume_id.  These
filters are needed both for the end user and operator to display logical
grouping of these resources.

Fixes: bug #1046353

Change-Id: Ia12ffe1bf8a27c8a78daa24c4b728b394932a2b0
Remove dependencies for netaddr.

Updates cinder utils.py to remove the parse_server_string and
is_valid_cidr functions. These functions aren't in use
and are the only reason we need the netaddr dependency.

Updates pip-requires to drop the netaddr dependency.

Also removes the unit tests for removed functions.
Change-Id: I521ae60b758324069fb1ffa1701b1f9deb780f65
Fix Typo in LOG.error

Fix typo in LOG.error, it should be
vol_id rather than volume_id.
Fixes bug #1046875

Change-Id: Id162c6f185a110b63e8f9f509f5cde75f3626cbf
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "Add admin actions extension"
avoid the buffer cache when copying volumes

The dd process when clearing volumes, was seen to starve
the system when writing to an iSCSI SAN connected over GigE.

So use O_DIRECT within the dd process so that the system
buffer cache is not impacted, which is generally the
best thing to do when streaming large amounts of data.

Also one could drop the I/O priority of the dd process
by prepending "ionice -c3". That would change the priority
from "normal" (best effort) to "idle", which means zeroing
will only proceed when there is no other I/O on the system.
It was thought best to leave scheduling decisions to the
system however, rather than specifying them explicitly.

Fixes bug: 937694
Change-Id: Ic842d7b83209c41d8ff05075990ed12e6f86283a
Specify the conf file when creating a volume.

Updates the tgt-admin command to actually use the config file
we create for the volume being created.

This fixes an issue introduced in
9785963c841aff5ea1c159da81f93c2bf62c70c6 which breaks iscsi
volume creation.

Fixes LP Bug #1046985.

Change-Id: I06e83c9ba351c2b4846b557a3abb170a51d506c0
Merge "Fix xml metadata for volumes api in cinder."