Skip to main content

compute_instance_compatible_flavors

Creates, updates, deletes, gets or lists a compute_instance_compatible_flavors resource.

Overview​

Namecompute_instance_compatible_flavors
TypeResource
Idovh.public_cloud.compute_instance_compatible_flavors

Fields​

The following fields are returned by SELECT queries:

Instance flavor (catalog entry). A single compute flavor as advertised by the backend (OpenStack/Nova) for a given region. This is read-only reference data served under /reference: it describes a hardware sizing (vCPUs, RAM, disks) the project can create instances from, not an existing resource. The catalog is per-region. A flavor returned for one region is not guaranteed to exist, or to carry the same characteristics, in another (see location).

NameDatatypeDescription
idstring (uuid)Identifier. The OpenStack/Nova flavor ID. Stable within a region and used to reference the flavor when creating an instance.
namestringThe backend flavor name, for example b2-7, c2-15. This is the commercial/technical name used to identify the sizing in the catalog.
bandwidthobjectNetwork bandwidth an instance of the flavor gets in Mbit/s
descriptionstringFree-form description of the flavor as reported by the backend. Null when no description is advertised for this flavor.
diskintegerSize of the flavor's root disk in GB. This is the primary system disk provisioned for instances created from this flavor.
ephemeralintegerSize of the flavor's ephemeral disk in GB. Ephemeral storage is transient. Its contents do not survive a rebuild or deletion of the instance. Zero when the flavor provides no ephemeral disk.
gpusintegerNumber of physical GPUs provided by the flavor. Zero for flavors without GPU.
is_publicbooleanPublic availability. Whether the flavor is publicly available to the project. Private flavors are only visible to the projects they have been explicitly shared with. (wire: isPublic)
locationobjectLocation. Region where this flavor is offered. The flavor catalog is per-region: a flavor returned for one region is not guaranteed to exist, or to carry the same characteristics, in another. regionActivated tells whether the region is already activated on the project. When false, the region must be activated on the project before use. availabilityZones lists the availability zones of the region, empty for a single-AZ region.
ramintegerRAM in MB. Amount of memory provided by the flavor, expressed in MB.
swapintegerSize of the flavor's swap space in MB. Zero when the flavor provides no swap.
vcpusintegervCPUs. Number of virtual CPUs provided by the flavor.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectinstance_id, project_idx_pagination_cursor, x_pagination_size### Compatible flavors<br /><br />Returns the list of flavors this instance can be resized to. The list is computed from the instance's current flavor and the catalog of flavors available in the instance's region.<br /><br />The following rules apply to the returned list:<br /><br />- It excludes the instance's current flavor.<br />- It includes only flavors whose disk size is greater than or equal to the current flavor's disk size (a resize cannot shrink the root disk).<br />- It includes only flavors in the same region as the instance.<br />- It includes only flavors whose plan is available in the instance's region.<br />- It is empty for baremetal instances, which cannot be resized.<br /><br />Each item has the same shape as an entry from the flavor reference catalog (publicCloud.reference.instance.Flavor). Its location.regionActivated is true, since the instance's region is activated on the project. location.availabilityZones lists the availability zones of the region, for example eu-west-par-a, eu-west-par-b and eu-west-par-c, and is empty for a single-AZ region.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
instance_idstring (uuid)Instance ID (wire: instanceId)
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Compatible flavors<br /><br />Returns the list of flavors this instance can be resized to. The list is computed from the instance's current flavor and the catalog of flavors available in the instance's region.<br /><br />The following rules apply to the returned list:<br /><br />- It excludes the instance's current flavor.<br />- It includes only flavors whose disk size is greater than or equal to the current flavor's disk size (a resize cannot shrink the root disk).<br />- It includes only flavors in the same region as the instance.<br />- It includes only flavors whose plan is available in the instance's region.<br />- It is empty for baremetal instances, which cannot be resized.<br /><br />Each item has the same shape as an entry from the flavor reference catalog (publicCloud.reference.instance.Flavor). Its location.regionActivated is true, since the instance's region is activated on the project. location.availabilityZones lists the availability zones of the region, for example eu-west-par-a, eu-west-par-b and eu-west-par-c, and is empty for a single-AZ region.​

SELECT
id,
name,
bandwidth,
description,
disk,
ephemeral,
gpus,
is_public,
location,
ram,
swap,
vcpus
FROM ovh.public_cloud.compute_instance_compatible_flavors
WHERE instance_id = '{{ instance_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
;