volume_size in bdms cannot work when instance boot with snapshot image

Bug #1891298 reported by renminmin on 2020-08-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Undecided
renminmin

Bug Description

In my env, cinder volume backend is ceph rbd.

# Original instance boot with volume-backend from the image01

$ nova boot --block-device source=image,id=$image01,dest=volume,size=50,shutdown=remove,bootindex=0 --flavor m1.tiny --nic net-id=$net vm01

# create instance image

$ nova image-create vm01 img-vm04
$ glance image-show img-vm04

+----------------------------------+----------------------------------------------------------------------------------+
| Property | Value |
+----------------------------------+----------------------------------------------------------------------------------+
| base_image_ref | |
| bdm_v2 | True |
| block_device_mapping | [{"image_id": null, "volume_type": null, "boot_index": 0, "snapshot_id": |
| | "42fea563-9551-4bc3-b3fb-7746e0895158", "destination_type": "volume", "tag": |
| | null, "source_type": "snapshot", "device_type": "disk", "guest_format": null, |
| | "device_name": "/dev/vda", "no_device": null, "delete_on_termination": true, |
| | "volume_size": 100, "disk_bus": "virtio", "volume_id": null}] |
| boot_roles | reader,admin,member |
| checksum | d41d8cd98f00b204e9800998ecf8427e |
| container_format | bare |
| created_at | 2020-08-11T08:49:32Z |
| direct_url | rbd://b7b2fac6-420f-4ec1-aea2-4862d29b4059/volumes/f11d2516-ba1a-4994-b984-d253d |
| | 1524dab/snap |
| disk_format | qcow2 |
| hw_rng_model | virtio |
| id | f11d2516-ba1a-4994-b984-d253d1524dab |
| locations | [{"url": "rbd://b7b2fac6-420f-4ec1-aea2-4862d29b4059/volumes/f11d2516-ba1a-4994- |
| | b984-d253d1524dab/snap", "metadata": {"store": "ceph"}}] |
| min_disk | 1

# Boot new instance with img-vm04

nova boot --block-device source=image,id=$img04,dest=volume,size=200,shutdown=remove,bootindex=0 --flavor m1.tiny --nic net-id=$net vm05

# root volume size is 50
3ea44251-04cd-4d6c-865d-b868b5faddc4 | in-use | | 50 | ceph-rbd | true | e21fd39b-ab72-42d1-91d6-f9462685bba8 |

Excepted: volume size is 200

Fix proposed to branch: master
Review: https://review.opendev.org/745821

Changed in nova:
assignee: nobody → renminmin (rmm0811)
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers