'Builds a metadata object for instance devices, that maps the user
provided tag to the hypervisor assigned device address.'

def _save_device_metadata(self, context, instance, block_device_info):

    metadata = []
    metadata.extend(self._get_vif_metadata(context, instance.uuid))
    if block_device_info:
        metadata.extend(self._block_dev_man.get_bdm_metadata(context, instance, block_device_info))
    if metadata:
        instance.device_metadata = objects.InstanceDeviceMetadata(devices=metadata)
