Hello community, here is the log from the commit of package ceph-iscsi for openSUSE:Factory checked in at 2019-05-10 09:19:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ceph-iscsi (Old) and /work/SRC/openSUSE:Factory/.ceph-iscsi.new.5148 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ceph-iscsi" Fri May 10 09:19:57 2019 rev:11 rq:701825 version:3.0+1557415271.g940ac86 Changes: -------- --- /work/SRC/openSUSE:Factory/ceph-iscsi/ceph-iscsi.changes 2019-04-30 13:06:38.421556649 +0200 +++ /work/SRC/openSUSE:Factory/.ceph-iscsi.new.5148/ceph-iscsi.changes 2019-05-10 09:20:01.400495426 +0200 @@ -1,0 +2,14 @@ +Thu May 9 15:21:26 UTC 2019 - Nathan Cutler <ncut...@suse.com> + +- Update to 3.0+1557415271.g940ac86: + + Fix race condition on target disk add (bsc#1134479) + +------------------------------------------------------------------- +Thu May 9 10:28:06 UTC 2019 - Nathan Cutler <ncut...@suse.com> + +- Update to 3.0+1557397680.g929bd14: + + logger level is now configurable + + tcmu-runner supports all RBD features + + allow deletion of a target that doesn't exist in LIO + +------------------------------------------------------------------- Old: ---- ceph-iscsi-3.0+1556546618.g28a0e8a.tar.gz New: ---- ceph-iscsi-3.0+1557415271.g940ac86.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ceph-iscsi.spec ++++++ --- /var/tmp/diff_new_pack.XFfL6B/_old 2019-05-10 09:20:02.456498374 +0200 +++ /var/tmp/diff_new_pack.XFfL6B/_new 2019-05-10 09:20:02.460498385 +0200 @@ -20,7 +20,7 @@ Name: ceph-iscsi -Version: 3.0+1556546618.g28a0e8a +Version: 3.0+1557415271.g940ac86 Release: 1%{?dist} Group: System/Filesystems Summary: Python modules for Ceph iSCSI gateway configuration management @@ -72,7 +72,8 @@ %endif %endif -BuildRequires: systemd +BuildRequires: systemd-rpm-macros +%{?systemd_requires} %description Python package providing the modules used to handle the configuration of an @@ -136,22 +137,26 @@ %post %if 0%{?fedora} || 0%{?rhel} -/bin/systemctl --system daemon-reload &> /dev/null || : -/bin/systemctl --system enable rbd-target-gw &> /dev/null || : -/bin/systemctl --system enable rbd-target-api &> /dev/null || : +%systemd_post rbd-target-gw.service +%systemd_post rbd-target-api.service %endif %if 0%{?suse_version} %service_add_post rbd-target-gw.service rbd-target-api.service %endif %preun +%if 0%{?fedora} || 0%{?rhel} +%systemd_preun rbd-target-gw.service +%systemd_preun rbd-target-api.service +%endif %if 0%{?suse_version} %service_del_preun rbd-target-gw.service rbd-target-api.service %endif %postun %if 0%{?fedora} || 0%{?rhel} -/bin/systemctl --system daemon-reload &> /dev/null || : +%systemd_postun rbd-target-gw.service +%systemd_postun rbd-target-api.service %endif %if 0%{?suse_version} %service_del_postun rbd-target-gw.service rbd-target-api.service ++++++ ceph-iscsi-3.0+1556546618.g28a0e8a.tar.gz -> ceph-iscsi-3.0+1557415271.g940ac86.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/README new/ceph-iscsi-3.0+1557415271.g940ac86/README --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/README 2019-04-29 16:03:38.107642273 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/README 2019-05-09 17:21:11.195630881 +0200 @@ -1,7 +1,7 @@ This project provides the common logic and CLI tools for creating and managing LIO gateways for Ceph. -It includes the ```rbd-target-gw``` daemon which is responsible for restoring +It includes the ```rbd-target-api``` daemon which is responsible for restoring the state of LIO following a gateway reboot/outage and replaces the existing 'target' service. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/README.md new/ceph-iscsi-3.0+1557415271.g940ac86/README.md --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/README.md 2019-04-29 16:03:38.107642273 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/README.md 2019-05-09 17:21:11.195630881 +0200 @@ -2,10 +2,14 @@ This project provides the common logic and CLI tools for creating and managing LIO gateways for Ceph. -It includes the ```rbd-target-gw``` daemon which is responsible for restoring -the state of LIO following a gateway reboot/outage and replaces the existing +It includes the ```rbd-target-api``` daemon which is responsible for restoring +the state of LIO following a gateway reboot/outage and exporting a REST API +to configure the system using tools like gwcli. It replaces the existing 'target' service. +There is also a second daemon ```rbd-target-gw``` which exports a REST API +to gather statistics. + It also includes the CLI tool ```gwcli``` which can be used to configure and manage the Ceph iSCSI gateway, which replaces the existing ```targetcli``` CLI tool. This CLI tool utilizes the ```rbd-target-api``` server daemon to @@ -14,8 +18,7 @@ ## Usage This package should be installed on each node that is intended to be an iSCSI gateway. The Python ```ceph_iscsi_config``` modules are used by: -* the **rbd-target-gw** daemon to restore LIO state at boot time -* **Ansible** modules defined in the ceph-iscsi-ansible project at https://github.com/pcuzner/ceph-ansible +* the **rbd-target-api** daemon to restore LIO state at boot time * **API/CLI** configuration tools ## Installation @@ -25,7 +28,7 @@ ### Manually The following packages are required by ceph-iscsi-config and must be -installed before starting the rbd-target-gw service: +installed before starting the rbd-target-api and rbd-target-gw services: python-rados python-rbd @@ -49,10 +52,10 @@ Once the daemon is in place, reload the configuration with ``` systemctl daemon-reload -systemctl enable rbd-target-gw -systemctl start rbd-target-gw systemctl enable rbd-target-api +systemctl enable rbd-target-gw systemctl start rbd-target-api +systemctl start rbd-target-gw ``` ## Features @@ -66,7 +69,7 @@ | **lun** | rbd image management (create/resize), combined with mapping to the OS and LIO instance | | **utils** | common code called by multiple modules | -The rbd-target-gw daemon performs the following tasks; +The rbd-target-api daemon performs the following tasks; 1. At start up remove any osd blacklist entry that may apply to the running host 2. Read the configuration object from Rados 3. Process the configuration @@ -75,6 +78,6 @@ 3.3 Create the iscsi target, TPG's and port IP's 3.4 Define clients (NodeACL's) 3.5 add the required rbd images to clients - + 4. Export a REST API for system configuration. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph-iscsi.spec new/ceph-iscsi-3.0+1557415271.g940ac86/ceph-iscsi.spec --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph-iscsi.spec 2019-04-29 16:03:38.399644158 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/ceph-iscsi.spec 2019-05-09 17:21:11.431632500 +0200 @@ -20,7 +20,7 @@ Name: ceph-iscsi -Version: 3.0+1556546618.g28a0e8a +Version: 3.0+1557415271.g940ac86 Release: 1%{?dist} Group: System/Filesystems Summary: Python modules for Ceph iSCSI gateway configuration management @@ -72,7 +72,8 @@ %endif %endif -BuildRequires: systemd +BuildRequires: systemd-rpm-macros +%{?systemd_requires} %description Python package providing the modules used to handle the configuration of an @@ -136,22 +137,26 @@ %post %if 0%{?fedora} || 0%{?rhel} -/bin/systemctl --system daemon-reload &> /dev/null || : -/bin/systemctl --system enable rbd-target-gw &> /dev/null || : -/bin/systemctl --system enable rbd-target-api &> /dev/null || : +%systemd_post rbd-target-gw.service +%systemd_post rbd-target-api.service %endif %if 0%{?suse_version} %service_add_post rbd-target-gw.service rbd-target-api.service %endif %preun +%if 0%{?fedora} || 0%{?rhel} +%systemd_preun rbd-target-gw.service +%systemd_preun rbd-target-api.service +%endif %if 0%{?suse_version} %service_del_preun rbd-target-gw.service rbd-target-api.service %endif %postun %if 0%{?fedora} || 0%{?rhel} -/bin/systemctl --system daemon-reload &> /dev/null || : +%systemd_postun rbd-target-gw.service +%systemd_postun rbd-target-api.service %endif %if 0%{?suse_version} %service_del_postun rbd-target-gw.service rbd-target-api.service diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/client.py new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/client.py --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/client.py 2019-04-29 16:03:38.107642273 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/client.py 2019-05-09 17:21:11.195630881 +0200 @@ -9,7 +9,7 @@ from socket import gethostname from rtslib_fb.target import NodeACL, Target, TPG from rtslib_fb.fabric import ISCSIFabricModule -from rtslib_fb.utils import RTSLibError, normalize_wwn +from rtslib_fb.utils import RTSLibError, RTSLibNotInCFS, normalize_wwn import ceph_iscsi_config.settings as settings @@ -242,7 +242,10 @@ "ip_address": [] } iscsi_fabric = ISCSIFabricModule() - target = Target(iscsi_fabric, target_iqn, 'lookup') + try: + target = Target(iscsi_fabric, target_iqn, 'lookup') + except RTSLibNotInCFS: + return result for tpg in target.tpgs: if tpg.enable: for client in tpg.node_acls: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/common.py new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/common.py --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/common.py 2019-04-29 16:03:38.107642273 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/common.py 2019-05-09 17:21:11.195630881 +0200 @@ -55,7 +55,7 @@ 'mutual_username': '', 'mutual_password': '', 'mutual_password_encryption_enabled': False}, - "version": 8, + "version": 9, "epoch": 0, "created": '', "updated": '' @@ -307,6 +307,14 @@ self.update_item("targets", target_iqn, target) self.update_item("version", None, 8) + if self.config['version'] == 8: + for target_iqn, target in self.config['targets'].items(): + for _, portal in target['portals'].items(): + portal['portal_ip_addresses'] = [portal['portal_ip_address']] + portal.pop('portal_ip_address') + self.update_item("targets", target_iqn, target) + self.update_item("version", None, 9) + self.commit("retain") def init_config(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/gateway.py new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/gateway.py --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/gateway.py 2019-04-29 16:03:38.107642273 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/gateway.py 2019-05-09 17:21:11.195630881 +0200 @@ -338,16 +338,18 @@ if target_config: local_gw = target_config['portals'].get(self.hostname) if local_gw: - local_gw_ip = local_gw['portal_ip_address'] + local_gw_ips = local_gw['portal_ip_addresses'] target_config['portals'].pop(self.hostname) ip_list = target_config['ip_list'] - ip_list.remove(local_gw_ip) + for local_gw_ip in local_gw_ips: + ip_list.remove(local_gw_ip) for _, remote_gw_config in target_config['portals'].items(): - remote_gw_config["gateway_ip_list"].remove(local_gw_ip) - remote_gw_config["inactive_portal_ips"].remove(local_gw_ip) + for local_gw_ip in local_gw_ips: + remote_gw_config["gateway_ip_list"].remove(local_gw_ip) + remote_gw_config["inactive_portal_ips"].remove(local_gw_ip) tpg_count = remote_gw_config["tpgs"] remote_gw_config["tpgs"] = tpg_count - 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/lun.py new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/lun.py --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/lun.py 2019-04-29 16:03:38.111642298 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/lun.py 2019-05-09 17:21:11.195630881 +0200 @@ -29,7 +29,19 @@ class RBDDev(object): - rbd_feature_list = { + unsupported_features_list = { + USER_RBD: [], + RBD: [ + # TODO Uncomment after PR https://github.com/ceph/ceph/pull/28009 + # 'RBD_FEATURE_MIGRATING', + 'RBD_FEATURE_OBJECT_MAP', + 'RBD_FEATURE_FAST_DIFF', + 'RBD_FEATURE_DEEP_FLATTEN', + 'RBD_FEATURE_JOURNALING' + ] + } + + default_features_list = { USER_RBD: [ 'RBD_FEATURE_LAYERING', 'RBD_FEATURE_EXCLUSIVE_LOCK', @@ -38,10 +50,7 @@ 'RBD_FEATURE_DEEP_FLATTEN' ], RBD: [ - 'RBD_FEATURE_LAYERING', - 'RBD_FEATURE_STRIPINGV2', - 'RBD_FEATURE_EXCLUSIVE_LOCK', - 'RBD_FEATURE_DATA_POOL' + 'RBD_FEATURE_LAYERING' ] } @@ -79,7 +88,7 @@ rbd_inst.create(ioctx, self.image, self.size_bytes, - features=RBDDev.supported_features(self.backstore), + features=RBDDev.default_features(self.backstore), old_format=False) except (rbd.ImageExists, rbd.InvalidArgument) as err: @@ -238,14 +247,27 @@ return valid_state @classmethod - def supported_features(cls, backstore): + def unsupported_features(cls, backstore): + """ + Return an int representing the unsupported features for LIO export + :return: int + """ + # build the required feature settings into an int + feature_int = 0 + for feature in RBDDev.unsupported_features_list[backstore]: + feature_int += getattr(rbd, feature) + + return feature_int + + @classmethod + def default_features(cls, backstore): """ - Return an int representing the supported features for LIO export + Return an int representing the default features for image creation :return: int """ # build the required feature settings into an int feature_int = 0 - for feature in RBDDev.rbd_feature_list[backstore]: + for feature in RBDDev.default_features_list[backstore]: feature_int += getattr(rbd, feature) return feature_int @@ -656,9 +678,9 @@ else: # rbd image is not valid for export, so abort self.error = True - features = ','.join(RBDDev.rbd_feature_list[self.backstore]) + features = ','.join(RBDDev.unsupported_features_list[self.backstore]) self.error_msg = ("(LUN.allocate) rbd '{}' is not compatible " - "with LIO\nOnly image features {} are" + "with LIO\nImage features {} are not" " supported".format(self.image, features)) self.logger.error(self.error_msg) return None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/settings.py new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/settings.py --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/settings.py 2019-04-29 16:03:38.111642298 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/settings.py 2019-05-09 17:21:11.199630908 +0200 @@ -7,6 +7,7 @@ from configparser import ConfigParser from distutils.util import strtobool +import logging import re @@ -113,7 +114,8 @@ "pub_key": 'iscsi-gateway-pub.key', "prometheus_exporter": "true", "prometheus_port": 9287, - "prometheus_host": "::" + "prometheus_host": "::", + "logger_level": logging.DEBUG } target_defaults = {"osd_op_timeout": 30, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/target.py new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/target.py --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/ceph_iscsi_config/target.py 2019-04-29 16:03:38.111642298 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/ceph_iscsi_config/target.py 2019-05-09 17:21:11.199630908 +0200 @@ -86,9 +86,9 @@ " any ip on this host") return - self.active_portal_ip = list(matching_ip)[0] + self.active_portal_ips = list(matching_ip) self.logger.debug("active portal will use " - "{}".format(self.active_portal_ip)) + "{}".format(self.active_portal_ips)) self.gateway_ip_list = gateway_ip_list self.logger.debug("tpg's will be defined in this order" @@ -97,7 +97,7 @@ # without gateway_ip_list passed in this is a 'init' or # 'clearconfig' request self.gateway_ip_list = [] - self.active_portal_ip = [] + self.active_portal_ips = [] self.changes_made = False self.config_updated = False @@ -205,25 +205,25 @@ :return: None """ + index = 0 for tpg in self.tpg_list: if tpg._get_enable(): for lun in tpg.luns: try: self.bind_alua_group_to_lun(config, lun, - tpg_ip_address=self.active_portal_ip) + tpg_ip_address=self.active_portal_ips[index]) except CephiSCSIInval as err: self.error = True self.error_msg = err return try: - NetworkPortal(tpg, normalize_ip_literal(self.active_portal_ip)) + NetworkPortal(tpg, normalize_ip_literal(self.active_portal_ips[index])) except RTSLibError as e: self.error = True self.error_msg = e - else: - break + index += 1 def clear_config(self, config): """ @@ -276,7 +276,7 @@ self.logger.debug("(Gateway.create_tpg) Added tpg for portal " "ip {}".format(ip)) - if ip == self.active_portal_ip: + if ip in self.active_portal_ips: if self.enable_portal: NetworkPortal(tpg, normalize_ip_literal(ip)) tpg.enable = True @@ -410,7 +410,7 @@ # they do not have a common gw the owning gw may not exist here. # The LUN will just have all ANO paths then. if gw_config: - if gw_config["portal_ip_address"] == tpg_ip_address: + if gw_config["portal_ip_addresses"][0] == tpg_ip_address: is_owner = True try: @@ -602,7 +602,8 @@ continue inactive_portal_ip = list(self.gateway_ip_list) - inactive_portal_ip.remove(remote_gw_config["portal_ip_address"]) + for portal_ip_address in remote_gw_config["portal_ip_addresses"]: + inactive_portal_ip.remove(portal_ip_address) remote_gw_config['gateway_ip_list'] = self.gateway_ip_list remote_gw_config['tpgs'] = len(self.tpg_list) remote_gw_config['inactive_portal_ips'] = inactive_portal_ip @@ -610,11 +611,12 @@ # Add the new gw inactive_portal_ip = list(self.gateway_ip_list) - inactive_portal_ip.remove(self.active_portal_ip) + for active_portal_ip in self.active_portal_ips: + inactive_portal_ip.remove(active_portal_ip) portal_metadata = {"tpgs": len(self.tpg_list), "gateway_ip_list": self.gateway_ip_list, - "portal_ip_address": self.active_portal_ip, + "portal_ip_addresses": self.active_portal_ips, "inactive_portal_ips": inactive_portal_ip} target_config['portals'][local_gw] = portal_metadata target_config['ip_list'] = self.gateway_ip_list @@ -678,41 +680,35 @@ # Called by API from CLI clearconfig command if self.exists(): self.load_config() + self.clear_config(config) + target_config = config.config["targets"][self.iqn] + if len(target_config['portals']) == 0: + config.del_item('targets', self.iqn) else: - self.error = True - self.error_msg = "Target {} does not exist on {}".format(self.iqn, local_gw) - return + gw_ips = target_config['portals'][local_gw]['portal_ip_addresses'] - target_config = config.config["targets"][self.iqn] - self.clear_config(config) + target_config['portals'].pop(local_gw) - if not self.error: - if len(target_config['portals']) == 0: - config.del_item('targets', self.iqn) + ip_list = target_config['ip_list'] + for gw_ip in gw_ips: + ip_list.remove(gw_ip) + if len(ip_list) > 0 and len(target_config['portals'].keys()) > 0: + config.update_item('targets', self.iqn, target_config) else: - gw_ip = target_config['portals'][local_gw]['portal_ip_address'] - - target_config['portals'].pop(local_gw) + # no more portals in the list, so delete the target + config.del_item('targets', self.iqn) - ip_list = target_config['ip_list'] - ip_list.remove(gw_ip) - if len(ip_list) > 0 and len(target_config['portals'].keys()) > 0: - config.update_item('targets', self.iqn, target_config) - else: - # no more portals in the list, so delete the target - config.del_item('targets', self.iqn) - - remove_gateway = True - for _, target in config.config["targets"].items(): - if local_gw in target['portals']: - remove_gateway = False - break - - if remove_gateway: - # gateway is no longer used, so delete it - config.del_item('gateways', local_gw) + remove_gateway = True + for _, target in config.config["targets"].items(): + if local_gw in target['portals']: + remove_gateway = False + break + + if remove_gateway: + # gateway is no longer used, so delete it + config.del_item('gateways', local_gw) - config.commit() + config.commit() @staticmethod def get_num_sessions(target_iqn): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/gwcli/gateway.py new/ceph-iscsi-3.0+1557415271.g940ac86/gwcli/gateway.py --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/gwcli/gateway.py 2019-04-29 16:03:38.111642298 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/gwcli/gateway.py 2019-05-09 17:21:11.199630908 +0200 @@ -779,7 +779,7 @@ display_attributes = ["name", "gateway_ip_list", - "portal_ip_address", + "portal_ip_addresses", "inactive_portal_ips", "tpgs", "service_state"] @@ -861,5 +861,5 @@ def summary(self): state = self.state - return "{} ({})".format(self.portal_ip_address, + return "{} ({})".format(','.join(self.portal_ip_addresses), state), (state == "UP") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/rbd-target-api.py new/ceph-iscsi-3.0+1557415271.g940ac86/rbd-target-api.py --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/rbd-target-api.py 2019-04-29 16:03:38.111642298 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/rbd-target-api.py 2019-05-09 17:21:11.199630908 +0200 @@ -830,6 +830,8 @@ **RESTRICTED** """ + config.refresh() + disk = request.form.get('disk') pool, image = disk.split('/', 1) disk_config = config.config['disks'][disk] @@ -2190,9 +2192,6 @@ target_config = config.config['targets'][target_iqn] if client_iqn not in target_config['clients']: return jsonify(message="Client {} does not exist".format(client_iqn)), 400 - local_gw = this_host() - if local_gw not in target_config['portals']: - return jsonify(message="{} is not a portal of target {}".format(local_gw, target_iqn)), 400 logged_in = GWClient.get_client_info(target_iqn, client_iqn) return jsonify(logged_in), 200 @@ -2364,19 +2363,19 @@ disk_default_controls = {} required_rbd_features = {} - supported_rbd_features = {} + unsupported_rbd_features = {} for backstore, ks in LUN.SETTINGS.items(): disk_default_controls[backstore] = {} for k in ks: default_val = getattr(settings.config, k, None) disk_default_controls[backstore][k] = default_val required_rbd_features[backstore] = RBDDev.required_features(backstore) - supported_rbd_features[backstore] = RBDDev.supported_features(backstore) + unsupported_rbd_features[backstore] = RBDDev.unsupported_features(backstore) return jsonify({ 'target_default_controls': target_default_controls, 'disk_default_controls': disk_default_controls, - 'supported_rbd_features': supported_rbd_features, + 'unsupported_rbd_features': unsupported_rbd_features, 'required_rbd_features': required_rbd_features, 'backstores': LUN.BACKSTORES, 'default_backstore': LUN.DEFAULT_BACKSTORE, @@ -2806,6 +2805,9 @@ if __name__ == '__main__': + settings.init() + logger_level = logging.getLevelName(settings.config.logger_level) + # Setup signal handlers for interaction with systemd signal.signal(signal.SIGTERM, signal_stop) signal.signal(signal.SIGHUP, signal_reload) @@ -2824,7 +2826,7 @@ file_handler = RotatingFileHandler('/var/log/rbd-target-api/rbd-target-api.log', maxBytes=5242880, backupCount=7) - file_handler.setLevel(logging.DEBUG) + file_handler.setLevel(logger_level) file_format = logging.Formatter( "%(asctime)s %(levelname)8s [%(filename)s:%(lineno)s:%(funcName)s()] " "- %(message)s") @@ -2833,8 +2835,6 @@ logger.addHandler(syslog_handler) logger.addHandler(file_handler) - settings.init() - # config is set in the outer scope, so it's easily accessible to all # api functions config = Config(logger) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/rbd-target-gw.py new/ceph-iscsi-3.0+1557415271.g940ac86/rbd-target-gw.py --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/rbd-target-gw.py 2019-04-29 16:03:38.111642298 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/rbd-target-gw.py 2019-05-09 17:21:11.199630908 +0200 @@ -62,6 +62,9 @@ if __name__ == '__main__': + settings.init() + logger_level = logging.getLevelName(settings.config.logger_level) + # setup syslog handler to help diagnostics logger = logging.getLogger('rbd-target-gw') logger.setLevel(logging.DEBUG) @@ -76,12 +79,11 @@ file_handler = RotatingFileHandler('/var/log/rbd-target-gw/rbd-target-gw.log', maxBytes=5242880, backupCount=7) - file_handler.setLevel(logging.DEBUG) + file_handler.setLevel(logger_level) file_format = logging.Formatter("%(asctime)s [%(levelname)8s] - %(message)s") file_handler.setFormatter(file_format) logger.addHandler(syslog_handler) logger.addHandler(file_handler) - settings.init() main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/test/test_common.py new/ceph-iscsi-3.0+1557415271.g940ac86/test/test_common.py --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/test/test_common.py 2019-04-29 16:03:38.111642298 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/test/test_common.py 2019-05-09 17:21:11.199630908 +0200 @@ -232,7 +232,7 @@ "inactive_portal_ips": [ "192.168.100.202" ], - "portal_ip_address": "192.168.100.201", + "portal_ip_addresses": ["192.168.100.201"], "tpgs": 2 }, "node2": { @@ -243,7 +243,7 @@ "inactive_portal_ips": [ "192.168.100.201" ], - "portal_ip_address": "192.168.100.202", + "portal_ip_addresses": ["192.168.100.202"], "tpgs": 2 } }, @@ -251,5 +251,5 @@ } }, "updated": "2018/12/07 09:18:13", - "version": 8 + "version": 9 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/usr/lib/systemd/system/rbd-target-api.service new/ceph-iscsi-3.0+1557415271.g940ac86/usr/lib/systemd/system/rbd-target-api.service --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/usr/lib/systemd/system/rbd-target-api.service 2019-04-29 16:03:38.111642298 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/usr/lib/systemd/system/rbd-target-api.service 2019-05-09 17:21:11.199630908 +0200 @@ -2,9 +2,8 @@ Description=Ceph iscsi target configuration API Requires=sys-kernel-config.mount -After=sys-kernel-config.mount network-online.target rbd-target-gw.service -BindsTo=rbd-target-gw.service -Wants=network-online.target +After=sys-kernel-config.mount network-online.target tcmu-runner.service +Wants=network-online.target rbd-target-gw.service tcmu-runner.service [Service] LimitNOFILE=1048576 @@ -22,6 +21,7 @@ Restart=on-failure StartLimitInterval=30min StartLimitBurst=3 +TimeoutStopSec=600 [Install] WantedBy=multi-user.target diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ceph-iscsi-3.0+1556546618.g28a0e8a/usr/lib/systemd/system/rbd-target-gw.service new/ceph-iscsi-3.0+1557415271.g940ac86/usr/lib/systemd/system/rbd-target-gw.service --- old/ceph-iscsi-3.0+1556546618.g28a0e8a/usr/lib/systemd/system/rbd-target-gw.service 2019-04-29 16:03:38.111642298 +0200 +++ new/ceph-iscsi-3.0+1557415271.g940ac86/usr/lib/systemd/system/rbd-target-gw.service 2019-05-09 17:21:11.199630908 +0200 @@ -2,8 +2,9 @@ Description=Setup system to export rbd images through LIO Requires=sys-kernel-config.mount -After=sys-kernel-config.mount network-online.target tcmu-runner.service -Wants=network-online.target tcmu-runner.service +After=sys-kernel-config.mount network-online.target rbd-target-api.service +Wants=network-online.target +BindsTo=rbd-target-api.service [Service] LimitNOFILE=1048576 @@ -22,7 +23,6 @@ Restart=on-failure StartLimitInterval=30min StartLimitBurst=3 -TimeoutStopSec=600 [Install] WantedBy=multi-user.target