Bases: nova.objects.base.NovaPersistentObject, nova.objects.base.NovaObject
Object to represent a PCI device on a compute node.
PCI devices are managed by the compute resource tracker, which discovers
the devices from the hardware platform, claims, allocates and frees
devices for instances.
The PCI device information is permanently maintained in a database.
This makes it convenient to get PCI device information, like physical
function for a VF device, adjacent switch IP address for a NIC,
hypervisor identification for a PCI device, etc. It also provides a
convenient way to check device allocation information for administrator
purposes.
A device can be in available/claimed/allocated/deleted/removed state.
A device is available when it is discovered..
A device is claimed prior to being allocated to an instance. Normally the
transition from claimed to allocated is quick. However, during a resize
operation the transition can take longer, because devices are claimed in
prep_resize and allocated in finish_resize.
A device becomes removed when hot removed from a node (i.e. not found in
the next auto-discover) but not yet synced with the DB. A removed device
should not be allocated to any instance, and once deleted from the DB,
the device object is changed to deleted state and no longer synced with
the DB.
Filed notes:
| 'dev_id':
| Hypervisor's identification for the device, the string format
| is hypervisor specific
| 'extra_info':
| Device-specific properties like PF address, switch ip address etc.
-
VERSION = '1.3'
-
address
-
allocate(instance)
-
claim(instance)
-
compute_node_id
-
classmethod create(dev_dict)
Create a PCI device based on hypervisor information.
As the device object is just created and is not synced with db yet
thus we should not reset changes here for fields from dict.
-
created_at
-
deleted
-
deleted_at
-
dev_id
-
dev_type
-
fields = {'instance_uuid': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'dev_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'product_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'status': PciDeviceStatus(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False,valid_values=('available', 'claimed', 'allocated', 'removed', 'deleted')), 'id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'extra_info': Dict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'label': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'deleted_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'deleted': Boolean(default=False,nullable=False), 'vendor_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'compute_node_id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'numa_node': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'dev_type': PciDeviceType(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False,valid_values=('type-PCI', 'type-PF', 'type-VF')), 'request_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'address': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}
-
free(instance=None)
-
classmethod get_by_dev_addr(context, *args, **kwargs)
-
classmethod get_by_dev_id(context, *args, **kwargs)
-
id
-
instance_uuid
-
label
-
numa_node
-
obj_make_compatible(primitive, target_version)
-
product_id
-
remove()
-
request_id
-
save(*args, **kwargs)
-
status
-
update_device(dev_dict)
Sync the content from device dictionary to device object.
The resource tracker updates the available devices periodically.
To avoid meaningless syncs with the database, we update the device
object only if a value changed.
-
updated_at
-
vendor_id