If, when using a Ceph as a backend for Cinder and Glance, you
create a volume from a Glance image, the request is actioned
in one of two ways; (1) if Glance does not supply sufficient
information to Cinder, a full copy is made of the Glance
image or (2) Ceph uses it's copy-on-write capability to do a
clone. If a full copy is done, the volume is marked as
Bootable=True but if a clone is done it is not.
This does not appear to break nova boot from volume at present
but the status displayed by the cinder client is incorrect.
Anton Frolov [Tue, 28 May 2013 15:34:41 +0000 (19:34 +0400)]
Support for NFS shares with spaces in path.
Unescape share address string listed in nfs_shares_config so that
'x.y.z.w:/foo\040bar' would become 'x.y.z.w:/foo bar' to support
mounting shares with spaces in name.
Use stat command to get available and total space on device instead
of df since it's output is easier to parse.
Jim Branen [Fri, 24 May 2013 16:30:10 +0000 (09:30 -0700)]
Fixes 3PAR Host already exists error.
Fixed “Host already exists” error by,
* Screen scraping error message and extracting the host name
used by the 3PAR backend.
* Cache the host name used by the 3PAR backend for subsequent
methods using host name.
* After a restart, and 3PAR host name it no longer available,
retrieve 3PAR host name using wwn/iqn, if a terminate_connection
fails.
Jay S. Bryant [Mon, 20 May 2013 20:02:11 +0000 (15:02 -0500)]
Ensure that pbr>=0.5.10 is installed
A bug in PBR levels less than 0.5.10 causes the
/usr/lib/python2.X/site-packages/cinder/db/sqlalchemy/migrate_repo/migrate.cfg
file to not be properly installed. This causes 'cinder-manage db sync'
to fail due to the missing file.
This change sets the required PBR level to >=0.5.10,<0.6 to avoid the problem.
In the case that user already has a 0.5.X level of PBR installed that is less
than 0.5.10 it should be updated rather than encountering issues as our
test system did.
Avishay Traeger [Fri, 24 May 2013 08:19:51 +0000 (11:19 +0300)]
Remove execute permissions from test files.
Remove execute permissions from test_volumes.py and
test_storwize_svc.py, which caused the tests defined in them
to be skipped.
Fixing the permissions caused test_create_volume_with_volume_type to
execute, which fails. The cause of the failure is that
(1) LoggingVolumeDriver doesn't implement get_volume_stats(), and
(2) The fake RPC doesn't pass the statistics to the scheduler for
some reason.
Because this test doesn't test the scheduler, just change to use the
simple scheduler and work around the issue.
John Griffith [Mon, 27 May 2013 20:04:56 +0000 (20:04 +0000)]
Catch and report errors from copy image to volume.
The copy image-to-volume errors weren't being handled
properly and the result was the lvcreate being retried
even though the lvcreate itself succeeded.
The result of this was misleading errors stating that
the volume couldn't be created because it already existed
(which it did, becuase the create itself was succesful).
Adam Gandelman [Tue, 28 May 2013 21:34:30 +0000 (14:34 -0700)]
test_glance.py: Stub out _get_member_model as well.
glanceclient's v2 client needs to also have its _get_member_model()
stubbed out as well, to avoid attempts to reach 'fake_host' during
client instantiation.
Update: Only stub when _get_member_model() when required.
Josh Durgin [Sat, 25 May 2013 01:18:30 +0000 (18:18 -0700)]
rbd: send ceph monitor addresses with connection info
Previously we relied on a ceph configuration file on the compute host
for this information. Sending the info directly from cinder makes more
complex setups with multiple ceph clusters talking to the same compute
hosts possible.
Refresh the monitor addresses for each initialize_connection() call,
since monitors may be added or removed while cinder-volume is
running.
Xing Yang [Tue, 28 May 2013 04:28:37 +0000 (00:28 -0400)]
Remove cinder_emc_config.xml.sample
Remove this sample config file from emc folder based on discussions
at the IRC meeting. Parameters specified in this sample file are
already documented in Cinder Admin Guide.
John Griffith [Sat, 25 May 2013 23:52:30 +0000 (17:52 -0600)]
Update cloned volumes QoS settings.
The SolidFire device inherits all settings (including QoS) from
the parent on a clone. This meant that although we were expecting
QoS to be updated when a clone was issued with a different Volume
Type than the parent volume it was never acted upon.
This change fixes that bug by simply adding the *new* qos settings
to the ModifyVolume call after cloning.
A warning message appears in Cinder logs which state that
inheritance-based rules are deprecated and use default
Brain instead of HttpBrain. It looks like HttpBrain class
doesnt have any difference from Brain class, so changing
all the instances of HttpBrain to Brain shouldn't affect
anything and removes this warning from logs.
Digging further, I found out that the policy engine has
gone through a major rework in Oslo and Nova, and I think
at some point of time in future, we will also be moving
to use the latest policy engine code. In that way of
thinking, I guess this fix is acceptable for now.
Reference: https://review.openstack.org/#/c/14122
Changed the brain from HttpBrain -> Brain, which makes the
warnings in the log disapper. A more comprehensive work will be
to pull the latest policy change code from Oslo.
Mukul Patel [Sun, 26 May 2013 18:12:06 +0000 (23:42 +0530)]
Added '%' before snapshot variable
In function create_snapshot for cinder volume, '%' was missed
before variable snapshot from message defination. It was causing
an error during translation of debug message. Included '%'
for getting proper debug log.
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.
Eric Harney [Fri, 24 May 2013 15:44:13 +0000 (11:44 -0400)]
Don't throw ValueError for invalid volume id
If a user runs something like "cinder-manage volume delete a1234",
a ValueError is thrown because it fails to cast to int.
Catch this and treat the parameter as an id which will result in a
later VolumeNotFound error rather than breaking this way.
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.
We've done this implementation because we need to use scheduler hint in
cinder with some specific filters. So, most part of code have been
imported from nova.
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.