John Griffith [Fri, 24 May 2013 19:46:28 +0000 (13:46 -0600)]
Hack run_tests.sh to work with single tests again.
Even though we're moving to testr and this will eventually
go away, we should maintain our ability to run and debug
individual tests until the broader change is released.
This just adds some text around the nosetests call
to get us back where we were.
John Griffith [Fri, 24 May 2013 04:57:57 +0000 (22:57 -0600)]
ModifyVolume attributes on Clone.
Clones copy over the attributes from the source volume,
we want to keep some admin data like source-volid and if
it's a clone or not. To do that we just need to call modifyvolume
after the clone operation and update this info.
Mathieu Gagné [Thu, 23 May 2013 19:26:44 +0000 (15:26 -0400)]
Fix ownership transfer when cloning with SolidFire
When cloning a volume with SolidFire driver, the owner of
the cloned volume is not set correctly in SolidFire when there is
a transfer of ownership.
This results in inconsistent states where the cloned volume
is owned by the new tenant in Cinder but SolidFire thinks it is still
owned by the original volume's tenant.
This patch adds the newAccountID parameter to all CloneVolume calls.
If the cloned volume is owned by the same tenant, newAccountID will
be set to the same value as the original SolidFire volume. There
will be no change of ownership done by the cloning process in SolidFire.
If the cloned volume should be owned by a different tenant, newAccountID
will be set to the appropriate SolidFire account corresponding
to the new tenant. If the SolidFire account does not exist already,
it will be created.
Morgan Fainberg [Tue, 14 May 2013 20:04:20 +0000 (13:04 -0700)]
Make NFS share selection more intelligent.
Make the NFS share selection more intelligent by using a used_ratio
and oversub_ratio to determine the valid target. The used_ratio
is a hard-cap of maximum "actual" used space, oversub_ratio allows
for oversubscription of the share based upon the apparant-allocated
space for sparse files.
Removed Options: nfs_disk_util
New options added:
* nfs_used_ratio:
Float representation of the maximum allowed usage (e.g. 0.95
calculated by available_space / total_space) before the share
is no longer concidered a valid target. Default: 0.95
* nfs_oversub_ratio:
Float representation of the oversubscriotion ratio allowed when
utilizing sparse files (determined via "du"). This gets
multiplied against the total_capacity before comparing the
apparant space used by the backing volume files. Default
ratio is 1.0 (meaning reserved/allocated space cannot exceed
total space available on the mount).
DocImpact: New Configuration Options / Removal of Config Option
Vincent Hou [Thu, 23 May 2013 11:54:36 +0000 (19:54 +0800)]
Add the service_state into test_schedule_happy_day.
Since the fake filter scheduler does not update the capabilities, the sevice
states remains empty. To avoid the None value for free_capacity_gb, we set the
host_manager to a fake host manager with a list of service states.
Mathieu Gagné [Wed, 22 May 2013 16:25:40 +0000 (12:25 -0400)]
Raise VolumeNotFound with correct volume_id
Make sure VolumeNotFound is raised with the correct volume_id
in the SolidFire driver. Some exceptions were wrongfully referring
to an undefined variable named uuid.
Eric Harney [Fri, 10 May 2013 17:42:58 +0000 (13:42 -0400)]
Support mount options for NFS/GlusterFS volumes
This patch adds support for mount options for NFS/GlusterFS volumes.
To set options, append them to the line for the volume in the
nfs_shares_config or glusterfs_shares_config file:
192.168.175.166:/testvol -o backupvolfile-server=192.168.175.177
host1:/testvol2 -o backupvolfile-server=host2,rw,other_option
These options are used when mounting from the cinder-volume
service and the nova-compute service. (There is an associated
nova-compute patch to enable the same.)
This is a useful change for GlusterFS because the
backupvolfile-server option enables a mount to succeed even if
the first server specified is offline.
John Griffith [Fri, 17 May 2013 20:03:38 +0000 (14:03 -0600)]
Update/Publish volume service updates on delete.
The Filter scheduler weighing function was failing because
we were only updating the capacity info either on the periodic
60 second interval or after succesful creates.
The result was that if you exceeded your capacity within the
update interval you would no longer be able to create volumes even
if you deleted existing volumes until the update was performed and
published.
Since we're updating on on create, there's no reason why we shouldn't
do the same on delete for the applicable volume-service.
The periodic updates are still important for other purposes so they're left
alone, but with this change we keep things up to date so the filter scheduler
has the correct picture of the world.
Eric Harney [Fri, 17 May 2013 18:48:24 +0000 (14:48 -0400)]
RemoteFsDriver: copy_image_to_volume and copy_volume_to_image
This functionality was recently added to the NFS driver --
it should instead be added to the RemoteFsDriver class to cover
both NFS and GlusterFS drivers.
leseb [Wed, 15 May 2013 11:45:45 +0000 (13:45 +0200)]
Implement cloned volume for the RBD driver
This adds the support for cloned volume to the RBD driver. This is perform by the
create option --source-volid. Since the clone is pure copy of a volume,
we don't use the clone capability from RBD and simply copy the source
image.
Navneet Singh [Mon, 6 May 2013 12:33:21 +0000 (05:33 -0700)]
NetApp server tunneling fix.
NetApp vserver/vfiler api tunneling in concurrent requests
can cause routing request to incorrect servers in race conditions.
This fixes the api and driver for the mentioned situations.
John Griffith [Tue, 7 May 2013 11:47:32 +0000 (05:47 -0600)]
Move iscsi helpers to brick directory.
This patch moves the iscsi helpers to the brick
directory. We're doing this to enable the ability
to have a module/library of core block storage
functionality to use in other OpenStack projects.
After this the next step is to separate out the LVM
and iSCSI code in drivers/lvm.py and then to actually
have the Cinder LVM driver use the new brick LVM module.
John Griffith [Tue, 14 May 2013 17:14:33 +0000 (11:14 -0600)]
Fix up hacking ignores a bit.
Add more explicit ignores to tox.ini hacking ignores until
we have a chance to fix up the imports and docstring errors
we've been ignoring. This should give us everything we had
in the past (ie alphabetical import checks).
Also, update run_tests.sh to call flake8 and not the hacking.py
that is no longer there.
Zhongyue Luo [Tue, 14 May 2013 09:30:00 +0000 (17:30 +0800)]
Hide lock_prefix argument using synchronized_with_prefix()
The lockfile module has a new convenience API which sets the lockfile prefix
Using this API, the prefix is not required everytime synchronized is used.
Mike Perez [Sat, 13 Apr 2013 23:43:16 +0000 (16:43 -0700)]
Deprecating old dot path locations for Folsom configs
In grizzly, we made a lot of structure changes. This deprecates the old
locations so the dot paths in old configs still work but give warnings
in the logs of what needs to be updated.
Mathieu Gagné [Mon, 13 May 2013 21:05:21 +0000 (17:05 -0400)]
solidfire: Add ability to override account prefix
The SolidFire account is created with a prefix based on the hostname
of the host running cinder-volume. This prevents cinder-volume from
being run in an active/active setup.
This patch introduces a new configuration option sf_account_prefix
to override the prefix used when a SolidFire account is created.
If sf_account_prefix is empty, no prefix will be added to
the SolidFire account name when created.
This patch fixes a bug introduced in the last get_volume_stats
patch that caused the method to fail. I Also added another set
of unit tests to catch any future issues related to get_volume_stats.
John Griffith [Wed, 8 May 2013 05:11:50 +0000 (23:11 -0600)]
Create an LVM utility to use for local storage.
This adds a simple LVM class for performing local
LVM operations. The idea is that an LVM object
is instantiated based on a volume group, init
can be used to instantiate and query an existing
volume group, or create a new one if given a list
of PV's to use in creation.
See BP for information on where this is going and
how it will be used in Cinder and hopefully other
projects.
Mark McLoughlin [Wed, 8 May 2013 12:52:51 +0000 (13:52 +0100)]
Add CINDER_LOCALEDIR env variable
Part of fixing bug #995287
Syncs these two commits from oslo-incubator:
Support overriding oslo localedir too
Add a gettextutils.install() helper function
to get a new gettextutils.install() function which allows the default
localedir to be overwritten via an environment variable.
Note that gettextutils.install() must be called before any other cinder
modules are imported since some modules attempt to translate strings
at import time (e.g. in cinder.flags). This is broken and inefficient,
but fixing it involves adding something like sphinx's l_() function and
would be very invaisve.
Mark McLoughlin [Wed, 8 May 2013 12:52:42 +0000 (13:52 +0100)]
Remove gettext.install() from cinder/__init__.py
The gettext.install() function installs a builtin _() function which
translates a string in the translation domain supplied to the install()
function. If gettext.install() is called multiple times, it's the last
call to the function which wins and the last supplied translation domain
which is used e.g.
Usually this function is called early on in a toplevel script and we
assume that no other code will call it and override the installed _().
However, in Cinder, we have taken a shortcut to avoid having to call it
explicitly from each script and instead call it from cinder/__init__.py.
This shortcut would be perfectly fine if we were absolutely sure that
nova modules would never be imported from another program. It's probably
quite incorrect for a program to use cinder code (indeed, if we wanted
to support this, Cinder code shouldn't use the default _() function) but
nevertheless there are some corner cases where it happens. For example,
the keystoneclient auth_token middleware tries to import cfg from
cinder.openstack and this in turn causes gettext.install('cinder') in
other projects like glance or quantum.
To avoid any doubt here, let's just rip out the shortcut and always
call gettext.install() from the top-level script.
However, there's a bit of an annoying detail here - by default,
nosetests starts in the current directly and tries to import all modules
it finds to look for tests. Without the _() builtin installed, importing
some modules like cinder.flags will fail.
Since it only ever makes sense to load tests from the cinder/tests dir,
we can ask nose to do that by using the --tests argument via setup.cfg.
This patch fixes the ability to set the volume_backend_name
for each driver. The original bug was filed against LeftHand
and 3PAR, but several drivers exhibited a fixed backend name.