'openstack image unset --property BadRequestException: 400

Version stein openstack, one image had set the property with hw_scsi_model='virtio-scsi', now I have to unset it, but can't work.

# openstack image unset --property hw_scsi_model debian9.5
BadRequestException: 400: Client Error for url: http://10.10.10.10:9292/v2/images/3***0, Bad Request'

# openstack image show debian9.5 -c status -c visibility -c properties
| Field      | Value                                       |
| properties | hw_scsi_model='', os_hash_algo='sha512', ...|
| status     | active                                      |
| visibility | shared                                      |

While set the value to null or None, create server with this image, get error Field value is invalid

# openstack image set --property hw_scsi_model='' debian9.5
# openstack image show debian9.5 -c properties -f value
{u'owner_specified.openstack.sha256': u'5**', 'hw_scsi_model': u''}
or
{u'owner_specified.openstack.sha256': u'5**', 'hw_scsi_model': u'None'}

error log:

INFO nova.api.openstack.wsgi [req-***] HTTP exception thrown: Invalid image metadata. Error: Field value is invalid

How could I unset the property in image?



Solution 1:[1]

One solve method by glance component sub-command image-update:

glance image-update --remove-property hw_scsi_model debian9.5

openstack image unset --property fails

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Victor Lee