access_mode not set properly in connection_info via attachment_update
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
New
|
Undecided
|
Unassigned |
Bug Description
This is purely based on code inspection, but when calling attachment_update with mode='ro' in the host connector, the volume manager first gets the connection_info dict:
Which relies on the attached_mode from the volume admin metadata:
But attachment_update doesn't set the volume admin metadata until after getting the connection_info:
It also looks like access_mode is stored globally on the volume via the admin metadata rather than per-attachment, which is likely a problem because I could do something like:
* create read/write volume (default)
* attach read-write attachment via attachments API
* attach read-only attachment via attachments API
* now the volume admin metadata attach_mode is marked as read-only even though the default attach mode is read/write, so all subsequent attachments to the volume are going to be read-only
But that's likely a separate bug.
Also, here is an example of a read-only volume attachment where the connection_info says the access_mode is 'rw' but the attachment shows the attach_mode='ro':
http:// logs.openstack. org/90/ 572790/ 6/check/ nova-multiattac h/a1c6b26/ logs/screen- n-api.txt. gz#_Jun_ 06_23_08_ 15_201532
{ status" :"attached" , detached_ at":"", connection_ info":{
"auth_ password" :"jA5qkRgKkfEWX YSp",
"attachment_ id":"18d5e902- f509-48ed- 91fe-29cb4a893f 7c",
"target_ discovered" :false,
"encrypted" :false,
"driver_ volume_ type":" iscsi",
"qos_ specs": null,
"target_ iqn":"iqn. 2010-10. org.openstack: volume- c430ddbc- aa1a-4e7d- 8914-961e193bc4 2a",
"target_ portal" :"104.239. 135.61: 3260",
"volume_ id":"c430ddbc- aa1a-4e7d- 8914-961e193bc4 2a",
"target_ lun":1,
"access_ mode":" rw",
"auth_ username" :"Nt3XB76dNPTBr THBaddF" ,
"auth_ method" :"CHAP" attached_ at":"2018- 06-06T23: 08:14.000000" , attach_ mode":" ro", instance" :"7e21dad7- 3ca1-405b- b70b-1a2e1f80d8 3c", volume_ id":"c430ddbc- aa1a-4e7d- 8914-961e193bc4 2a", id":"18d5e902- f509-48ed- 91fe-29cb4a893f 7c"
"attachment":{
"
"
"
},
"
"
"
"
"
}
}