Currently, after failover-host using Storwize backend, the host of the volume is not change, which is still the primary backend information. then create snapshot or clone a volume would lead those create in primary backend, which expect to create in replication_device backend.
Repro steps:
1. configure to support replication.
2. create a replication enable volume: cinder create --volume-type replication-enable-type 1
3. failover the host: cinder failover-host --backend_id backend-id host-name
4. create snapshot or clone a volume of one of the failed-over volume
5. check the place the snapshot or volume created, it is created on the primary backend(sv1 as example), which should create on the secondary backend(sv2).
cinder config like:
[sv1]
san_login = admin
san_password = admin
san_ip = 192.168.0.11
volume_driver = cinder.volume.drivers.ibm.storwize_svc.storwize_svc_iscsi.StorwizeSVCISCSIDriver
volume_backend_name = sv1
storwize_svc_volpool_name=cinder
replication_device = managed_backend_name:second_host@sv2#sv2,
backend_id:svc_backend_id,
replication_mode:global,
san_ip:192.168.0.12,san_login:admin, san_password:admin,pool_name:cinder_target
[sv2]
san_login = admin
san_password = admin
san_ip = 192.168.0.12
volume_driver = cinder.volume.drivers.ibm.storwize_svc.storwize_svc_iscsi.StorwizeSVCISCSIDriver
volume_backend_name = sv2
storwize_svc_volpool_name=cinder_target
Reviewed: https:/ /review. openstack. org/292570 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=693c91467af bcb92b29493ead7 c8bfc455f41c81
Committed: https:/
Submitter: Jenkins
Branch: master
commit 693c91467afbcb9 2b29493ead7c8bf c455f41c81
Author: Vincent Hou <email address hidden>
Date: Thu Mar 17 14:11:43 2016 -0400
Storwize: do the correct update after failover
This patch adds the following changes:
* If the service sets up during the fail-over, the storwize driver
should take the corresponding secondary backend instead of the
primary backend.
* If the backend has failed over, the storwize
should switch the primary helpers to the secondary.
* Give the right parameter to delete the relationship between
the primary and the secondary volumes.
Change-Id: I7bf84bf6ebf4ec edcc75954b993e5 33c8ce404f8
Closes-Bug: #1555945