Bases: dict
Represents a Block Device Mapping in Nova.
Transform the API format of data to the internally used one.
Only validate if the source_type field makes sense.
Create a block device dict based on the image_ref.
This is useful in the API layer to keep the compatibility with having an image_ref as a field in the instance requests
Transform a legacy list of block devices to the new data format.
Will return non-root mappings, when exclude_root_mapping is true. Otherwise all mappings will be returned.
Determine if passed dict is a safe subset for update.
Safe subset in this case means a safe subset of both legacy and new versions of data, that can be passed to an UPDATE query without any transformation.
Transform a list of block devices of an instance back to the legacy data format.
Prepend ‘/dev/’ to ‘device’ entry of swap/ephemeral virtual type.
Matches device name and returns prefix, suffix.
Make sure there is a leading ‘/dev/’.
get root device name from image meta data. If it isn’t specified, return None.
Create a basic volume snapshot BDM from a given template bdm.
remove leading ‘/dev/’.
remove both leading /dev/ and xvd or sd or vd or hd.