cinder store: pass ip instead of hostname to os-brick

Bug #1955668 reported by Rajat Dhasmana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glance_store
Fix Released
Undecided
Rajat Dhasmana

Bug Description

When using iscsi backend cinder and cinder as a glance backend, we can see that glance_store sends the hostname of the node instead of the ip address to os_brick get_connector_properties function causing the image create operation to fail

2021-12-23 16:05:21.451 143 ERROR cinder.volume.manager The IP address is not valid. Please specify an IPv4 address in dotted-decimal format or an IPv6 address in colon-hexadecimal format. Loopback and unspecified (all zeros) addresses are not allowed.
2021-12-23 16:05:21.451 143 ERROR cinder.volume.manager Too few or invalid command line parameters
2021-12-23 16:05:21.451 143 ERROR cinder.volume.manager

Changed in glance-store:
status: New → In Progress
Changed in glance-store:
assignee: nobody → Rajat Dhasmana (whoami-rajat)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance_store (master)

Reviewed: https://review.opendev.org/c/openstack/glance_store/+/822828
Committed: https://opendev.org/openstack/glance_store/commit/8b4d97a6f7ce0805a430dac6756495db7a5aacb4
Submitter: "Zuul (22348)"
Branch: master

commit 8b4d97a6f7ce0805a430dac6756495db7a5aacb4
Author: whoami-rajat <email address hidden>
Date: Thu Dec 23 12:46:32 2021 +0000

    Pass valid IP address to os-brick

    While fetching connector information the cinder driver of
    glance-store is passing 'hostname' as IP address whereas it
    actually needs IP address.

    This path fetches the IPV4 or IPV6 address from the available
    'hostname' and passes it to os-brick.

    This worked for other cinder backends which don't rely specifically
    on IP address for initializing connection like fibre channel, nfs etc
    and even for some iscsi backends since, in some environments,
    the hostname is same as the ip address. This is not the case always
    and we should pass the correct IPv4/IPv6 address of the host to
    avoid this issue.

    Closes-Bug: #1955668

    Change-Id: Ic79815972e654a8bfe2775f57c68cfa0bf115e2f

Changed in glance-store:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance_store (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/glance_store/+/822937

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance_store (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/glance_store/+/822937
Committed: https://opendev.org/openstack/glance_store/commit/83d9c5dc2e4ca4edb29970d0543f7e9c574c0911
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 83d9c5dc2e4ca4edb29970d0543f7e9c574c0911
Author: whoami-rajat <email address hidden>
Date: Thu Dec 23 12:46:32 2021 +0000

    Pass valid IP address to os-brick

    While fetching connector information the cinder driver of
    glance-store is passing 'hostname' as IP address whereas it
    actually needs IP address.

    This path fetches the IPV4 or IPV6 address from the available
    'hostname' and passes it to os-brick.

    This worked for other cinder backends which don't rely specifically
    on IP address for initializing connection like fibre channel, nfs etc
    and even for some iscsi backends since, in some environments,
    the hostname is same as the ip address. This is not the case always
    and we should pass the correct IPv4/IPv6 address of the host to
    avoid this issue.

    Closes-Bug: #1955668

    Change-Id: Ic79815972e654a8bfe2775f57c68cfa0bf115e2f
    (cherry picked from commit 8b4d97a6f7ce0805a430dac6756495db7a5aacb4)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance_store (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/glance_store/+/823038

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance_store (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/glance_store/+/823038
Committed: https://opendev.org/openstack/glance_store/commit/2bc17c0a9e35882d047c20acd2da603a052ce099
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 2bc17c0a9e35882d047c20acd2da603a052ce099
Author: whoami-rajat <email address hidden>
Date: Thu Dec 23 12:46:32 2021 +0000

    Pass valid IP address to os-brick

    While fetching connector information the cinder driver of
    glance-store is passing 'hostname' as IP address whereas it
    actually needs IP address.

    This path fetches the IPV4 or IPV6 address from the available
    'hostname' and passes it to os-brick.

    This worked for other cinder backends which don't rely specifically
    on IP address for initializing connection like fibre channel, nfs etc
    and even for some iscsi backends since, in some environments,
    the hostname is same as the ip address. This is not the case always
    and we should pass the correct IPv4/IPv6 address of the host to
    avoid this issue.

    Closes-Bug: #1955668

    Change-Id: Ic79815972e654a8bfe2775f57c68cfa0bf115e2f
    (cherry picked from commit 8b4d97a6f7ce0805a430dac6756495db7a5aacb4)
    (cherry picked from commit 83d9c5dc2e4ca4edb29970d0543f7e9c574c0911)
    Conflicts:
            glance_store/_drivers/cinder.py
            glance_store/tests/unit/test_cinder_store.py
            glance_store/tests/unit/test_multistore_cinder.py

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance_store 3.0.0

This issue was fixed in the openstack/glance_store 3.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance_store 2.7.1

This issue was fixed in the openstack/glance_store 2.7.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance_store 2.5.1

This issue was fixed in the openstack/glance_store 2.5.1 release.

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.