Bug 1488390

Summary: [RFE] Backport Cinder Multibackend availability support
Product: Red Hat OpenStack Reporter: Luca Miccini <lmiccini>
Component: openstack-cinderAssignee: Gorka Eguileor <geguileo>
Status: CLOSED ERRATA QA Contact: Avi Avraham <aavraham>
Severity: high Docs Contact:
Priority: high    
Version: 10.0 (Newton)CC: dcadzow, dwojewod, eharney, geguileo, mlopes, molasaga, mvalledi, pkundal, rhos-flags, scohen, sputhenp, srevivo, tshefi
Target Milestone: z7Keywords: FeatureBackport, FutureFeature, Triaged, ZStream
Target Release: 10.0 (Newton)Flags: scohen: needinfo+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-cinder-9.1.4-15.el7ost Doc Type: Enhancement
Doc Text:
This update adds support for multiple Availability Zones within a single Block Storage (cinder) volume service; this is done by defining the AZ in each driver section.
Story Points: ---
Clone Of: 1452704 Environment:
Last Closed: 2018-02-27 16:39:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1452704, 1466000, 1510931    
Bug Blocks: 1381612    
Attachments:
Description Flags
patch none

Comment 3 Luca Miccini 2017-09-12 15:28:34 UTC
Created attachment 1324945 [details]
patch

Comment 5 Gorka Eguileor 2017-11-21 10:37:32 UTC
*** Bug 1510931 has been marked as a duplicate of this bug. ***

Comment 9 Tzach Shefi 2018-02-07 12:28:42 UTC
Verified on: 
openstack-cinder-9.1.4-24.el7ost.noarch


Created two backends, each at other availability zone
[tripleo_iscsi]
volume_driver=cinder.volume.drivers.lvm.LVMVolumeDriver
volumes_dir=/var/lib/cinder/volumes
iscsi_protocol=iscsi
iscsi_ip_address=172.17.3.12
volume_backend_name=tripleo_iscsi
iscsi_helper=lioadm
backend_availability_zone = dc1

[nfs]
volume_backend_name=nfs
volume_driver=cinder.volume.drivers.nfs.NfsDriver
nfs_shares_config=/etc/cinder/nfs_shares.conf
nfs_snapshot_support=True
nas_secure_file_operations=False
nas_secure_file_permissions=False
backend_availability_zone = dc2


1. Cinder service-list shows two backends and zones
[stack@undercloud-0 ~]$ cinder service-list
+------------------+-------------------------+------+---------+-------+----------------------------+-----------------+
| Binary           | Host                    | Zone | Status  | State | Updated_at                 | Disabled Reason |
+------------------+-------------------------+------+---------+-------+----------------------------+-----------------+
| cinder-backup    | hostgroup               | nova | enabled | up    | 2018-02-07T12:19:47.000000 | -               |
| cinder-scheduler | hostgroup               | nova | enabled | up    | 2018-02-07T12:19:54.000000 | -               |
| cinder-volume    | hostgroup@nfs           | dc2  | enabled | up    | 2018-02-07T12:19:55.000000 | -               |
| cinder-volume    | hostgroup@tripleo_iscsi | dc1  | enabled | up    | 2018-02-07T12:19:54.000000 | -               |
+------------------+-------------------------+------+---------+-------+----------------------------+-----------------+


Created 1 volume on each backend/zone

[stack@undercloud-0 ~]$ cinder create --display-name lvm-dc1 --volume-type lvm 1 --availability-zone dc1
+--------------------------------+--------------------------------------+
| Property                       | Value                                |
+--------------------------------+--------------------------------------+
| attachments                    | []                                   |
| availability_zone              | dc1                                  |


[stack@undercloud-0 ~]$ cinder create --display-name nfs-dc2 --volume-type nfs 1 --availability-zone dc2
+--------------------------------+--------------------------------------+
| Property                       | Value                                |
+--------------------------------+--------------------------------------+
| attachments                    | []                                   |
| availability_zone              | dc2                                  |

Both are available, one at each zone


When I try to create volume on backend but give wrong zone
cinder create --display-name nfs-dc2-1 --volume-type nfs 1 --availability-zone dc1
+--------------------------------+--------------------------------------+                                                                                                                                                                    
| Property                       | Value                                |                                                                                                                                                                    
+--------------------------------+--------------------------------------+                                                                                                                                                                    
| attachments                    | []                                   |                                                                                                                                                                    
| availability_zone              | dc1      

Volume fails to create as expected in error state. 

Also if I create a volume without stating zone it also fails

[stack@undercloud-0 ~]$ cinder create --display-name nfs-NoZoneAdded --volume-type nfs 1 


All 4 volumes: 
 
[stack@undercloud-0 ~]$ cinder list
+--------------------------------------+-----------+-----------------+------+-------------+----------+-------------+
| ID                                   | Status    | Name            | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+-----------------+------+-------------+----------+-------------+
| 295062f0-6719-46c7-bc9c-324ee7d3f512 | available | nfs-dc2         | 1    | nfs         | false    |             |
| 7b32f377-4b23-41b2-bad6-4b2fe0362543 | error     | nfs-NoZoneAdded | 1    | nfs         | false    |             |
| b5b9850a-271f-4019-b2e2-d46e6c69121f | error     | nfs-dc2-1       | 1    | nfs         | false    |             |
| fd66f0af-3c67-47fd-ac08-91ffef42006a | available | lvm-dc1         | 1    | lvm         | false    |             |
+--------------------------------------+-----------+-----------------+------+-------------+----------+-------------+

Comment 11 errata-xmlrpc 2018-02-27 16:39:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0360