Commit Graph

237 Commits (9640b73cc45e8e6dd8ea228abfb5e7cf3d9ed72a)

Author SHA1 Message Date
Walter A. Boring IV 9640b73cc4 Fix coverage generation
This patch makes a few small changes that will get tox -ecover
working again.

Change-Id: If67b0ad11226ff0f5774ace968277cd400f78655
2016-04-20 15:52:31 +00:00
Angus Lees dbf77fba10 Trivial rootwrap -> privsep replacement
This change replaces all uses of rootwrap with a trivial privsep-based
equivalent.  This replacement simply executes commands as the privsep
user *without any additional checks*.

There are 2 reasons why this is a reasonable thing to do:

1. We don't have a good workflow for merging rootwrap filter changes
   into parent projects (nova/cinder) for a loosely-coupled library like

2. The previous situation was also insecure.  The os-brick.filters
   rootwrap config permitted commands like "dd" and "cp" with any
   arguments, as root.  This would have posed only a mild inconvenience
   to an attacker.  With privsep we can at least (in principle) limit
   the commands to the privsep uid/gid and Linux
   capabilities (CAP_SYS_ADMIN by default with this change).

This change addresses the urgency of (1).   Later refactors will take
greater advantage of privsep to address (2).

Change-Id: I0af542eba97d2f89b1c283bf1e1e985d9690f5de
Depends-On: I90dc41bc77993bd83b80c92286e015e14f290b45
 # nova: nova.conf: Set privsep_rootwrap.helper_command
Depends-On: I4e333e73ddfd45c045b9d32dac1506fc25858c4d
 # nova: Add os-brick rootwrap filter for privsep
Depends-On: I8a0b1728cc66c4861f69623b1b16b1f759b57b25
 # cinder: cinder.conf: Set privsep_rootwrap.helper_command
Depends-On: I3b2e337321875cf4abc0ab9b44fe17cf9327d88b
 # cinder: Add os-brick rootwrap filter for privsep
Depends-On: I4299c2fc059807610f83e12a2d470e020930c64c
 # privsep: Switch to msgpack for serialization
Depends-On: Ied1ef4fc945e18516b39d1f20d58425cb633dc74
 # requirements: require oslo.privsep>=1.5.0 for msgpack fix
2016-04-15 15:29:25 +00:00
OpenStack Proposal Bot 9fc9cc4a00 Updated from global requirements
Change-Id: I7fe3f4d265489261d3e3f2cda4c554b72446c0a7
2016-04-13 12:47:09 +00:00
OpenStack Proposal Bot b0b0c70dc1 Updated from global requirements
Change-Id: Iceaf3cbe7e6670cef45bc453760d1e3fcf6962a6
2016-04-07 15:26:47 +00:00
Jenkins 1d392b1fc9 Merge "Don't use oslo-incubator stuff" 2016-04-05 20:32:20 +00:00
Jenkins 305c2a0d14 Merge "Add pylint tox env" 2016-04-05 20:32:14 +00:00
Jenkins b03c8873ac Merge "LVM: Call supports_thin_provisioning as static" 2016-04-05 20:32:09 +00:00
Jenkins e4c19a5493 Merge "Fixes get_all_available_volumes return value" 2016-04-05 20:31:56 +00:00
Eric Harney e312c89d87 LVM: Call supports_thin_provisioning as static
This is a staticmethod, so it should be called via
the LVM class.

["Instance of 'BrickLvmTestCase' has no 'fail' member", ""]

Change-Id: I5165606df4965103b114dceb6b0bcc384aa4fe80
2016-04-05 10:24:12 -04:00
Eric Harney 2ec0e03a2d Add pylint tox env
Run pylint with
 $ tox -e pylint

(Copied from Cinder with small modifications.)

Change-Id: Ieedcab8abdae759b4eedd9389db11f1bad62a5ca
2016-04-04 18:02:19 -04:00
ChangBo Guo(gcb) 652cd83201 Don't use oslo-incubator stuff
oslo-incubator was not used for oslo libaries any more.
So clean unuseful stuff.

Change-Id: I4d0d29a010063a065cf63164f13f6e913559f1e1
2016-03-23 17:42:25 +08:00
Jenkins e66c5a00c6 Merge "Replace _get_multipath_device_name with _discover_mpath_device" 2016-03-14 19:20:33 +00:00
Doug Hellmann 64496c1bd1 Update reno for stable/mitaka
Change-Id: I71cbd61eb79220d3009248c12d74fc06b4e90777
2016-03-11 14:57:33 -05:00
Keiichi KII c7f70d0ea3 Replace _get_multipath_device_name with _discover_mpath_device
For ISCSIConnector, _get_multipath_device_name is used for discovery
of a multipath device. However, the functionality is duplicated with
InitiatorConnector's _discover_mpath_device.

_discover_mpath_device is more generic. So get_multipath_device_name
should be replaced.

This patch removes _get_multipath_device_name from ISCSIConnector and
replace it with _discover_mpath_device. And the related tests are removed.

Change-Id: I15e2cfe48468b52090b677a2b1c6175420a8c9ec
Close-Bug: #1550651
2016-03-09 18:08:04 +09:00
Jenkins d440385bb7 Merge "Fix Scality SOFS support" 2016-03-08 18:07:02 +00:00
Jenkins 9ae56a7fa8 Merge "Actually run the RemoteFSClient unit tests" 2016-03-08 18:06:52 +00:00
Anthony Lee 071b541efd Fixes get_all_available_volumes return value
There was a case where the InitiatorConnector's
get_all_available_volumes function was returning None
instead of an empty list. It was happening when the search
path did not exist on the system.

This patch changes the logic so that by default an empty list
is always returned.

Closes-Bug: #1553445
Change-Id: I180a9280d3b1f2f645d7240129f00755d17958a2
2016-03-07 17:15:48 -08:00
Jenkins cdc25318a8 Merge "Add sheepdog support" 2016-03-03 10:05:04 +00:00
OpenStack Proposal Bot aa66ca0d73 Updated from global requirements
Change-Id: I04287bbfef747617185a251572e17ea964e115d1
2016-03-01 16:54:32 +00:00
Jordan Pittier 08b1ad0c9d Fix Scality SOFS support
The "Scaling backup service" patch [1] in Cinder (merged a couple of days
ago) uses os-brick to perform a local attach volume. It revealed that the
support for Scality SOFS in os-brick was broken. (we did have a CI in
Cinder but the os-brick code path was not fully exercised until [1] merged).

This patch addresses this issue. The patch introduces a new class called
`ScalityRemoteFsClient` which inherits from `RemoteFsClient`. We can't
strictly use the `RemoteFsClient` because how to mount Scality FS is
a bit different from other FS.

Note that without this patch, the Scality Cinder driver is broken, more
precisely cinder backup is broken. So I would appreciate if we can merge
that for Mitaka (which needs another minor/micro(?) release of os-brick)


Change-Id: Icfa09b124d252d1d6b07d9cff8c63c7c0d65cc30
2016-02-26 16:35:00 +01:00
Jordan Pittier 1b6eb839ee Actually run the RemoteFSClient unit tests
A file was missing. Also fix a unit test which failed
with 'TypeError: _patch_object() takes at least 2 arguments (1 given)'

Change-Id: I92e36ca1978d497f42573b61b6b1b03bbbd35f23
2016-02-26 15:02:23 +01:00
Jordan Pittier 123caab41d Mock time.sleep() in 3 unit tests
No need to actually wait in unit tests. This patch decreases the unit
tests run time by about 24 seconds.

Change-Id: I502e15e0fd2d8238f6b6b7089eb38d4d7b55114b
2016-02-26 14:35:41 +01:00
Jenkins f9b4e55db5 Merge "Fix setting the multipath_id" 2016-02-24 06:41:12 +00:00
Walter A. Boring IV c84dfef1f2 Fix setting the multipath_id
This fixes the logic in how we set the multipath_id in the device_info.
If the returned multipath_id is None, we didn't find a multipath device
and we don't set the multipath_id.  This is exactly what we do for FC.

Change-Id: Ic1f598da59ccda634b765d65706e02d1a4caff30
Closes-Bug: #1547539
2016-02-22 08:03:31 -08:00
OpenStack Proposal Bot 2d60736031 Updated from global requirements
Change-Id: Id10514f0b7f32e085c871425a476011ad472ac14
2016-02-20 21:59:12 +00:00
lisali a168bd08c3 Add sheepdog support
This patch is to add sheepdog connection in os-brick.

Most of codes are referred from sheepdog in volume drivers.

Change-Id: I358e66e11ba1c44741fdaed41eb7eb66706f92fb
2016-02-19 04:57:12 +00:00
Matt Riedemann 0d25bbb5b5 Include multipath -ll output in failed to parse warning
The multipath -ll output is logged at debug level but by
default debug level logging is disabled. If we fail to parse
the output of multipath -ll to get the device map, we should
include the command output in the warning message since INFO+
logging is enabled by default.

Change-Id: Ib66c254e6eb4394382fc928d833a3a1818336b9b
Closes-Bug: #1546773
2016-02-18 08:04:14 -08:00
Jenkins 44254e1e14 Merge "Fix iSCSI Multipath" 2016-02-17 17:49:37 +00:00
Jenkins 946bdcc016 Merge "Add missing release notes" 2016-02-16 22:05:03 +00:00
Walter A. Boring IV 508c33914a Fix iSCSI Multipath
In the refactoring of the multipath discovery code from the FC connector
we missed a class member in FC getting migrated into the base class.
This resulted in the original path not existing in the base class and
in turn breaking iSCSI multipath.

Change-Id: I7492fdf0d6d4ec6a17a937d88895449f946a1c3c
Closes-Bug: #1545198
2016-02-16 04:47:18 -08:00
Sean McGinnis f3f3ce789b Add missing release notes
Add omitted release notes in preparation for cutting the next release.

Change-Id: Id69d9d529cba108953187ed9fa81bb6e35ac3b22
2016-02-14 10:32:06 -06:00
Jenkins 82cdb40f87 Lun id's > 255 should be converted to hex
This patch addresses the issue where lun id's values are larger
than 255 and are being kept as integers. This causes the volume and
search paths to be malformed and volumes can't be found. This patch
adds two functions to to process the lun id's; they can
process both a single lun id and a list of them. If a lun id has a
value larger than 255 it is converted to hex. This patch also modifies
the necessary unit tests and adds ones to cover the new main function.

Change-Id: Ib0b2f239a8152275de9ea66fa99a286dfbe53d57
Closes-bug: #1493350
2016-02-12 12:56:37 -06:00
Jenkins 71e5745fef Merge "Raise exception in find_multipath_device" 2016-02-11 17:52:26 +00:00
Jenkins 434728be87 Merge "Fix output returned from get_all_available_volumes" 2016-02-11 17:22:19 +00:00
Jenkins b1558ea748 Merge "Remove multipath -l logic from ISCSI connector" 2016-02-11 17:21:51 +00:00
OpenStack Proposal Bot 4bdaba0562 Updated from global requirements
Change-Id: I7fb6a08969c92cf1ef8765af92b1954b92878fda
2016-02-10 21:57:42 +00:00
Anthony Lee 6998adfabe Fix output returned from get_all_available_volumes
The paths returned from the InitiatorConnector's
get_all_available_volumes function had a typo
where one of the forward slashes was missing.


This patch revises the way the paths are queried so that the
forward slash is included.


Closes-Bug: #1543238
Change-Id: I7eea70a32549c9d18820a5ce2155ecf93250158e
2016-02-08 10:12:12 -08:00
Jenkins fe0d746376 Merge "Add vzstorage protocol for remotefs connections" 2016-02-06 22:48:16 +00:00
felix23ma 2b051f7fa2 Raise exception in find_multipath_device
When failed to execute "multipath -l" in find_multipath_device,
raise an exception instead of printing warning only.

Change-Id: I593b49d1637c7077e51a2db343e5b1eec3053536
Closes-Bug: #1519363
2016-01-26 01:41:03 +08:00
OpenStack Proposal Bot 8f3163956b Updated from global requirements
Change-Id: I432bd861118c1df3d5623d886ac206abc6218bdf
2016-01-24 20:52:42 +00:00
Kendall Nelson ba2100a83f Remove multipath -l logic from ISCSI connector
This patch continues work on making the connect_volume methods
more efficient. Using multipath -l to find the available multipath
devices can take a lot of time listing all of the potential
devices. Previously, the FC connector had been modified to skip
the use of multipath -l.

This patch takes the FC code and makes it into a generic method to
be used in the ISCSI connector and the FC connector and updates tests.

I also fixed argument order in assertEquals() in the
test_connect_volume_with_multipath() function.

Closes-Bug: #1487169
Change-Id: If480df7c17a6f1c2ecebc0e00f5938d3056776fd
2016-01-22 15:28:21 -06:00
Dmitry Guryanov 6b22d755d0 Add vzstorage protocol for remotefs connections
Add vzstorage protocol support to RemoteFsConnector.

Change-Id: I494cb6ec8936142157bf2794c5886941955a04fa
2016-01-22 19:08:19 +03:00
Sean McGinnis 4b3dbdcb2f Add reno for release notes management
Adopt reno for release notes like we have done for cinder.
One difference for the client is we will not be backporting
to Liberty per recommendation here [1].


Change-Id: I8f0ea1e23cb60d9f5a2a41ee440c47716bb7a3f8
2016-01-20 19:19:36 -06:00
Jenkins 14fe7b5216 Merge "Updated from global requirements" 2016-01-20 23:34:41 +00:00
Walter A. Boring IV 40d95d8e00 Fix get_device_size with newlines
This patch adds strip() call to the return value
of the blockdevice call to fetch the size.  Sometimes we get a newline
after the size value.

Change-Id: I5917c0ad1a94b9d8ca6a41b278f9156193198a1d
Closes-Bug: #1535913
2016-01-19 07:23:03 -08:00
OpenStack Proposal Bot 6c5490bbd7 Updated from global requirements
Change-Id: Id2e6505f69e4d6c07e170899cf2cdae033187466
2016-01-18 22:44:41 +00:00
Thelo Gaultier a3261e3fbd Add connector for ITRI DISCO cinder driver
This commit adds the os-brick connector for the
ITRI DISCO cinder driver

This commit also includes the ITRI DISCO connector unit test.

The cinder driver itself has been commited in cinder but not merged yet.
( ref : )

I first commit this connector, then the part in nova
( ref : )
finally I committed the connector in cinder

Note that the patch for nova requires this commit to be merged
to pass the unit test.

Change-Id: I81036a58ab334a7e047f7fa5486c11fd19d24b8f
Implements: blueprint disco-driver-cinder
2016-01-14 09:52:55 +08:00
Jenkins 7f26d32a65 Merge "os-brick add extend_volume API" 2016-01-14 00:13:53 +00:00
Jenkins eca19810c0 Merge "Revert "Use assertTrue/False instead of assertEqual(T/F)"" 2016-01-13 21:57:47 +00:00
Walter A. Boring IV 7e10ab7bfa os-brick add extend_volume API
This patch adds the new extend_volume API to the connector objects.
The purpose of this patch is to add the ability to notify the host
kernel when an attached volume has been resized.   This allows both
raw device paths and multipath devices to get new sizes on the fly
without detaching and then reattaching to the host.

Cinder Spec:

To manually test:
  Use the tool here:

  sample brick.conf to output debug logging for the tool

  After a successful resize, find the virt domain name
  then run
  virsh blockresize <domain name> <path to raw device> <new size>
  for example,
  blockresize instance-00000007 /dev/disk/by-id/dm-uuid-mpath-350002ace1dda383d 3145728

Implements blueprint: brick-extend-attached-volume

Change-Id: I19858dd47afe3bdb3dd25c1dfead732a804cdee2
2016-01-13 16:09:43 +00:00