[feature request] iSCSI initiator name export over the relation

Bug #1930425 reported by Vladimir Grevtsev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Nova Compute Charm
New
Undecided
Unassigned

Bug Description

== Problem statement

There is neither no way to dynamically generate the iSCSI initiator list somewhere externally, nor change it with some predictable value.

== Rationale

I'm working now on the cloud which has external Huawei OceanStor storage array; and the upstream driver doesn't have a default PortGroup option - it has only the "DefaultTargetIP" option. While the option itself could accept multiple IPs:

https://github.com/openstack/cinder/blob/stable/ussuri/cinder/volume/drivers/huawei/huawei_conf.py#L280-L283

text = xml_root.findtext('iSCSI/DefaultTargetIP')
if text:
    iscsi_info['default_target_ips'] = [
        ip.strip() for ip in text.split(';') if ip.strip()]

It's still using only the first one supplied, ignoring others:

https://github.com/openstack/cinder/blob/stable/ussuri/cinder/volume/drivers/huawei/rest_client.py#L1345

default_target_ips = self.iscsi_info['default_target_ips']
if default_target_ips:
    target_ips.append(default_target_ips[0])

The only viable approach currently is to use the PortGroup configuration on the storage array side, since it is supported by the driver: https://github.com/openstack/cinder/blob/stable/ussuri/cinder/volume/drivers/huawei/rest_client.py#L1303

temp_tgt_ips = self._get_tgt_ip_from_portgroup(portgroup_id)
valid_port_info = self._get_tgt_port_ip_from_rest()
valid_tgt_ips = valid_port_info

for ip in temp_tgt_ips:
    if ip in valid_tgt_ips:
        target_ips.append(ip)

From the storage array point of view, PortGroup is a logical grouping of multiple storage controller interfaces, and driver is querying storage array's API to get all of those IPs:

https://github.com/openstack/cinder/blob/stable/ussuri/cinder/volume/drivers/huawei/rest_client.py#L1303

temp_tgt_ips = self._get_tgt_ip_from_portgroup(portgroup_id)
valid_port_info = self._get_tgt_port_ip_from_rest()
valid_tgt_ips = valid_port_info

for ip in temp_tgt_ips:
    if ip in valid_tgt_ips:
        target_ips.append(ip)

This is required in order to let driver initialize multiple iSCSI sessions to the same storage array, enabling the iSCSI multipathing effectively.

However, there is no way to specify a default PortGroup - it could only be specified per-initiator (read: per compute host), requiring an InitiatorName to be provided in the driver config:

https://docs.openstack.org/cinder/ussuri/configuration/block-storage/drivers/huawei-storage-driver.html

"To configure iSCSI Multipathing, follow the steps below:

Add the port group settings in the Huawei-customized driver configuration file and configure the port group name needed by an initiator.

<iSCSI>
   <DefaultTargetIP>x.x.x.x</DefaultTargetIP>
   <Initiator Name="xxxxxx" TargetPortGroup="xxxx" /> <---- "Name" option has to contain initiator name from
</iSCSI>"

Currently, we are workarounding this issue by supplying all of the initiators manually to the charm via the following snippet:

juju run -m openstack --application nova-compute --format=json "sudo cat /etc/iscsi/initiatorname.iscsi | grep InitiatorName=" | jq ".[] | .Stdout" | tr -d '"' | sed -e 's/\\n//g;s/InitiatorName=//g' | paste -sd ";" -

However, it would be nice to have an option to create a relation between cinder backend charm and nova-compute to get this information dynamically.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.