The nova.virt.block_device Module

class DriverBlankBlockDevice(bdm)

Bases: nova.virt.block_device.DriverVolumeBlockDevice

attach(context, instance, volume_api, virt_driver, wait_func=None, do_check_attach=True)
class DriverBlockDevice(bdm)

Bases: dict

A dict subclass that represents block devices used by the virt layer.

Uses block device objects internally to do the database access.

_fields and _legacy_fields class attributes present a set of fields that are expected on a certain DriverBlockDevice type. We may have more legacy versions in the future.

If an attribute access is attempted for a name that is found in the _proxy_as_attr set, it will be proxied to the underlying object. This allows us to access stuff that is not part of the data model that all drivers understand.

The save() method allows us to update the database using the underlying object. _update_on_save class attribute dictionary keeps the following mapping:

{‘object field name’: ‘driver dict field name (or None if same)’}

These fields will be updated on the internal object, from the values in the dict, before the actual database update is done.

attach(**kwargs)

Make the device available to be used by VMs.

To be overridden in subclasses with the connecting logic for the type of device the subclass represents.

legacy()

Basic legacy transformation.

Basic method will just drop the fields that are not in _legacy_fields set. Override this in subclass if needed.

save()
class DriverEphemeralBlockDevice(bdm)

Bases: nova.virt.block_device.DriverBlockDevice

legacy(num=0)
class DriverImageBlockDevice(bdm)

Bases: nova.virt.block_device.DriverVolumeBlockDevice

attach(context, instance, volume_api, virt_driver, wait_func=None, do_check_attach=True)
class DriverSnapshotBlockDevice(bdm)

Bases: nova.virt.block_device.DriverVolumeBlockDevice

attach(context, instance, volume_api, virt_driver, wait_func=None, do_check_attach=True)
class DriverSwapBlockDevice(bdm)

Bases: nova.virt.block_device.DriverBlockDevice

class DriverVolumeBlockDevice(bdm)

Bases: nova.virt.block_device.DriverBlockDevice

attach(obj, context, *args, **kwargs)
refresh_connection_info(obj, context, *args, **kwargs)
save()
attach_block_devices(block_device_mapping, *attach_args, **attach_kwargs)
convert_all_volumes(*volume_bdms)
convert_volume(volume_bdm)
get_swap(transformed_list)

Get the swap device out of the list context.

The block_device_info needs swap to be a single device, not a list - otherwise this is a no-op.

is_block_device_mapping(bdm)
is_implemented(bdm)
legacy_block_devices(block_device_mapping)
refresh_conn_infos(block_device_mapping, *refresh_args, **refresh_kwargs)
update_db(method)

Previous topic

The nova.version Module

Next topic

The nova.virt.configdrive Module

Project Source

This Page