Skip to content

Commit

Permalink
Adding pike release and restructuring README files.
Browse files Browse the repository at this point in the history
  • Loading branch information
casusbelli committed Sep 11, 2018
1 parent 28ee006 commit d0bd3e3
Show file tree
Hide file tree
Showing 10 changed files with 1,167 additions and 33 deletions.
23 changes: 23 additions & 0 deletions full_quobyte_patch/Ocata/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Ocata Release
Fixes the following issues:

- Cinder
- Fixes bug [1685277](https://bugs.launchpad.net/cinder/+bug/1685277) with patch [458885](https://review.openstack.org/#/c/458885/) in order to enable the usage of the Cinder Generic Volume Cache with the Quobyte driver (_this fix is only applied for the Ocata release_).
- Fixes bug [1674611](https://bugs.launchpad.net/cinder/+bug/1674611) with patch [447958](https://review.openstack.org/#/c/447958/), thus allowing e.g. cloned backups of Quobyte Cinder volumes.
- Fixes bug [1675710](https://bugs.launchpad.net/cinder/+bug/1675710) with patch [449553](https://review.openstack.org/#/c/449553/) in order to allow specifying multiple Quobyte registries in the quobyte_volume_url Cinder configuration option.
- Fixes bug [1687048](https://bugs.launchpad.net/cinder/+bug/1687048) with patch [461471](https://review.openstack.org/#/c/461471/)
- Removes the requirement to support extended attributes from Cinder mounts with patch [427833](https://review.openstack.org/#/c/427833/) for improved performance

- Manila
- Fixes bug [1733807](https://bugs.launchpad.net/manila/+bug/1733807) with patch [570741](https://review.openstack.org/#/c/570741) for improved API compatibility.
- Fixes bug [1771958](https://bugs.launchpad.net/manila/+bug/1771958) with patch [569355](https://review.openstack.org/#/c/569355/) to fix initial quota creation.
- Fixes bug [1771970](https://bugs.launchpad.net/manila/+bug/1771970) with patch [569355](https://review.openstack.org/#/c/569355/) to correct the quota when resizing a Manila share.
- Fixes bug [1774604](https://bugs.launchpad.net/manila/+bug/1774604) with patch [571693](https://review.openstack.org/#/c/571693/) to avoid incoherent volume specification in resizing.
- Fixes bug [1773929](https://bugs.launchpad.net/manila/+bug/1773929) with patch [572291](https://review.openstack.org/#/c/572291/) to fix a coding style issue.

- Nova
- Fixes bug [1530860](https://bugs.launchpad.net/nova/+bug/1530860) with patch [432344](https://review.openstack.org/#/c/432344/) and bug [1756823](https://bugs.launchpad.net/nova/+bug/1756823) with patch [554195](https://review.openstack.org/#/c/554195/) in order to prevent systemd service restarts from unmounting Nova mounts
- Fixes bug [1679976](https://bugs.launchpad.net/nova/+bug/1679976) with patch [453537](https://review.openstack.org/#/c/453537/) disallowing a specific and potentially bad exit code during volume mounts
- Removes the requirement to support extended attributes from Nova mounts with patch [428646](https://review.openstack.org/#/c/428646/) for improved performance

The patches come in two versions, the driver only and the full source patch.
19 changes: 19 additions & 0 deletions full_quobyte_patch/Pike/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Pike Release
Fixes the following issues:

- Manila
- Fixes bug [1774604](https://bugs.launchpad.net/manila/+bug/1774604) with patch [571693](https://review.openstack.org/#/c/571693/) to avoid incoherent volume specification in resizing.
- Fixes bug [1773929](https://bugs.launchpad.net/manila/+bug/1773929) with patch [572291](https://review.openstack.org/#/c/572291/) to fix a coding style issue.

- Nova
- Fixes bug [1756823](https://bugs.launchpad.net/nova/+bug/1756823) with a backported variant of patch [554195](https://review.openstack.org/#/c/554195/) in order to prevent systemd service restarts from unmounting Nova mounts
- NOTE: Please add the following config to */etc/nova/rootwrap.d/compute.filters* when using the patched Nova setup:


```
# nova/virt/libvirt/volume/quobyte.py
systemd-run: CommandFilter, systemd-run, root
```
The patches come in three versions, the driver only patch, the full source patch and the full driver file.
124 changes: 124 additions & 0 deletions full_quobyte_patch/Pike/full_quobyte_pike_manila.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
diff --git a/manila/share/drivers/quobyte/jsonrpc.py b/manila/share/drivers/quobyte/jsonrpc.py
index ba4b60ec..df752802 100644
--- a/manila/share/drivers/quobyte/jsonrpc.py
+++ b/manila/share/drivers/quobyte/jsonrpc.py
@@ -59,7 +59,9 @@ class JsonRpc(object):
self._cert_file = cert_file

@utils.synchronized('quobyte-request')
- def call(self, method_name, user_parameters, expected_errors=[]):
+ def call(self, method_name, user_parameters, expected_errors=None):
+ if expected_errors is None:
+ expected_errors = []
# prepare request
self._id += 1
parameters = {'retry': 'INFINITELY'} # Backend specific setting
@@ -103,7 +105,9 @@ class JsonRpc(object):
LOG.debug("Backend request resulted in error: %s", result.text)
result.raise_for_status()

- def _checked_for_application_error(self, result, expected_errors=[]):
+ def _checked_for_application_error(self, result, expected_errors=None):
+ if expected_errors is None:
+ expected_errors = []
if 'error' in result and result['error']:
if 'message' in result['error'] and 'code' in result['error']:
if result["error"]["code"] in expected_errors:
diff --git a/manila/share/drivers/quobyte/quobyte.py b/manila/share/drivers/quobyte/quobyte.py
index 55d7eeb9..1b21ac24 100644
--- a/manila/share/drivers/quobyte/quobyte.py
+++ b/manila/share/drivers/quobyte/quobyte.py
@@ -78,9 +78,10 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,):
1.2.3 - Updated RPC layer for improved stability
1.2.4 - Fixed handling updated QB API error codes
1.2.5 - Fixed two quota handling bugs
+ 1.2.6 - Fixed volume resize and jsonrpc code style bugs
"""

- DRIVER_VERSION = '1.2.5'
+ DRIVER_VERSION = '1.2.6'

def __init__(self, *args, **kwargs):
super(QuobyteShareDriver, self).__init__(False, *args, **kwargs)
@@ -89,9 +90,8 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,):
or CONF.share_backend_name or 'Quobyte')

def _fetch_existing_access(self, context, share):
- volume_uuid = self._resolve_volume_name(
- share['name'],
- self._get_project_name(context, share['project_id']))
+ volume_uuid = self._resolve_volume_name(share['name'],
+ share['project_id'])
result = self.rpc.call('getConfiguration', {})
if result is None:
raise exception.QBException(
@@ -184,7 +184,8 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,):
self.rpc.call('setQuota', {"quotas": [
{"consumer":
[{"type": "VOLUME",
- "identifier": share["name"],
+ "identifier": self._resolve_volume_name(share["name"],
+ share['project_id']),
"tenant_id": share["project_id"]}],
"limits": [{"type": "LOGICAL_DISK_SPACE",
"value": newsize_bytes}]}
@@ -223,9 +224,8 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,):
raise exception.QBException(
_('Quobyte driver only supports NFS shares'))

- volume_uuid = self._resolve_volume_name(
- share['name'],
- self._get_project_name(context, share['project_id']))
+ volume_uuid = self._resolve_volume_name(share['name'],
+ share['project_id'])

if not volume_uuid:
# create tenant, expect ERROR_GARBAGE_ARGS if it already exists
@@ -251,9 +251,8 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,):

def delete_share(self, context, share, share_server=None):
"""Delete the corresponding Quobyte volume."""
- volume_uuid = self._resolve_volume_name(
- share['name'],
- self._get_project_name(context, share['project_id']))
+ volume_uuid = self._resolve_volume_name(share['name'],
+ share['project_id'])
if not volume_uuid:
LOG.warning("No volume found for "
"share %(project_id)s/%(name)s",
@@ -281,9 +280,8 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,):
the backend
"""

- volume_uuid = self._resolve_volume_name(
- share['name'],
- self._get_project_name(context, share['project_id']))
+ volume_uuid = self._resolve_volume_name(share['name'],
+ share['project_id'])

LOG.debug("Ensuring Quobyte share %s", share['name'])

@@ -303,9 +301,8 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,):
raise exception.InvalidShareAccess(
_('Quobyte driver only supports ip access control'))

- volume_uuid = self._resolve_volume_name(
- share['name'],
- self._get_project_name(context, share['project_id']))
+ volume_uuid = self._resolve_volume_name(share['name'],
+ share['project_id'])
ro = access['access_level'] == (constants.ACCESS_LEVEL_RO)
call_params = {
"volume_uuid": volume_uuid,
@@ -322,9 +319,8 @@ class QuobyteShareDriver(driver.ExecuteMixin, driver.ShareDriver,):
self._get_project_name(context, share['project_id']))
return

- volume_uuid = self._resolve_volume_name(
- share['name'],
- self._get_project_name(context, share['project_id']))
+ volume_uuid = self._resolve_volume_name(share['name'],
+ share['project_id'])
call_params = {
"volume_uuid": volume_uuid,
"remove_allow_ip": access['access_to']}
122 changes: 122 additions & 0 deletions full_quobyte_patch/Pike/full_quobyte_pike_manila_driver.jsonrpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Copyright (c) 2015 Quobyte Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

"""Quobyte driver helper.
Control Quobyte over its JSON RPC API.
"""

import requests
from requests import auth
from requests import codes

from oslo_log import log
from oslo_serialization import jsonutils
import six
import six.moves.urllib.parse as urlparse

from manila import exception
from manila import utils

LOG = log.getLogger(__name__)

ERROR_ENOENT = 2
ERROR_ENTITY_NOT_FOUND = -24
ERROR_GARBAGE_ARGS = -3


class JsonRpc(object):

def __init__(self, url, user_credentials, ca_file=None, key_file=None,
cert_file=None):
parsedurl = urlparse.urlparse(url)
self._url = parsedurl.geturl()
self._netloc = parsedurl.netloc
self._ca_file = ca_file
self._url_scheme = parsedurl.scheme
if self._url_scheme == 'https':
if not self._ca_file:
self._ca_file = False
LOG.warning(
"Will not verify the server certificate of the API service"
" because the CA certificate is not available.")
self._id = 0
self._credentials = auth.HTTPBasicAuth(
user_credentials[0], user_credentials[1])
self._key_file = key_file
self._cert_file = cert_file

@utils.synchronized('quobyte-request')
def call(self, method_name, user_parameters, expected_errors=None):
if expected_errors is None:
expected_errors = []
# prepare request
self._id += 1
parameters = {'retry': 'INFINITELY'} # Backend specific setting
if user_parameters:
parameters.update(user_parameters)
post_data = {
'jsonrpc': '2.0',
'method': method_name,
'params': parameters,
'id': six.text_type(self._id),
}
LOG.debug("Request payload to be send is: %s",
jsonutils.dumps(post_data))

# send request
if self._url_scheme == 'https':
if self._cert_file:
result = requests.post(url=self._url,
json=post_data,
auth=self._credentials,
verify=self._ca_file,
cert=(self._cert_file, self._key_file))
else:
result = requests.post(url=self._url,
json=post_data,
auth=self._credentials,
verify=self._ca_file)
else:
result = requests.post(url=self._url,
json=post_data,
auth=self._credentials)

# eval request response
if result.status_code == codes['OK']:
LOG.debug("Retrieved data from Quobyte backend: %s", result.text)
response = result.json()
return self._checked_for_application_error(response,
expected_errors)

# If things did not work out provide error info
LOG.debug("Backend request resulted in error: %s", result.text)
result.raise_for_status()

def _checked_for_application_error(self, result, expected_errors=None):
if expected_errors is None:
expected_errors = []
if 'error' in result and result['error']:
if 'message' in result['error'] and 'code' in result['error']:
if result["error"]["code"] in expected_errors:
# hit an expected error, return empty result
return None
else:
raise exception.QBRpcException(
result=result["error"]["message"],
qbcode=result["error"]["code"])
else:
raise exception.QBException(six.text_type(result["error"]))
return result["result"]
Loading

0 comments on commit d0bd3e3

Please sign in to comment.