The reset-state API call only sets that main status
column on the volume object. There's also a method
to set attach status, however it turns out that due
to the implementation of the status validation method
in the parent class, this was impossible to use because
it only checked and accepted "status" NOT "attach_status".
This patch fixes that attach_status problem, it also implements
the ability to update the migration status. A cinderclient change
will be needed to expose these calls as well.
PranaliDeore [Tue, 6 May 2014 04:04:45 +0000 (04:04 +0000)]
Copy custom properties to image from volume
Presently after copying an image to volume, all properties
of the image are getting copied properly but while creating
image back from volume, it doesn't copy custom properties
to the image.
At present in volume-glance-metadata table all the properties
of volume are stored as key and value. Because of this it is
difficult to differentiate between core and custom properties.
To overcome this, I have added a new option
'glance_core_properties' in cinder.conf. This option defines
all core properties of an image. This way, it's easy to separate
core and custom properties from the glance_volume_metadata and add
custom property to the newly created image.
On upload-to-image failure before initiating the data transfer or during
data transfer, the source volume status is restored properly whereas the
image created remains in queued or saving state. This change deletes the
image during such failures.
This patch flushes IO for each SCSI device that
brick removes from the system. The patch also
flushes a multipath device prior to removing
each underlying LUN associated with the
multipath device. We were seeing kernel
IO errors in the syslog without calling flush
on the block device, during a detach for a
multipath FibreChannel copy image to volume
action.
Rahul Verma [Tue, 3 Jun 2014 22:26:48 +0000 (15:26 -0700)]
Remove Quota Exception Stack Traces from Cinder Logs
Added an if clause to the Cinder API FaultWrapper so that
a warning is printed rather than an error and stack trace
if an exception of type QuotaError is thrown.
Nikola Dipanov [Fri, 25 Apr 2014 11:38:31 +0000 (13:38 +0200)]
Make begin_detaching fail if volume not "in-use"
Like it's counterpart from Nova's volume-attach functionality standpoint
- reserve_volume, begin_detaching should fail if the volume is not in
the correct state to be detached. This will prevent nova from
attempting to check and then detach, which is inherently racy.
Mark Sturdevant [Tue, 27 May 2014 21:49:34 +0000 (14:49 -0700)]
3PAR volume detach with host in a host set
When deleting the last VLUN for a host, try to
delete the host. If the host is in a host set
this will fail. When that happens, log a nice
message including the reason, but don't fail
or hang the delete VLUN. Leave hosts in host
sets.
John Griffith [Fri, 30 May 2014 15:59:52 +0000 (15:59 +0000)]
Update cinder.conf
This is mostly just a sanity check, we're revmoving
this whole check from the gate, but we've had
conflicting versions of the truth here and I'm trying
to figure out why.
This patch is a fresh run of generate_sample, which differs
from https://review.openstack.org/#/c/96784/
John Griffith [Thu, 29 May 2014 18:18:12 +0000 (18:18 +0000)]
Remove second get call to list/show volumes
Recently it was observed that with large numbers of volumes
that things like "cinder list" could take extremely long to
return.
For example, running cinder list on a system with 1000 volumes took
greater than 30 seconds to return. It turns out that the cause of
this is the addition of visible admin_metadata.
There's two problems with this:
1. The original patch probably shouldn't have gone in
data is either admin data or it's not, selectively picking
pieces of admin data out to provide to the user just creates
complications and introduces confusion.
2. The REAL issue here is that since the standar gets are made
with the standard user context, the add_visible_admin_metadata
would go through and do an elevated context get on every single
volume individually. This is what caused the horrible performance
issue on cinder list with large numbers of volumes.
Running as admin, or removing the second call drops this down to about 3
seconds for the same 1000 volume list.
This patch removes the secondary admin context get_call. Instead where
we expect to do display the visible admin_meta, we pass in a flag
requesting that the volume object we're getting has the appropriate
metadata. This way we can elevate the context if needed and avoid
iterating through the gets again.
This patch also cleans up the get_visible_admin_meta methods, and
consolidates both V1 and V2 to use the utils method.
Juan Manuel Olle [Thu, 22 May 2014 13:24:36 +0000 (10:24 -0300)]
Fix a message format error in migration cleanup
In some situations, the volume migration failed. After the cleanup
begin, code was trying to format a string value as an int,
this caused "copy_error = True" not being invoked, resulted
in UnboundLocalError exception.
Yi Chun, Huang [Thu, 29 May 2014 10:10:50 +0000 (06:10 -0400)]
Add support for z/VM driver.
Add 'FCP' into connection_info in initialize_connection
in order to support IBM z/VM hypervisors. This change only
because z/VM need FCP(fibre channel port) info while other
platform don't need it. It will not have side effect
to other platforms since they can safely ignore it.
Mike Perez [Thu, 22 May 2014 21:29:06 +0000 (14:29 -0700)]
Handle volumes no longer existing in resume delete
init_host resumes deletes for volumes with a status of 'deleting'. It
does these sequentially, and sometimes a volume could be deleted under
it, causing a bad stacktrace. This will gracefully handle those
situations and move on. Added coverage for resume volume delete being
successful as well.
Eric Harney [Tue, 27 May 2014 14:11:53 +0000 (10:11 -0400)]
Fix ISER scan retry option
The 'num_iscsi_scan_tries' option was renamed to
'num_volume_device_scan_tries'.
Remove it from the test where the deprecated name is
referenced since it is not used there anyway.
Fix the ISER driver to set the new config field rather than the
old one. Presumably this made the num_iser_scan_tries option
not work since only the new field is passed to the brick
connector.
1. Currently cinder doesn't check whether the image is active
when create volume with an image id, we can even create volume
with a deleted/saving/queued image.
2. For deleted image, it only happened when using admin credentials.
When using non-admin credentials, it returned an error that image
is not found by using 'glance image-show' on a deleted image, which
is expected. Also when creating a volume from this deleted image,
it returned a 404 error upfront. This again is the expected result.
When using admin credentials, we can view the details of deleted image
with 'glance image-show'. If create a volume out of an image ID (which
is now deleted), the operation succeeds, but the volume is left in
'error' state.
3. This accounts for a bug(he volume shouldn't be created) and should be fixed.
This allows you to specify host=XXX in your backend configuration
to override the host value that is specified in the DEFAULT section,
allowing for some backends to share a hostname while others can
have unique names.
Andreas Jaeger [Thu, 22 May 2014 16:33:09 +0000 (18:33 +0200)]
Remove all mostly untranslated PO files
We only import PO files that are at least 75 % translated,
so we can delete now all other PO files. The patch only
removes the mostly untranslated files. Once a file becomes mostly
translated, the bot will import it again.
Joshua Harlow [Thu, 22 May 2014 02:26:15 +0000 (19:26 -0700)]
Remove create_from* functor jump table
To make it easier to debug during runtime which method was
called remove the dictionary type -> functor mapping and
use a set of if statements instead. This makes it so that
if one of these methods fails we can gather more information
from the traceback than what was previously possible.
Lynxzh [Mon, 19 May 2014 10:47:16 +0000 (18:47 +0800)]
SSHPool in utils should allow customized host key missing policy
The cinder/utils SSHPool should allow missing key policy and host key
file being customized so that any caller can determine by their own
scenario if the host key file can be customized, or if an 'AutoAdd' is
appropriate, or just reject the key when mismatch. This will give more
flexible customization and also prevent any security issue as a middle
man.
vitas.yuzhou [Mon, 12 May 2014 18:57:48 +0000 (02:57 +0800)]
Check whether O_DIRECT is supported to iflag and oflag separately
The problem is when this is used for volume clear and the clear method
specifies use of the 'zero' option (/dev/zero) setting iflag direct is
not a valid option for that input file, but oflag direct is a valid
option for output file, so we should check iflag and oflag separately.
Mike Perez [Sat, 17 May 2014 19:18:59 +0000 (15:18 -0400)]
Set volume usage audit period to not NoneType
The setting of NoneType causes cinder-volume-usage-audit to not start up
and throw a stacktrace. This sets the config default back to something
it can use.
Lynxzh [Mon, 19 May 2014 09:49:00 +0000 (17:49 +0800)]
BrcdFCSanLookupService should allow customize host key and policy
In BrcdFCSanLookupService, the initialization should allow the
customization of the known_hosts_file and missing_key_policy so that the
hosts key and missing policy can be customized according to the
different scenario and customer aspect. This will not change the default
behavior when no argument is given, but more flexible to allow the
caller to give more options according to different requirements.
Mark Sturdevant [Mon, 12 May 2014 21:27:48 +0000 (14:27 -0700)]
eliminate the need for hplefthandclient in tests
In order to eliminate the need to have the hplefthandclient in the
global-requirements project, we need to remove the hplefthandclient
from being imported in all HP LeftHand driver unit tests in cinder.
Scott Devoid [Mon, 5 May 2014 21:44:44 +0000 (16:44 -0500)]
Fix solaris_execute in SolarisISCSIDriver.
A previous refactor [1] of SolarisISCSIDriver and SanDriver renamed
the `_execute` function to `san_execute`. However, SolarisISCSIDriver
still called the _execute function, which no longer exists in it's
parent classes.
This change calls san_execute instead of _execute in
super(SolarisISCSIDriver, san).
Mark Sturdevant [Mon, 5 May 2014 21:13:48 +0000 (14:13 -0700)]
eliminate the need for hp3parclient in tests
In order to eliminate the need to have the hp3parclient in the
global-requirements project, we need to remove the hp3parclient
from being imported in all 3par driver unit tests in cinder.
The method require_driver_initialized occurs exception so that the
method volume_get will be not executed, and the variable 'volume'
will be not defined. In the "finally" code segment, the
volume['instance_uuid'] will get the UnboundLocalError, this patch
gets volume before require_driver_initialized to avoid the above
problem.
Alex Meade [Thu, 17 Apr 2014 15:42:05 +0000 (11:42 -0400)]
NetApp NFS: Do not reference dst_img_local before assignment
This patch moves the assignment of the dst_img_local variable to before the
try/finally block that references it so that the finally block will have this
variable no matter where in the try block an error is raised.
Dirk Mueller [Mon, 5 May 2014 11:52:31 +0000 (13:52 +0200)]
Remove explicit dependency on amqplib
amqp (or amqplib) is only accessed via kombu, and kombu
already specifies the right dependency (either amqp if new
enough or amqplib for old versions of kombu).
Jay S. Bryant [Thu, 1 May 2014 22:13:25 +0000 (17:13 -0500)]
Ensure that lun_id is an int
The map_vol_to_host function was treating the lun number
as a string rather than an int. This was causing attempts
to mount storwize_svc volumes to Hyper-V nodes to fail as they
were checking an integer type against a unicode type which
would fail.
This change casts result_lun to an integer after the value has
gone through the ssh injection attack check. This way Hyper-V
is able to verify if the found LUN is the target LUN, enabling
mount of storwize_svc volumes to Hyper-V.
Mark Sturdevant [Fri, 25 Apr 2014 17:58:42 +0000 (10:58 -0700)]
Implement validate_connector in FibreChannelDriver
The base FibreChannelDriver didn't implement the
validate_connector() method. It fell back to the
parent class which simply does a pass. Now the
FCDriver checks to ensure that the connector has
wwnns and wwpns and raises an exception if either
one is empty or not set.