@@ -197,6 +197,10 @@ type Instance struct {
197197 HasSnapshot bool `json:"has_snapshot"`
198198 // Hotplug memory size (human-readable)
199199 HotplugSize string `json:"hotplug_size"`
200+ // Hypervisor running this instance
201+ //
202+ // Any of "cloud-hypervisor", "qemu".
203+ Hypervisor InstanceHypervisor `json:"hypervisor"`
200204 // Network configuration of the instance
201205 Network InstanceNetwork `json:"network"`
202206 // Writable overlay disk size (human-readable)
@@ -223,6 +227,7 @@ type Instance struct {
223227 Env respjson.Field
224228 HasSnapshot respjson.Field
225229 HotplugSize respjson.Field
230+ Hypervisor respjson.Field
226231 Network respjson.Field
227232 OverlaySize respjson.Field
228233 Size respjson.Field
@@ -263,6 +268,14 @@ const (
263268 InstanceStateUnknown InstanceState = "Unknown"
264269)
265270
271+ // Hypervisor running this instance
272+ type InstanceHypervisor string
273+
274+ const (
275+ InstanceHypervisorCloudHypervisor InstanceHypervisor = "cloud-hypervisor"
276+ InstanceHypervisorQemu InstanceHypervisor = "qemu"
277+ )
278+
266279// Network configuration of the instance
267280type InstanceNetwork struct {
268281 // Whether instance is attached to the default network
@@ -410,6 +423,10 @@ type InstanceNewParams struct {
410423 Devices []string `json:"devices,omitzero"`
411424 // Environment variables
412425 Env map [string ]string `json:"env,omitzero"`
426+ // Hypervisor to use for this instance. Defaults to server configuration.
427+ //
428+ // Any of "cloud-hypervisor", "qemu".
429+ Hypervisor InstanceNewParamsHypervisor `json:"hypervisor,omitzero"`
413430 // Network configuration for the instance
414431 Network InstanceNewParamsNetwork `json:"network,omitzero"`
415432 // Volumes to attach to the instance at creation time
@@ -425,6 +442,14 @@ func (r *InstanceNewParams) UnmarshalJSON(data []byte) error {
425442 return apijson .UnmarshalRoot (data , r )
426443}
427444
445+ // Hypervisor to use for this instance. Defaults to server configuration.
446+ type InstanceNewParamsHypervisor string
447+
448+ const (
449+ InstanceNewParamsHypervisorCloudHypervisor InstanceNewParamsHypervisor = "cloud-hypervisor"
450+ InstanceNewParamsHypervisorQemu InstanceNewParamsHypervisor = "qemu"
451+ )
452+
428453// Network configuration for the instance
429454type InstanceNewParamsNetwork struct {
430455 // Whether to attach instance to the default network
0 commit comments