'It only makes sense to call this method when the
BlockDeviceMappingList contains BlockDeviceMappings from
exactly one instance rather than BlockDeviceMappings from
multiple instances.
For example, you should not call this method from a
BlockDeviceMappingList created by get_by_instance_uuids(),
but you may call this method from a BlockDeviceMappingList
created by get_by_instance_uuid().'

def root_bdm(self):

    if (len(self.instance_uuids) > 1):
        raise exception.UndefinedRootBDM()
    try:
        return next((bdm_obj for bdm_obj in self if bdm_obj.is_root))
    except StopIteration:
        return
