def after_VBD_create(vbd_ref, vbd_rec):
    vbd_rec['currently_attached'] = False
    vbd_rec['device'] = ''
    vm_ref = vbd_rec['VM']
    vm_rec = _db_content['VM'][vm_ref]
    if vm_rec.get('VBDs', None):
        vm_rec['VBDs'].append(vbd_ref)
    else:
        vm_rec['VBDs'] = [vbd_ref]

    vm_name_label = _db_content['VM'][vm_ref]['name_label']
    vbd_rec['vm_name_label'] = vm_name_label
Create read-only fields and backref from VM to VBD when VBD is
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/virt/xenapi/fake.py/after_VBD_create