can update image size to smaller number even though cannot create it like that in the first place

Bug #1220797 reported by Dafna Ron
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Invalid
Undecided
Unassigned

Bug Description

if you try to create an image from file using the --size and giving a smaller size the source image we would fail
but we can use glance image-update to change the file after we create it.
so wither we do not need the size check to begin with or both should fail.

create image from a file (since this is the only time we currently check the size)

glance image-create --name image_size_file --disk-format qcow2 --container-format bare --file /tmp/39f89a6a-7fbb-43c0-a5ea-19b271f51829

[root@opens-vdsb ~(keystone_admin)]# glance image-list
+--------------------------------------+------------------+-------------+------------------+------------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+------------------+-------------+------------------+------------+--------+
| 23bf4915-9f83-4eb5-a7c2-702de4d825e7 | image_size_file | qcow2 | bare | 1440612352 | active |

[root@opens-XXXX ~(keystone_admin)]# glance image-update 23bf4915-9f83-4eb5-a7c2-702de4d825e7 --size 1
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 18b7d574b7a1f0093fefc5484d9fb68d |
| container_format | bare |
| created_at | 2013-09-04T15:47:55 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | 23bf4915-9f83-4eb5-a7c2-702de4d825e7 |
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | image_size_file |
| owner | ad326a6c11a742c6bfdf4ad63be0c889 |
| protected | False |
| size | 1 |
| status | active |
| updated_at | 2013-09-04T15:49:26 |
+------------------+--------------------------------------+

[root@opens-vdsb ~(keystone_admin)]# glance image-list
+--------------------------------------+------------------+-------------+------------------+------------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+------------------+-------------+------------------+------------+--------+
| 23bf4915-9f83-4eb5-a7c2-702de4d825e7 | image_size_file | qcow2 | bare | 1 | active |

Revision history for this message
Feilong Wang (flwang) wrote :

Admin is allowed to change the image size.

Changed in glance:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.