architecture not validated in "openstack image create"

Bug #1616539 reported by Gaby Beitler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
tamil vanan

Bug Description

On Liberty

<error> <mistyped architecture, but is accepted anyway>

$ openstack image create \
  --public \
  --container-format bare \
  --disk-format qcow2 \
  --min-disk 2 --min-ram 512 \
  --file /home/images/SLES12SP1-cloudimage.qcow2 \
  SLES12SP1-x86_64
+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | fcdeb8b10730ac96bccc9a121ee030f4 |
| container_format | bare |
| created_at | 2016-08-02T20:51:45Z |
| disk_format | qcow2 |
| file | /v2/images/e7f289aa-e689-4f0a-a0a0-43f341986fd5/file |
| id | e7f289aa-e689-4f0a-a0a0-43f341986fd5 |
| min_disk | 2 |
| min_ram | 512 |
| name | SLES12SP1-x86_64 |
| owner | f7ed231f244b4b2db8b1e580f36e1580 |
| protected | False |
| schema | /v2/schemas/image |
| size | 362847744 |
| status | active |
| updated_at | 2016-08-02T20:51:51Z |
| virtual_size | None |
| visibility | public |
+------------------+------------------------------------------------------+

# openstack image set \
  --name SLES12-SP1 \
  --architecture x96_64 \
  --os-distro sles \ # <-- the problem
  --os-version 12.1 \
  SLES12SP1-x86_64
+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| architecture | x96_64 |
| checksum | fcdeb8b10730ac96bccc9a121ee030f4 |
| container_format | bare |
| created_at | 2016-08-02T20:51:45Z |
| disk_format | qcow2 |
| file | /v2/images/e7f289aa-e689-4f0a-a0a0-43f341986fd5/file |
| id | e7f289aa-e689-4f0a-a0a0-43f341986fd5 |
| min_disk | 2 |
| min_ram | 512 |
| name | SLES12-SP1 |
| os_distro | sles |
| os_version | 12.1 |
| owner | f7ed231f244b4b2db8b1e580f36e1580 |
| protected | False |
| schema | /v2/schemas/image |
| size | 362847744 |
| status | active |
| tags | [] |
| updated_at | 2016-08-02T20:53:00Z |
| virtual_size | None |
| visibility | public |
+------------------+------------------------------------------------------+

$ openstack server create \
  --flavor m1.smaller \
  --image SLES12-SP1 \
  vm01
Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<type 'exceptions.ValueError'> (HTTP 500) (Request-ID: req-5fc1ad67-86ad-4a69-b7f4-905861a8f2fc)

********
<Success> <Change architecture from x96_64 to x86_64>

# openstack image set \
  --name SLES12-SP1 \
  --architecture x86_64 \
  --os-distro sles \
  --os-version 12.1 \
  SLES12-SP1
+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| architecture | x86_64 |
| checksum | fcdeb8b10730ac96bccc9a121ee030f4 |
| container_format | bare |
| created_at | 2016-08-02T20:51:45Z |
| disk_format | qcow2 |
| file | /v2/images/e7f289aa-e689-4f0a-a0a0-43f341986fd5/file |
| id | e7f289aa-e689-4f0a-a0a0-43f341986fd5 |
| min_disk | 2 |
| min_ram | 512 |
| name | SLES12-SP1 |
| os_distro | sles |
| os_version | 12.1 |
| owner | f7ed231f244b4b2db8b1e580f36e1580 |
| protected | False |
| schema | /v2/schemas/image |
| size | 362847744 |
| status | active |
| tags | [] |
| updated_at | 2016-08-02T20:55:55Z |
| virtual_size | None |
| visibility | public |
+------------------+------------------------------------------------------+

# openstack server create \
  --flavor m1.smaller
  --image SLES12-SP1 vm01
+--------------------------------------+---------------------------------------------------+
| Field | Value |
+--------------------------------------+---------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | |
| OS-EXT-SRV-ATTR:host | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| OS-EXT-SRV-ATTR:instance_name | instance-00000012 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | None |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| addresses | |
| adminPass | B8U3uzDDMre9 |
| config_drive | |
| created | 2016-08-02T20:56:04Z |
| flavor | m1.smaller (6afe7481-51e0-4a47-8934-0c2fee314fc5) |
| hostId | |
| id | 12dc8a78-51c3-419a-a484-d604efc0f4d8 |
| image | SLES12-SP1 (e7f289aa-e689-4f0a-a0a0-43f341986fd5) |
| key_name | None |
| name | vm01 |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| project_id | f7ed231f244b4b2db8b1e580f36e1580 |
| properties | |
| security_groups | [{u'name': u'default'}] |
| status | BUILD |
| updated | 2016-08-02T20:56:04Z |
| user_id | 940803780c224ee780656630134320fc |
+--------------------------------------+---------------------------------------------------+

# openstack server list
+--------------------------------------+------+--------+----------------------+
| ID | Name | Status | Networks |
+--------------------------------------+------+--------+----------------------+
| 12dc8a78-51c3-419a-a484-d604efc0f4d8 | vm01 | ACTIVE | fixed=192.168.123.15 |
+--------------------------------------+------+--------+----------------------+

tamil vanan (tamilhce)
Changed in nova:
assignee: nobody → tamil vanan (tamilhce)
Ukesh (ukeshkumar)
Changed in nova:
status: New → In Progress
Revision history for this message
tamil vanan (tamilhce) wrote :

reproduced the issue, working on the code fix

description: updated
Revision history for this message
tamil vanan (tamilhce) wrote :

Have submitted the code patch, Not accepted in code review, Need to follow up with glance team

Revision history for this message
tamil vanan (tamilhce) wrote :
Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing
the status back to the previous state and unassigning. If
there are active reviews related to this bug, please include
links in comments.

Changed in nova:
status: In Progress → New
assignee: tamil vanan (tamilhce) → nobody
Revision history for this message
Sean Dague (sdague) wrote :

Automatically discovered version liberty in description. If this is incorrect, please update the description to include 'nova version: ...'

tags: added: openstack-version.liberty
Sean Dague (sdague)
Changed in nova:
assignee: nobody → tamil vanan (tamilhce)
status: New → In Progress
Revision history for this message
Stephen Finucane (stephenfinucane) wrote :

This bug should be filed against glance, rather than nova. From what I can tell, glance provides a config option to allow users to opt-in to only allowing valid image metadata properties.

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

Other bug subscribers

Remote bug watches

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