Avishay Traeger [Sun, 12 Jan 2014 13:43:34 +0000 (15:43 +0200)]
Print driver exception on retype
If the driver raises an exception, make sure it is printed. Also change
the logging level from info to error because an exception should not be
thrown under normal conditions.
Zhiteng Huang [Thu, 2 Jan 2014 07:44:30 +0000 (15:44 +0800)]
Drop Chance/SimpleScheduler Implementation
This patch removes the implementation of ChanceScheduler and SimpleScheduler
as previous changes have made sure they are internally replaced by
FilterScheduler.
The "max_gigabytes" config option is deprecated and will leave it like that
for one more release before we can remove it.
DocImpact: "ChanceScheduler and SimpleScheduler have been deprecated and
their implementation have been removed from Cinder."
Ollie Leahy [Thu, 19 Dec 2013 16:11:29 +0000 (16:11 +0000)]
Fix sqlalchemy bug in transfer_get_all_by_project
Because of incorrect use of the sqlalchemy methods joinedload and filter,
incorrect lists of volume transfers were being returned by
transfer_get_all_by_project().
Eric Harney [Mon, 9 Dec 2013 20:34:39 +0000 (15:34 -0500)]
NFS/GlusterFS: Skip incorrectly formatted shares
Shares should always be of the form address:/volume. If they are
not (i.e., are missing the '/'), then skip them and issue a warning
message. This will prevent us from sending incorrect connection_info
dicts to Nova.
Lynxzh [Mon, 6 Jan 2014 03:45:33 +0000 (11:45 +0800)]
Remove unused message from iogrp_data setup
The iogrp_data is initialized during do_setup loaded.
The vdisk_count is originally used but later removed.
In ValueException raised, the variable is no longer required.
Remove this will give a clearer message when
ValueException raised.
john-griffith [Tue, 31 Dec 2013 16:04:05 +0000 (09:04 -0700)]
Modify default prefix for solidfire account
The SolidFire driver creates a unique account at volume
creation composed of <cinderhost-tenantID>.This is fine
until one tries to implement HA Cinder or moves their
Cinder node to another machine.
This patch changes the default setting to be an empty string
(ie no prefix), but still allows backward compatability by setting
the config option to 'hostname'.
DocImpact: Changes default for account-prefix, for backwards compatability
use the non-default 'hostname'
Ramy Asselin [Mon, 6 Jan 2014 23:26:07 +0000 (15:26 -0800)]
3PAR: Raise Ex when del snapshot with depend vol
Deleting a 3PAR snapshot can result in an HTTP Conflict error message,
such as when a volume is dependent on it.
Previously, this exception was not caught, and the state was set
to "Error_Deleting" with no recovery path.
The code was updated to catch this exception and raise a
SnapShotIsBusy exception with an appropriate error message.
The state reverts back to 'Available' allowing the user to try again
after removing the dependency.
Jay S. Bryant [Mon, 6 Jan 2014 20:45:34 +0000 (14:45 -0600)]
Add bool_type dictionary to test_migrations
A number of MySQL migration tests fail because the test case
is verifying that an sqlalchemy.types.BOOLEAN column was created.
When the column type is checked, however, mysql reports the type as
sqlalchemy.dialects.mysql.TINYINT. The mismatch causes numerous
test cases to fail for MySQL.
This creates a dictionary for each engine being tested to handle the
different boolean types.
postgresql and DB2 encounter similar issues. Subsequent patches
will make the appropriate changes for those databases.
Xing Yang [Mon, 6 Jan 2014 22:16:05 +0000 (17:16 -0500)]
Fixed a problem in iSCSI multipath
Multipathing during copy image to volume and copy volume to image
operations doesn't work properly if there are different targets
associated with different portals for a mulitpath device.
This patch adds the volume retype operation, which allows a user to
change a given volume's type.
When retyping, the scheduler checks if the volume's current host can
accept the new type (i.e., it checks if the host passes the filters when
using the new type). If the current host is suitable, its manager is
called which calls upon the driver to change the volume's type.
There are two cases where a retype operation may require migrating the
volume:
1. The volume's current host cannot accept the new type
2. The volume's driver cannot perform the retype operation
In case of a migration, a volume with the new type is created, and the
data is migrated to it.
Volume migrations resulting from retype can be controlled by passing a
policy, which can be either:
1. 'never': Never migrate (the retype fails if migration is required)
(default)
2. 'on-demand': Migrate when necessary
This version will cause retype operations to fail if the current and
new volume types have different:
1. QoS settings that are enforced by the front-end for in-use volumes.
2. encryption settings.
Jay S. Bryant [Mon, 6 Jan 2014 18:44:26 +0000 (12:44 -0600)]
Fix downgrade in 002_quota_class.py for MySQL
Downgrade in the script 002_quota_class.py is failing for MySQL
because there is an attempt to delete the quota_classes table
while the reservations table still has a foreign key defined.
The foreign key causes the delete of the quota_classes table to fail.
Kurt Martin [Mon, 6 Jan 2014 17:06:18 +0000 (09:06 -0800)]
Removed deprecated config option hp3par_domain
The hp3par_domain config option was deprecated in the Havana release.
This just removes it from the code, test and config sample file
for the Icehouse release.
Update V2 API to return detailed volume information on create
Current implementation returns only summary information, so
cinderclient requires additional GET call to get details.
Updated the api to return the details by default so the GET in
cinderclient can be removed.
ling-yun [Fri, 3 Jan 2014 08:51:50 +0000 (16:51 +0800)]
removed unused context in check_*** methods
Input parameter 'context' of Check_*** methods(check_attach,
check_detach, _check_metadata_properties, _check_volume_availability)
in cinder/volume/api.py are not being used, so remove this 'context'
parameter.
ling-yun [Fri, 3 Jan 2014 07:56:05 +0000 (15:56 +0800)]
add 'force' verification in _volume_upload_image
_volume_upload_image API should only support to upload 'in-use' volume to
image when assign 'force' parameter as true value. Now
_volume_upload_image API does not do verification for 'force' parameter,
so we can upload 'in-use' volume to image when assign 'force' parameter
with string value 'false' or 'false111'. This patch add verification for
'force' parameter.
Shao Kai Li [Thu, 2 Jan 2014 05:51:41 +0000 (00:51 -0500)]
Raise max header size to accommodate large tokens.
The max header is exceeded in the following scenario
- Auth tokens built with a keystone v3 API catalog
- A catalog with approximately 8 or more endpoints defined
An equivalent fix will be required for all projects which use
eventlet.wsgi.
Copied from https://review.openstack.org/#/c/33362/
Eric Harney [Fri, 13 Dec 2013 15:39:09 +0000 (10:39 -0500)]
LVM: Activate Thin Pool LV upon initialization
If the LVM thin pool is not active, space calculation fails,
as data_percent is not known. Activate the pool upon initialization,
since we intend to use it anyway.
Slightly refactors _get_thin_pool_free_space so that it is clear
which missing/unexpected value is breaking things if a similar error
occurs for some other reason.
Eric Harney [Thu, 19 Dec 2013 00:11:44 +0000 (19:11 -0500)]
GlusterFS: Use correct base argument when deleting attached snaps
When deleting the most recent snapshot, the 'file_to_merge' field
which translates into the base= field for libvirt's blockRebase
call in Nova must be set depending on whether other snapshots exist.
If there are no other snapshots, base = None, which results in
libvirt clearing the qcow2 backing file pointer for the active
disk image.
If there are other snapshots, pass the parent of the file being
deleted as the new base file. The snapshot info pointer for the
prior base file must also be updated in this case.
Matt Fischer [Thu, 2 Jan 2014 02:31:20 +0000 (19:31 -0700)]
Removed copyright from empty files
According to policy change in HACKING:
http://docs.openstack.org/developer/hacking/#openstack-licensing
empty files should no longer contain copyright notices.
Zhiteng Huang [Thu, 2 Jan 2014 01:17:32 +0000 (09:17 +0800)]
Remove unused fake_flags
fake_flags.py should have been removed in change
I3424d0a401b3ef7a3254d3e913263554361a52ff but somehow it's left
untouched in that change. This module has been replaced by
cinder/tests/conf_fixture.py, and shouldn't be around anymore.
Zhiteng Huang [Tue, 31 Dec 2013 07:00:52 +0000 (15:00 +0800)]
Replace Simple/Chance Scheduler with FilterScheduler
This patch replaces SimpleScheduler and ChanceScheduler with
FilterScheduler. Scheduler manager is changed so that when it
detects 'scheduler_driver' is set to SimpleScheduler or
ChanceScheduler, it changes underlying scheduler driver to
FilterScheduler, and then host manager will use a pre-defined
combination of filters & weighers to keep scheduler behavior *MOSTLY*
the same as its old counterparts.
To simulate ChanceScheduler/SimpleScheduler, 'AvailabilityZoneFilter',
'CapacityFilter' and 'CapabilitiesFilter' are chosen to filter
out hosts that isn't in the target AZ, doesn't have sufficient
capacity and doesn't support needed capabilities. And newly
added 'ChanceWeigher' will randomly pick a host from hosts
that passes above filters - just like ChanceScheduler does;
for SimpleScheduler, 'AllocatedCapacityWeigher' will sort hosts
with their 'allocated_capacity' - the one allocates the least
is the winner by default.
So the two new weigher, 'ChanceWeigher' and 'AllocatedCapacityWeigher'
are the key FilterScheduler to act identical when choosing
back-ends to serve requests. The 3 filters on the other hand,
are essential to make sure this 'new' Simple/Chance Scheduler can
support volume types, encryption and QoS.
Zhiteng Huang [Wed, 11 Dec 2013 13:46:38 +0000 (21:46 +0800)]
Add AllocatedCapacityWeigher
AllocatedCapacityWeigher is a weigher that weigh hosts by their
allocated capacity. The main purpose of this weigher is to simulate
the SimpleScheduler's behavior, which sorts hosts by the size of
all volumes on them. So by allocated capacity, it equals to the
sum of size of all volumes on target host.
In order to keep track of 'allocated' capacity, host state is updated
to add a 'allocated_capacity_gb' attribute to record the value, which
means each back-end must report one extra stats to scheduler.
Fortunately, the 'allocated' capacity we are interested in here is
pure Cinder level capacity, the volume manager can take all the burden
to calculate this value without having to query back-ends. The volume
manager does the initial calculation in init_host() by the time when it
has to query all existing volumes from DB for ensure_export(). After
initial calculation, volume manager/scheduler will keep track of every
new request that changes 'allocated_capacity' and make sure this value
is up to date.
!DriverImpact! Cinder driver developers, please read on:
This patch contains a change that might IMPACT volume drivers: volume
manager now uses 'stats' attribute to save 'allocated_capacity_gb'.
And this information will be merged with those stats drivers provide
as a whole for scheduler to consume. If you plan to report any form
of allocated space other than the apparent Cinder level value, (e.g.
actual capacity allocated), Please choose a key name other than
'allocated_capacity_gb', otherwise it will *OVERWRITE* the value volume
manager has calculated and confuse scheduler.
ling-yun [Tue, 24 Dec 2013 03:45:16 +0000 (11:45 +0800)]
Handle terminate_connection() exception in volume manager
Due to the fact that we sometimes need to manually terminate a volume's
connection through volume api, it's possile that these backend drivers
throw exceptions while doing that. Currently exceptions are bubbled up to
volume API not being handled. This patch logs exception in volume manager
and then raises VolumeBackendAPIException to caller.
Alan Meadows [Thu, 26 Dec 2013 19:12:37 +0000 (11:12 -0800)]
Bugfix missing foreign key removal for mysql
Downgrading the cinder schema fails when running 018_add_qos_specs.py
under MySQL. The upgrade path of this schema patch adds the foreign
key volume_types_ibfk_1 on table volume_types, and the downgrade does
not correspondingly remove it before attempting to drop the
qos_specs_id column. This update removes the foreign key when
the engine is mysql prior to dropping the column.
Add additional metadata as key-value pairs in 3PAR
Track status of openstack volumes on 3PAR through
additional metadata added as key-value pairs. During volume attach
and detach, corresponding instance metadata is updated onto the
cinder volumes.
Zhiteng Huang [Mon, 2 Dec 2013 09:05:08 +0000 (17:05 +0800)]
Handle initialize_connection() exception in volume manager
Due to the fact that several drivers require backend communication to fetch
connection information for a volume, it's possile that these driver throw
exceptions while doing that. Currently exceptions can bubble up to volume
API not being handled. This patch logs exception in volume manager and
then raises VolumeBackendAPIException to caller.
John Griffith [Sat, 21 Dec 2013 00:33:23 +0000 (17:33 -0700)]
Add qos_specs support to solidfire driver
We've added a new qos_specs object to Cinder that allows creation
and management of qos settings separate from volume-types.
Now instead of embedding the qos info in the extra-specs of the
volume-type we associate the desired qos-spec to a volume-type.
This change implements the capability of the SolidFire driver to
take advantage of that feature.
Zhiteng Huang [Wed, 11 Dec 2013 15:56:14 +0000 (23:56 +0800)]
Fix QoS information in initialize_connection() result
Currently the entire QoS information (if any) is included in the result of
initialize_connection() even if the consumer of the QoS is 'back-end'. Also
the format for QoS specs also is changed so that front-end (Nova) can
parse correctly. Add unit test to cover initialize_connection().
ling-yun [Fri, 20 Dec 2013 02:55:18 +0000 (10:55 +0800)]
Only reverify backing lun when create backing lun
In TgtAdm, we alway do twice _verify_backing_lun whether backing lun
exists or not.
If backing lun exists, it doesn't need to call _verify_backing_lun
function again.
It only needs reverify whether backing lun exists or not when recreate
backing lun.
Ann Kamyshnikova [Thu, 10 Oct 2013 12:37:16 +0000 (16:37 +0400)]
Set volume_dd_blocksize configurable on per-driver basis
Allow volume_dd_blocksize config option to be configurable on a
per-driver basis.
This allows drivers used in multi-backend configurations
to define their own values. We port this to the LVM and block_device
drivers here but it can easily be ported to others as and when
needed.
Joshua Harlow [Tue, 17 Dec 2013 23:20:02 +0000 (15:20 -0800)]
Add exception logging if flow creation fails
If the create_XYZ_flow fails in being created
its useful to log exactly what the error was in
detail (instead of trapping it and only raising
a generic error). The more detailed error shows
what the real problem was during the flows
construction (which usually is some larger
problem).
Dirk Mueller [Thu, 12 Dec 2013 17:05:31 +0000 (18:05 +0100)]
Remove dynamic default on sf_account_prefix
A dynamic default makes it difficult to generate
a proper cinder.conf.sample template. Make it
default to the hostname when the option is unset
or left at default.
DocImpact: default of sf_account_prefix changed to "None", which
however preserves behavior of a previously unset option: use
the current hostname.