not honoring user_id during clone volume
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
In Progress
|
Undecided
|
Rajat Dhasmana |
Bug Description
When we clone a volume from a source volume, we copy details from old volume and update some fields based on the new volume details[1]
In this, we update the volume's project id based on the context[2] but don't update the user_id based on the context.
This causes issues when trying to access the volume since the volume is created in the user or service context's project but the user ID is of the source volume user and not of the destination volume user.
Failure scenario:
1. Configure glance using cinder backend
2. as a normal upload a volume to image
Expected
cinder should be able to upload the volume as image
Actual
cinder will clone the image-volume with user_id as source volume's user and service project hence glance won't be able to access the volume and fail to register location
We can see the project ID is correct because of [2]
(Pdb) new_vol_
'4f92f53921b849
(Pdb) ctx.project_id
'4f92f53921b849
the user ID is different because we don't set it from current context rather copy it from source volume
(Pdb) new_vol_
'c6bfba032a2546
(Pdb) ctx.user_id
'da66c9f8a17b49
[1] https:/
[2] https:/
Changed in cinder: | |
assignee: | nobody → Rajat Dhasmana (whoami-rajat) |
Fix proposed to branch: master /review. opendev. org/c/openstack /cinder/ +/911004
Review: https:/