Skip to content

Instantly share code, notes, and snippets.

@patrick-east
patrick-east / iscsi-fixes.patch
Created January 19, 2016 19:42
MOS 7 patches
diff --git a/cinder/brick/initiator/connector.py b/cinder/brick/initiator/connector.py
index 7514c6f..605e77d 100644
--- a/cinder/brick/initiator/connector.py
+++ b/cinder/brick/initiator/connector.py
@@ -43,6 +43,8 @@ LOG = logging.getLogger(__name__)
synchronized = lockutils.synchronized_with_prefix('brick-')
DEVICE_SCAN_ATTEMPTS_DEFAULT = 3
MULTIPATH_ERROR_REGEX = re.compile("\w{3} \d+ \d\d:\d\d:\d\d \|.*$")
+MULTIPATH_DEV_CHECK_REGEX = re.compile("\s+dm-\d+\s+")
+MULTIPATH_PATH_CHECK_REGEX = re.compile("\s+\d+:\d+:\d+:\d+\s+")
def init_host(self):
"""Perform any required initialization."""
ctxt = context.get_admin_context()
LOG.info(_LI("Starting volume driver %(driver_name)s (%(version)s)"),
{'driver_name': self.driver.__class__.__name__,
'version': self.driver.get_version()})
try:
self.driver.do_setup(ctxt)
self.driver.check_for_setup_error()
diff --git a/cinder/objects/volume.py b/cinder/objects/volume.py
index d50175e..3556ceb 100644
--- a/cinder/objects/volume.py
+++ b/cinder/objects/volume.py
@@ -455,6 +455,6 @@ class VolumeList(base.ObjectListBase, base.CinderObject):
limit, sort_keys=sort_keys,
sort_dirs=sort_dirs,
filters=filters, offset=offset)
- expected_attrs = ['admin_metadata', 'metadata']
+ expected_attrs = ['admin_metadata', 'metadata', 'volume_type']
@patrick-east
patrick-east / README
Last active April 20, 2016 16:32
Solaris OpenStack (Juno) iSCSI Multipathing proposed changes
What Changed:
- Don't use an iscsi:// suri in zone config anymore, for iscsi attached volumes we do the attach ourselves and give it the dev:/dev/dsk/<name> path for the storage device.
- Fixup some issues in how we determine what path to use in Cinder, it wasn't accounting for the LUN when looking for paths.
- Added in step to snag additional discovery addresses when doing the iSCSI setup to help with single portal limitation in Juno
- Take that fixed up code and use it in Nova to do the previously mentioned attach/detach
- Fixup some issues with the solaris changes done in the PureISCSIDriver (unsure if maybe I started from an older one though)
Known issues:
- Cinder can't seem to create a volume from an image...? Maybe thats just with the iscsi drivers?
- We never remove discovery addresses, maybe not so bad... but will at some point probably require manual cleanup.
# Copyright (c) 2016 Pure Storage, 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
diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py
index 0da9e26..6e1f7a5 100644
--- a/cinder/volume/driver.py
+++ b/cinder/volume/driver.py
@@ -30,6 +30,7 @@ from cinder.i18n import _, _LE, _LW
from cinder.image import image_utils
from cinder import objects
from cinder import utils
+from cinder.volume import driver_utils
from cinder.volume import rpcapi as volume_rpcapi
#!/usr/bin/env python
# Copyright (c) 2015 Pure Storage, 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
diff --git a/cinder/db/api.py b/cinder/db/api.py
index 73a48cf..5fc5566 100644
--- a/cinder/db/api.py
+++ b/cinder/db/api.py
@@ -1071,14 +1071,25 @@ def get_booleans_for_table(table_name):
###################
-def driver_initiator_data_update(context, initiator, namespace, updates):
- """Create DriverPrivateData from the values dictionary."""
commit a654e58c5c25cbf2baade37bebb2eda9388444c5
Author: Patrick East <patrick.east@purestorage.com>
Date: Fri Aug 19 18:50:04 2016 -0700
Kilo back-port of the iSCSI multipath enhancements
Inspired by https://github.com/openstack/cinder/commit/72273183871a244426f3237118a9002aa53063e7
diff --git a/cinder/tests/test_pure.py b/cinder/tests/test_pure.py
index 2157ce6..b97b6a3 100644
### Pure Storage Individual Contributor License Agreement ("Agreement") via GitHub CLA Assistant
Thank you for your interest in Pure Storage Inc. (the "Company"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Company must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Company and its users; it does not change your rights to use your own Contributions for any other purpose.
Please read this document carefully before accepting and keep a copy for your records. This agreement can be completed and accepted via GitHub CLA Assistant, OR by printing, signing, and mailing to:
Pure Storage, Attn: Legal OpenSource, 650 Castro St #200, Mountain View, CA 94041, U.S.A.
Full name: ______________________________________________________
(optional) Public name: ______________