The nova.objects.request_spec Module

class RequestSpec(context=None, **kwargs)

Bases: nova.objects.base.NovaObject

VERSION = '1.4'
availability_zone
ephemeral_gb
fields = {'ignore_hosts': List(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'instance_uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'image': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'availability_zone': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'instance_group': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'retry': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'force_nodes': List(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'force_hosts': List(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'num_instances': Integer(default=1,nullable=False), 'project_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'numa_topology': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'scheduler_hints': Dict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'limits': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'flavor': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'pci_requests': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}
flavor
force_hosts
force_nodes
classmethod from_primitives(context, request_spec, filter_properties)

Returns a new RequestSpec object by hydrating it from legacy dicts.

That helper is not intended to leave the legacy dicts kept in the nova codebase, but is rather just for giving a temporary solution for populating the Spec object until we get rid of scheduler_utils’ build_request_spec() and the filter_properties hydratation in the conductor.

Parameters:
  • context – a context object
  • request_spec – An old-style request_spec dictionary
  • filter_properties – An old-style filter_properties dictionary
get_scheduler_hint(hint_name, default=None)

Convenient helper for accessing a particular scheduler hint since it is hydrated by putting a single item into a list.

In order to reduce the complexity, that helper returns a string if the requested hint is a list of only one value, and if not, returns the value directly (ie. the list). If the hint is not existing (or scheduler_hints is None), then it returns the default value.

Parameters:
  • hint_name – name of the hint
  • default – the default value if the hint is not there
id
ignore_hosts
image
instance_group
instance_uuid
limits
memory_mb
num_instances
numa_topology
obj_relationships = {'image': [('1.0', '1.5'), ('1.1', '1.6'), ('1.4', '1.7')], 'numa_topology': [('1.0', '1.2')], 'instance_group': [('1.0', '1.9'), ('1.3', '1.10')], 'retry': [('1.0', '1.0'), ('1.2', '1.1')], 'limits': [('1.0', '1.0')], 'flavor': [('1.0', '1.1')], 'pci_requests': [('1.0', '1.1')]}
pci_requests
project_id
retry
root_gb
scheduler_hints
swap
to_legacy_filter_properties_dict()

Returns a legacy filter_properties dict from the RequestSpec object.

Since we need to manage backwards compatibility and rolling upgrades within our RPC API, we need to accept to provide an helper for primitiving the right RequestSpec object into a legacy dict until we drop support for old Scheduler RPC API versions. If you don’t understand why this method is needed, please don’t use it.

to_legacy_request_spec_dict()

Returns a legacy request_spec dict from the RequestSpec object.

Since we need to manage backwards compatibility and rolling upgrades within our RPC API, we need to accept to provide an helper for primitiving the right RequestSpec object into a legacy dict until we drop support for old Scheduler RPC API versions. If you don’t understand why this method is needed, please don’t use it.

vcpus
class SchedulerLimits(context=None, **kwargs)

Bases: nova.objects.base.NovaObject

VERSION = '1.0'
disk_gb
fields = {'memory_mb': Integer(default=None,nullable=True), 'numa_topology': Object(default=None,nullable=True), 'vcpu': Integer(default=None,nullable=True), 'disk_gb': Integer(default=None,nullable=True)}
classmethod from_dict(limits_dict)
memory_mb
numa_topology
obj_relationships = {'numa_topology': [('1.0', '1.0')]}
to_dict()
vcpu
class SchedulerRetries(context=None, **kwargs)

Bases: nova.objects.base.NovaObject

VERSION = '1.1'
fields = {'hosts': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'num_attempts': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}
classmethod from_dict(context, retry_dict)
hosts
num_attempts
obj_relationships = {'hosts': [('1.0', '1.13'), ('1.1', '1.14')]}
to_dict()

Previous topic

The nova.objects.quotas Module

Next topic

The nova.objects.security_group Module

Project Source

This Page