lolwww / charm-cinder-oceanstor Goto Github PK
View Code? Open in Web Editor NEWHuawei Oceanstor Cinder backend support for a Juju/Charms deployed OpenStack
Huawei Oceanstor Cinder backend support for a Juju/Charms deployed OpenStack
When considering a scenario where cinder-volume is NOT co-located with nova-compute, the storage backend subordinate charm is expected to request additional package installation especially initiator and/or multipath related ones.
cinder-volume.log will be flooded with a TLS verification warning for every single REST call as follows:
2021-08-17 20:30:10.739 2076401 DEBUG oslo_concurrency.lockutils (...) Lock "huawei_cinder_call" acquired by "cinder.volume.drivers.huawei.rest_client.RestClient.call" :: waited 0.000s inner /usr/lib/python3/dist-packages/oslo_concurrency/lockutils.py:354
2021-08-17 20:30:10.740 2076401 WARNING py.warnings (...) /usr/lib/python3/dist-packages/urllib3/connectionpool.py:999: InsecureRequestWarning: Unverified HTTPS request is being made to host 'FQDN'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
It looks like the driver has a config around verification and it seems the default is False. We might want to tweak the config and similar ones to properly verify the cert as an enhancement from the current scheme.
My gut feeling is that this code block should be conditioned when_not(update-status).
charm-cinder-oceanstor/src/reactive/cinder_oceanstor_handlers.py
Lines 42 to 45 in c839af5
$ journalctl -u cinder-volume.service
...
Jul 04 14:00:16 cloud-node-003 systemd[1]: Stopping OpenStack Cinder Volume...
Jul 04 14:00:16 cloud-node-003 systemd[1]: cinder-volume.service: Succeeded.
Jul 04 14:00:16 cloud-node-003 systemd[1]: Stopped OpenStack Cinder Volume.
Jul 04 14:00:16 cloud-node-003 systemd[1]: Started OpenStack Cinder Volume.
Jul 04 14:05:36 cloud-node-003 systemd[1]: Stopping OpenStack Cinder Volume...
Jul 04 14:05:36 cloud-node-003 systemd[1]: cinder-volume.service: Succeeded.
Jul 04 14:05:36 cloud-node-003 systemd[1]: Stopped OpenStack Cinder Volume.
Jul 04 14:05:36 cloud-node-003 systemd[1]: Started OpenStack Cinder Volume.
Jul 04 14:10:37 cloud-node-003 systemd[1]: Stopping OpenStack Cinder Volume...
Jul 04 14:10:37 cloud-node-003 systemd[1]: cinder-volume.service: Succeeded.
Jul 04 14:10:37 cloud-node-003 systemd[1]: Stopped OpenStack Cinder Volume.
Jul 04 14:10:37 cloud-node-003 systemd[1]: Started OpenStack Cinder Volume.
iscsiinitiators is None by default. We can set ''(empty string) to the config in the bundle, but it's dangerous since if we run the bundle again, then it will reset iscsiinitiators to empty even if it's set by an operator.
unit-cinder-oceanstor-0: 09:17:06 INFO unit.cinder-oceanstor/0.juju-log storage-backend:227: Invoking reactive handler: reactive/cinder_oceanstor_handlers.py:47:render_config
unit-cinder-oceanstor-0: 09:17:06 ERROR unit.cinder-oceanstor/0.juju-log storage-backend:227: Hook error:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/__init__.py", line 74, in main
bus.dispatch(restricted=restricted_mode)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 390, in dispatch
_invoke(other_handlers)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 359, in _invoke
handler.invoke()
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 181, in invoke
self._action(*args)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/charm/reactive/cinder_oceanstor_handlers.py", line 55, in render_config
charm.render_with_interfaces(args)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms_openstack/charm/core.py", line 994, in render_with_interfaces
self.render_configs(
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms_openstack/charm/core.py", line 975, in render_configs
_render(os.path.basename(conf))
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms_openstack/charm/core.py", line 964, in _render
charmhelpers.core.templating.render(
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charmhelpers/core/templating.py", line 85, in render
content = template.render(context)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/jinja2/asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "templates/cinder_huawei_conf.xml", line 24, in <module>
{% set initiators = options.iscsiinitiators.split(';') %}
jinja2.exceptions.UndefinedError: 'None' has no attribute 'split'
What I deploy this charm along with cinder which runs on dedicated ceph nodes, I need to run "systemctl restart iscsid" to make server create boot from volume working.
When a bundle is not used with per-populated configs, it fails at:
2021-09-10 01:33:52 INFO unit.cinder-oceanstor/0.juju-log server.go:325 storage-backend:2: Reactive main running for hook storage-backend-relation-joined
2021-09-10 01:33:52 ERROR unit.cinder-oceanstor/0.juju-log server.go:325 storage-backend:2: Unable to find implementation for relation: requires of juju-info
2021-09-10 01:33:52 INFO unit.cinder-oceanstor/0.juju-log server.go:325 storage-backend:2: Invoking reactive handler: hooks/relations/cinder-backend/provides.py:16:cinder_backend_joined
2021-09-10 01:33:52 INFO unit.cinder-oceanstor/0.juju-log server.go:325 storage-backend:2: Invoking reactive handler: reactive/cinder_oceanstor_handlers.py:45:driver_config
2021-09-10 01:33:52 INFO unit.cinder-oceanstor/0.juju-log server.go:325 storage-backend:2: Invoking reactive handler: reactive/layer_openstack.py:101:run_storage_backend
2021-09-10 01:33:52 ERROR unit.cinder-oceanstor/0.juju-log server.go:325 storage-backend:2: Hook error:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/__init__.py", line 74, in main
bus.dispatch(restricted=restricted_mode)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 390, in dispatch
_invoke(other_handlers)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 359, in _invoke
handler.invoke()
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 181, in invoke
self._action(*args)
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/charm/reactive/layer_openstack.py", line 105, in run_storage_backend
instance.send_storage_backend_data()
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/.venv/lib/python3.8/site-packages/charms_openstack/charm/classes.py", line 1095, in send_storage_backend_data
configuration=self.cinder_configuration(),
File "/var/lib/juju/agents/unit-cinder-oceanstor-0/charm/lib/charm/openstack/cinder_oceanstor.py", line 36, in cinder_configuration
self.config['username'] = self.config.get('username').strip()
AttributeError: 'NoneType' object has no attribute 'strip'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.