Share the snapshot of volume-backed instance to other tenant, but can not build instance with this image.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
New
|
Undecided
|
Unassigned |
Bug Description
Create a snapshot(image) of a volume-backed instance, this will generate a image in glance. At first, this image is private, I can update this image's visibility to shared, and execuate glance member-create and glance member-update on this image to share image to another tenant. Then another tenant use this image to create a new instance, it will failed of this message "HTTP exception thrown: Block Device Mapping is Invalid: failed to get snapshot xxx"
From the analysis of logs and nova code, it is because nova-api will call _validate_bdm function to get snapshot from cinder, but in cinder, the added tenant can not see the volume snapshot, the snapshot is not belong to the tenant, so cinder-api will return 404 when nova-api call get_snapshot.
How can I make this process to succeed?
====steps========
1. show the snapshot of volume-backed instance
# glance image-show a13fe7a1-
+------
| Property | Value |
+------
| base_image_ref | |
| bdm_v2 | True |
| block_device_
| | "no_device": null, "snapshot_id": "7a1b5060-
| | "volume_type": null, "device_name": "/dev/sda", "disk_bus": "scsi", "image_id": |
| | null, "source_type": "snapshot", "tag": null, "device_type": "disk", |
| | "volume_id": null, "destination_type": "volume", "volume_size": 50}] |
| boot_roles | heat_stack_
| checksum | d41d8cd98f00b20
| container_format | bare |
| created_at | 2019-12-
| disk_format | qcow2 |
| hw_disk_bus | scsi |
| hw_qemu_guest_agent | yes |
| hw_scsi_model | virtio-scsi |
| hw_video_model | qxl |
| id | a13fe7a1-
| locations | [{"url": "rbd://
| | f8c16c17d6e3/
| min_disk | 50 |
| min_ram | 0 |
| name | fhl-volume |
| os_distro | centos |
| os_hash_algo | sha512 |
| os_hash_value | cf83e1357eefb8b
| | ff8318d2877eec2
| os_hidden | False |
| os_type | linux |
| owner | 17bf57ec04994db
| owner_project_name | myproject |
| owner_user_name | myuser |
| protected | False |
| root_device_name | /dev/sda |
| size | 0 |
| status | active |
| tags | [] |
| updated_at | 2020-04-
| virtual_size | Not available |
| visibility | private |
| vm_mode | hvm |
+------
2. Make the image shared, and add member
glance image-update a13fe7a1-
glance member-create a13fe7a1-
glance member-update a13fe7a1-
3. Tenant 07cb8171cf85451
===the instance created logs==========
nova-api
HTTP exception thrown: Block Device Mapping is Invalid: failed to get snapshot 7a1b5060-
cinder-api
"GET /v3/07cb8171cf8
Looks a valid bug for Cinder (or at least some kind of Glance<->Cinder interlaced issue).
Either way, moving it to the cinder team.