If a 'keyring' key is found in the connection info passed to
connect_volume() use its value as the path to the keyring instead of the
default location (/etc/ceph/<cluster>.client.<user>.keyring).
This allows services such as cinder's RBD and Ceph backup drivers to
make use of a custom keyring path that an admin has defined.
Change-Id: Ib1230d3e40f56371567e1aead40db59667bad295
Closes-bug: #1668304
This ensures that if a failure occurs with any of the linuxrbd calls,
the temp config file is still removed.
This also gives it a prefix so it is identifiable.
Change-Id: Ief3d907092e77c48a531a6ae78b10c58cc6db56c
When using ipv6, the IP address must be enclosed in square brackets
according to RFC 3986, Section 3.2.2. Without this, an ipv6 cloud will
fail to connect to the ceph cluster prior to backup because the address
and port are not parsed correctly.
Closes-Bug: #1640914
Change-Id: I6501c7cdac38fe545d12e786448a8e0c0a4f6a25
Some of tests use different method of assertTrue(isinstance(A, B))
The correct way is to use assertIsInstance(A, B) provided by testtools
Change-Id: Iaa27afbd59ed00a8254df96794f0c38bc408a239
If we run a command that returns non ascii character on stdout or stderr
using _execute attribute from Executor class or any of the inheriting
classes and we try to use stdout or stderr in the logs without decoding
it first, it will results in an exception like:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
19: ordinal not in range(128)
In existing code this can happen in quite a lot of places, and not only
where we are logging an error but also when we are logging progress or
debug information.
For example when running dd we could get in stdout:
1+0 registros leídos
1+0 registros escritos
512 bytes (512 B) copiados, 0,000368406 s, 1,4 MB/s
Instead of decoding stdout and stderr whenever we want to use them, this
patch takes another approach, capturing ProcessExecutionError exceptions
and converting string field to unicode and converting returned values of
the execution as well. That way we can safely use the exception
contents and returned values anywhere in the code.
Closes-Bug: #1602346
Change-Id: I46d8a47ae4f638dbb4b0dc125008bceb0f29fa15
Current RBD connector assumes ceph cluster name to be 'ceph', for
cluster has a different name, the backup manager won't be able
to connect to the ceph cluster.
This fix creates temporary ceph conf file to include mon_hosts and
client section for cinder user to specify keyring path, the same conf
file will be passed to linux rbd initiator to connect to ceph cluster
and the temp file will be deleted.
The temporary conf will have required info required to
connect to ceph cluster like
mon_hosts = <ip>:<port>
[client.<user>]
keyring = <user_keyring_path>
This fix assumes that the keyring for ceph cinder volume
user will exist in /etc/ceph/ directory
Change-Id: Ie7583fff22e2b54324e70f89d9df98a3a6b99e7b
Closes-Bug: #1609659
All string args used with librbd must be None or utf-8 otherwise
librbd will break. This patch uses convert_str instead of
oslo_utils.encodeutils.
Change-Id: I77aad9f8ddd1b7175ee1521a43d16511059a9ad0
Closes-Bug: #1612290
This is a larger refactor of the connector.py file. The goal is to
simplfy the file by moving the vendor connector classes to their own
files, and keep only the InitiatorConnector in the connector.py file.
The vendor specific connector tests are also split out into their own
files.
Change-Id: I020e75ca8cd8bec2ad1b38f3ade5cc1f63a4fee5
Implements: bp connector-refactor