The issue here seems to be that the nova.objects.fields.Architecture class[0] doesn't have registered RISCV64, so the list defined in os-traits[1] doesn't seem to be enough to have support for an emulated architecture.
Here I'm attaching a diff that can be used as a starting point.
The issue here seems to be that the nova.objects. fields. Architecture class[0] doesn't have registered RISCV64, so the list defined in os-traits[1] doesn't seem to be enough to have support for an emulated architecture.
Here I'm attaching a diff that can be used as a starting point.
Reproducer:
``` 22.04-server- cloudimg- riscv64. img && wget http:// cloud-images. ubuntu. com/server/ releases/ jammy/release- 20220420/ ubuntu- 22.04-server- cloudimg- riscv64. img 22.04-server- cloudimg- riscv64. img \ riscv64 \ architecture= riscv64 riscv64-test type=virt riscv64-test
test -f ubuntu-
openstack image create \
--disk-format qcow2 \
--file ./ubuntu-
--public \
--property architecture=
--property item_name=disk1.img \
--property os_distro=ubuntu \
--property os_version=22.04 \
riscv64-test
openstack image set --property hw_emulation_
openstack image set --property hw_machine_
openstack server create \
--image riscv64-test \
--network freyes_admin_net \
--flavor m1.medium \
--key-name freyes \
my-riscv64-test
```
Output:
``` 4457-40fc- b26a-7906ce9295 32)
Invalid image metadata. Error: Architecture name 'riscv64' is not valid (HTTP 400) (Request-ID: req-7a2d48d1-
```
In the logs:
``` openstack. wsgi [req-7a2d48d1- 4457-40fc- b26a-7906ce9295 32 a3ee17ed103a4cb babdb215d9dca04 82 - - 1bf127c9b631435 984600ac72fa537 4f 1bf127c9b631435 984600ac72fa537 4f] HTTP exception thrown: Invalid image metadata. Error: Architecture name 'riscv64' is not valid openstack. wsgi [req-7a2d48d1- 4457-40fc- b26a-7906ce9295 32 a3ee17ed103a4cb babdb215d9dca04 82 - - 1bf127c9b631435 984600ac72fa537 4f 1bf127c9b631435 984600ac72fa537 4f] Returning 400 to user: Invalid image metadata. Error: Architecture name 'riscv64' is not valid __call__ /usr/lib/ python3/ dist-packages/ nova/api/ openstack/ wsgi.py: 936
2023-06-24 03:32:43.912 2238785 INFO nova.api.
2023-06-24 03:32:43.913 2238785 DEBUG nova.api.
```
[0] https:/ /opendev. org/openstack/ nova/src/ branch/ master/ nova/objects/ fields. py#L120 /opendev. org/openstack/ os-traits/ src/branch/ master/ os_traits/ compute/ arch.py
[1] https:/