[doc] Install and configure a storage node in cinder

Bug #1946645 reported by Francois Michaut
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Wishlist
Tushar Trambak Gite

Bug Description

This bug tracker is for errors with the documentation, use the following as a template and remove or add fields as you see fit. Convert [ ] into [x] to check boxes:

- [ ] This doc is inaccurate in this way: ______
- [x] This is a doc addition request.
- [ ] I have a fix to the document that I can paste below including example: input and output.

Following the cinder installation procedure resulted in errors when trying to create an instance with a volume from Horizon's interface.

Investigation the logs on the storage node (/var/log/cinder/cinder-volume.log), showed an error message :

```
2021-10-11 11:47:21.855 6690 WARNING cinder.volume.targets.tgt [req-60ba8d0a-7d61-49de-9382-bad746d75b61 e413de13f26c49568277fa624c60b15f efc348d57b714b78871b2238a3b9be9c - - -] Failed to create iscsi target for Volume ID: volume-a11d5c41-98ce-4e3e-984f-19e24ca19782. It could be caused by problem with concurrency. Also please ensure your tgtd config file contains 'include /var/lib/cinder/volumes/*'
2021-10-11 11:47:21.857 6690 ERROR cinder.volume.manager [req-60ba8d0a-7d61-49de-9382-bad746d75b61 e413de13f26c49568277fa624c60b15f efc348d57b714b78871b2238a3b9be9c - - -] Create export for volume failed (Resource could not be found.).: cinder.exception.NotFound: Resource could not be found.
```

By adding 'include /var/lib/cinder/volumes/*' in tgtd conf as suggested by the warning in the logs, and restarting tgt and cinder-volume services, the error disappears and creating instances with an attached volume is now working.

I think the 'include /var/lib/cinder/volumes/*' is missing from the documentation (at least for ubuntu) and should be added

-----------------------------------
Release: 18.1.1.dev3 on 2019-01-21 10:05:25
SHA: 6bd571abc3b55cc1684a06422fe20fe39e0d670f
Source: https://opendev.org/openstack/cinder/src/doc/source/install/cinder-storage-install-ubuntu.rst
URL: https://docs.openstack.org/cinder/wallaby/install/cinder-storage-install-ubuntu.html

summary: - Install and configure a storage node in cinder
+ [doc] Install and configure a storage node in cinder
tags: added: documentation
Changed in cinder:
importance: Undecided → Wishlist
Changed in cinder:
assignee: nobody → Tushar Trambak Gite (tushargite96)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/cinder/+/820994

Changed in cinder:
status: New → In Progress
Revision history for this message
Luigi Toscano (ltoscano) wrote :

devstack does something slightly different: it creates a symlink in /etc/tgt/stack.d.

Can you please check if this works for you?

# apply config.d approach for cinder volumes directory
function _configure_tgt_for_config_d {
    if [[ ! -d /etc/tgt/stack.d/ ]]; then
        sudo ln -sf $CINDER_STATE_PATH/volumes /etc/tgt/stack.d
    fi
    if ! grep -q "include /etc/tgt/stack.d/*" /etc/tgt/targets.conf; then
        echo "include /etc/tgt/stack.d/*" | sudo tee -a /etc/tgt/targets.conf
    fi
}

https://opendev.org/openstack/devstack/src/branch/master/lib/cinder#L500

Revision history for this message
Francois Michaut (fmichaut) wrote :

I just created a new configuration with a script containing the following and it works.

if [[ ! -d /etc/tgt/stack.d/ ]]; then
    ln -sf /var/lib/cinder/volumes /etc/tgt/stack.d
fi
if ! grep -q "include /etc/tgt/stack.d/*" /etc/tgt/targets.conf; then
    echo "include /etc/tgt/stack.d/*" | sudo tee -a /etc/tgt/targets.conf
fi

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/820994
Committed: https://opendev.org/openstack/cinder/commit/89de47b0d6354318f3775839c01dddac67d1961c
Submitter: "Zuul (22348)"
Branch: master

commit 89de47b0d6354318f3775839c01dddac67d1961c
Author: tushargite96 <email address hidden>
Date: Wed Dec 8 12:10:29 2021 +0530

    Configure a storage node in cinder

    The solution is already provided in the
    Troubleshoot the Block Storage configuration[1] if
    Block Storage service may have issues locating the
    persistent tgt include file .

    But if we add tgtd configuration in installation steps
    as suggested by the warning in the log like we did
    in manual installation for openSUSE and
    SUSE Linux Enterprise it will be more user friendly
    for smooth installation.

    [1]: https://docs.openstack.org/cinder/xena/admin/ts-cinder-config.html#id2

    Closes-Bug: #1946645
    Change-Id: If9b0936d4bd3efbf42a32e256c98816b4fd76c34

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 23.0.0.0rc1

This issue was fixed in the openstack/cinder 23.0.0.0rc1 release candidate.

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.