when using Brocade-FC-Zone-Driver with zoning_policy as initiator, attaching 2nd volume to a VM fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
New
|
Low
|
Unassigned |
Bug Description
- Openstack Zone driver supports two types of zoning_policies:
* initiator-target
* initiator <<<< bug exists only for this policy
- Use case: attaching 2nd volume to a VM
- The test of the use case failed the same way by using below two clients.
a. /cinder/
b. /cinder/
- The bug only exists when zoning_policy set as initiator.
- Detailed description about the bug:
1. set zoning_policy as initiator for Brocade FC Zone Driver
2. Attach 1st volume to a VM successfully,
where zone(zone_
# /var/log/
INFO cinder.
Friendly zone name after forming: openstackc05076
INFO cinder.
Zone map to create: {'openstackc050
INFO cinder.
Zone map to update: {}
# check from Brocade switch cmdline
fcsw60:
3. However, attaching 2nd volume to the above VM failed with error below !
# /var/log/
INFO cinder.
Zone map to create: {}
INFO cinder.
Zone map to update {'openstackc050
ERROR cinder.
Error while running zoning CLI:
4. The failure of executing zoneadd -> points to a bug of Brocade driver shown below:
#### Root Cause has 2 items:
#### a. The if-condition(line 215) does NOT work as designed
#### due to the different formats:
#### b. As the comments (line 210/211) states,
the existing code only handle target WWNs.
it is also needed to add logic to handle initiator WWNs
```
/cinder/
206 # If zone exists, then do a zoneadd to update
207 # the zone members in the existing zone. Otherwise,
208 # do a zonecreate to create a new zone.
209 if len(zone_names) > 0 and (zone_name in zone_names):
210 # Verify that the target WWNs are not already members
211 # of the existing zone. If so, remove them from the
212 # list of members to add, otherwise error will be
213 # returned from the switch.
214 for t in target_list:
215 if t in cfgmap_
216 zone_members.
217 if zone_members:
218 zone_update_
```
- cfgmap_
a. it is returned by Brocade switch
b. its member contains ":"
#example
(Pdb) pp cfgmap_
- target_list: items may NOT contains ":"
#example
(Pdb) pp target_list
- A suggestion for the fix:
```
214 for t in target_list:
# fix item a:
# handling target WWNs by replacing line 215 with below example
215 if utils.get_
216 zone_members.
# fix item b:
# handling initiator WWNs by adding below code(line 217,218)
217 if utils.get_
218 zone_members.
219 if zone_members:
220 zone_update_
```
Changed in cinder: | |
importance: | Undecided → Low |