Brian Waldon [Sat, 27 Oct 2012 22:36:30 +0000 (15:36 -0700)]
Add VolumeHostAttribute API extension
Expose the host on which a volume resides through a new API
extension. This is only presented to Admins by default. This
can be controlled with the 'volume_host_attribute' policy
rule.
Zhiteng Huang [Wed, 3 Oct 2012 09:10:57 +0000 (17:10 +0800)]
Add default volume type flag
Where using volume type scheduler, 'volume type' is an essential input for
scheduler to perform sophysticated scheduling. This patch adds a new
flag 'default_volume_type to allow admin to set one volume type as the
default type for volume creation if user doesn't specify any.
Also add more clear 404 message to API if create request provided non-existing
volume type.
Note: Setting the 'default_volume_type' flag to non-existing volume type
is problematic and should be avoided, and the outcome of such behavior is
equivlant to setting default volume type to None.
This is part of patch set implementing 'volume-type-scheduler'.
Eric Harney [Mon, 22 Oct 2012 22:02:17 +0000 (18:02 -0400)]
Ensure device node exists before wiping during volume deletion
If the LVM device node is missing when a Cinder volume is deleted,
a large amount of data will be written to /dev/. Check that the
device node exists before performing a _copy_volume('/dev/zero'...)
to wipe it. Fixes bug 1070023.
Clay Gerrard [Mon, 22 Oct 2012 21:47:12 +0000 (16:47 -0500)]
Update volume and snapshot status on delete
Change the status of "deleting" resources at the same time we update boolean
flag for deleted. Makes dumb queries looking for stuck statuses a little
easier.
Eric Harney [Wed, 10 Oct 2012 14:38:22 +0000 (10:38 -0400)]
Error message references incorrect variable
In remove_iscsi_target() for the TgtAdm class, the "Failed to
create iscsi target for volume id:" message references a
variable that doesn't exist -- use the correct variable name.
Loosen anyjson dependency to avoid clash with ceilometer
Ceilometer depends on anyjson 0.3.1, whereas cinder requires
exacly 0.2.4.
The net effect is a devstack with ceilometer installed will
appear to work initially, as ceilometer is sparked up after
cinder. However, if any of the cinder services are subsequently
restarted, they fail with:
Zhiteng Huang [Mon, 8 Oct 2012 07:36:39 +0000 (15:36 +0800)]
Configuration Options clean up
Small clean up of configuration options including:
* unused config opts:
- reclaim_instance_interval
* rename 'instance' in config opts name/help message to 'volume'
- 'instance_usage_audit_period' to 'volume_usage_audit_period'
- help message of 'volume_name_template'
This change also re-generates cinder.conf.sample file.
This ensures that we fail-fast if the tgtd configuration does
not include the directory for volume iscsi target configs,
instead of only blowing up when tgtd is restarted.
Russell Bryant [Fri, 21 Sep 2012 18:51:17 +0000 (14:51 -0400)]
Remove unused code: check_for_export.
This code has been unused since cinder was split from nova. It used to
be used as a safety check during live migration. The check was removed
recently in nova, since it wasn't being used with Cinder anyway (just
nova-volumes).
An alternative approach would be to expose this from Cinder somehow if
we feel it's important, but until then, there's no reason to keep dead
code around.
This patch syncs the cinder driver code with that of the nova code,
as we received comments in the review process there. All changes are
minor: (1) removing unnecessary type checks of the flags, (2) not
using getattr to access the FLAGS, and (3) using the self.flags()
infrastructure that test.TestCase provides.
Currently nova and cinder have to have the same set of az's for
the ec2 api to work properly. Therefore, set the default az for
cinder to nova so they will match.
Includes a hack to az to set cinder to nova to work around gate
issues. The hack can be removed once the gate sets the zone to
nova properly.
John Griffith [Thu, 20 Sep 2012 23:27:13 +0000 (17:27 -0600)]
Add lun number (0) to model_update in HpSanDriver
The HpSanDriver was not setting the lun number in model_update
and as a result default value of 1 was being used. Trouble is the
Lun number used by LeftHand is 0, so the connect info would be
wrong and fail when trying to attach the volume.
Even when the san_is_local config option was set to false, the
SolarisISCSIDriver's _execute method was accidentally set to
util.execute by the VolumeDriver's __init__ method.
The code in nova for logging added an extra root handler to be
able to log messages to the console during log setup. This handler
was removed in the setup method. The common setup method no longer
removes this handler, so don't create it. Note that there may be
a small period before the logging setup is finished where messages
will not appear.
Python ignores SIGPIPE on startup, because it prefers to check every
write and raise an IOError exception rather than taking the signal. Most
Unix subprocesses don't expect to work this way. This patch (adapted
from Colin Watson's post at http://tinyurl.com/2a7mzh5) sets SIGPIPE
back to the default action for cinder.utils.execute and cinder-rootwrap
created subprocesses.
John Griffith [Tue, 18 Sep 2012 19:29:20 +0000 (13:29 -0600)]
Add nova migrate_version check to cinder import
Cinder-manage migrate import only works from Nova/Folsom--->Cinder/Folsom
this change adds an explicit check of the nova migrate_version (133)
to make sure we have all of the volume id/uuid changes that are needed
to be compatable, and presents an error message if that's not the case.
John Griffith [Mon, 17 Sep 2012 21:36:10 +0000 (15:36 -0600)]
Clean up db.volume_create()
Adding the metadata return to db.volume_create() introduced some
messy and unnecessary repitition in the code. This patch
cleans that up and makes use of existing volume_get functions rather
than duplicating the code in volume_create.
This syncs cinder up with the patch as it's been submitted for nova
in https://review.openstack.org/#/c/10461/
Update quota when deleting volume that failed to be scheduled
If one volume was failed to get scheduled, removing such volume should
also clean up reservation.
Also when create_volume is ready to send to scheduler, reservation
should be committed no matter backend can successfully create that
volume or not since deleting volume call will do a minus reservation
even on volume with 'error' status.
John Griffith [Thu, 13 Sep 2012 16:53:52 +0000 (10:53 -0600)]
Add a resume delete on volume manager startup
Currently if for some reason the volume service was stopped
during the zero out operation of a volume delete there was
no way to get the volume removed from the system (it would
be present in deleting status forever).
This change adds a simple check of volumes in the DB with status
of deleting, and if any are found it restarts the delete process
on them.
Removed the "vtype" option which did not work in the driver, and
added the "easytier" option. Added another check to _check_flags
and made sure -warning flag is passed properly. Added unit tests
to check all option variations.