min_disk and size information wrong when creating an instance image
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Invalid
|
Undecided
|
Unassigned | ||
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Feodor Tersin |
Bug Description
If I launch an instance from an image that has min_disk set to 2GB, then create an image from the instance, the min_disk attribute is not set correctly on the image (it's set to 0). Instead of being set as an attribute, it exists as a property instead. This can cause issues when other services rely on min_disk to make decisions about size (e.g. bug 1368600 for Horizon, not sure if Cinder is affected too).
This doesn't seem to happen when creating a basic instance from an instance, only when there is also a volume involved.
I'm not sure if this is a nova or glance issue so I'm opening a task on both for now.
Steps to reproduce
-------
(done on a recent devstack)
1. Create a new image with e.g. min_disk 2GB
$ glance image-create --name mindisk2gb --disk-format qcow2 --container-format bare --location https:/
+------
| Property | Value |
+------
| checksum | None |
| container_format | bare |
| created_at | 2014-09-16T12:35:33 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | 9bbed3a5-
| is_public | False |
| min_disk | 2 | <-- min_disk set as expected
| min_ram | 0 |
| name | mindisk2gb |
| owner | eb6acc49df4b439
| protected | False |
| size | 9159168 | <-- size looks ok
| status | active |
| updated_at | 2014-09-16T12:35:37 |
| virtual_size | None |
+------
2. Boot an instance from this image, backed by a volume (I believe this matches what happens when launching with "Image (creates a new volume)" in Horizon)
$ nova boot --flavor 4115a835-
+------
| Property | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | building |
| OS-SRV-
| OS-SRV-
| accessIPv4 | |
| accessIPv6 | |
| adminPass | Uo2DL64GaY74 |
| config_drive | |
| created | 2014-09-
| flavor | m1.lowmem (4115a835-
| hostId | |
| id | 3e70fd2e-
| image | Attempt to boot from volume - no image supplied |
| key_name | - |
| metadata | {} |
| name | my_instance |
| os-extended-
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | eb6acc49df4b439
| updated | 2014-09-
| user_id | 437279436240498
+------
3. Create a snapshot
$ nova image-create 3e70fd2e-
4. Find the snapshot in glance image-list and look at the details:
$ glance image-show d44f7368-
+------
| Property | Value |
+------
| Property 'bdm_v2' | True |
| Property 'block_
| | "bce8f300-
| | "disk_bus": "virtio", "image_id": null, "source_type": "snapshot", |
| | "device_type": "disk", "volume_id": null, "destination_type": "volume", |
| | "volume_size": null}] |
| Property 'container_format' | bare |
| Property 'disk_format' | qcow2 |
| Property 'image_id' | 9bbed3a5-
| Property 'image_name' | mindisk2gb |
| Property 'min_disk' | 2 | <-- min_disk is set as a property
| Property 'min_ram' | 0 |
| Property 'root_device_name' | /dev/vda |
| Property 'size' | 9159168 | <-- the size appears correct in the properties
| created_at | 2014-09-16T12:57:25 |
| deleted | False |
| id | d44f7368-
| is_public | False |
| min_disk | 0 | <-- min_disk is 0
| min_ram | 0 |
| name | my_instance_snap |
| owner | eb6acc49df4b439
| protected | False |
| size | 0 | <-- size is set to 0 too
| status | active |
| updated_at | 2014-09-16T12:57:25 |
+------
Chatting with someone on the Glance team this doesn't seem to be the expected behaviour? I would expect the size and min_disk attribute to be correct and similar to the properties, in this case.
Changed in glance: | |
status: | New → Confirmed |
Changed in nova: | |
assignee: | Feodor Tersin (ftersin) → Michael Still (mikalstill) |
Changed in glance: | |
assignee: | nobody → wangxiyuan (wangxiyuan) |
Changed in nova: | |
assignee: | Michael Still (mikalstill) → Feodor Tersin (ftersin) |
Changed in nova: | |
milestone: | none → liberty-3 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | liberty-3 → 12.0.0 |
Changed in glance: | |
assignee: | wangxiyuan (wangxiyuan) → nobody |
status: | Confirmed → Invalid |
I think the real question is why the data is coming up in the Property namespace, and not going back into the main namespace. It almost seems like the metadata update in glanceclient is going through the wrong path.
Any idea which glance API was being used in your setup?