On 1/29/25 19:45, Sean Mooney wrote:
On 29/01/2025 15:58, Jan wrote:
Hi,
is there a reason why some member variables of the nova instance object are returned by the api and some not. yes some are admin only and other are accessible to the member/reader role.
For example the "os_type" value is not returned but the "kernel_id" (OS-EXT-SRV-ATTR:kernel_id) is.
os_type is not an atirbute of the instance its a properlty on the image.
How do you distinguish between image properties and attributes of an instance? The os_type attribute is a field in the "Instance" class, and thus a column in the instance table in the nova database. There also exists an entry in the system_metadata table if os_type on an image was set. But os_type dependent settings, such as enabling of the hyperv feature emulation, depend only on the setting in the instance table.
we do not currently support showing the image proerties in general
kernel_id is diffent because when you create an instance you can optionally specify an addtion kernl image to use.
i belive this can also be encoded as an image property but it can be passed in the api request
so kernel_id is returned in server show because it can be passed as part of the create request.
if you would like to be able to see the image properties like os_type in the server show reponce you will be happy
to know that we are adding that this cycle https://review.opendev.org/c/openstack/nova/+/939649
that will bring parity with flavor extra specs.
I have a use case where it would be very helpful to get the "os_type" via the api and python sdk.
Is there a chance that a patch implementing this would be accepted?
on its own no but it will be added by https://review.opendev.org/c/openstack/nova/+/939649
Thanks for the hint. I will definitely look into this.
as i said instance do not have an os_type but the root disk image does have one.
so you will be able to chekc the os_type in the image properties once that is merged.
as this is an api change it will not be backportable.
Regards, Jan