def _import_migrated_vhds(session, instance, chain_label, disk_type, vdi_label):
 imported_vhds = session.call_plugin_serialized('migration.py', 'move_vhds_into_sr', instance_uuid=chain_label, sr_path=get_sr_path(session), uuid_stack=_make_uuid_stack())
 scan_default_sr(session)
 vdi_uuid = imported_vhds['root']['uuid']
 vdi_ref = session.call_xenapi('VDI.get_by_uuid', vdi_uuid)
 _set_vdi_info(session, vdi_ref, disk_type, vdi_label, disk_type, instance)
 return {'uuid': vdi_uuid, 'ref': vdi_ref}

def _import_migrated_vhds ( session , instance , chain_label , disk_type , vdi_label ) : imported_vhds = session . call_plugin_serialized ( 'migration.py' , 'move_vhds_into_sr' , instance_uuid = chain_label , sr_path = get_sr_path ( session ) , uuid_stack = _make_uuid_stack ( ) ) scan_default_sr ( session ) vdi_uuid = imported_vhds [ 'root' ] [ 'uuid' ] vdi_ref = session . call_xenapi ( 'VDI.get_by_uuid' , vdi_uuid ) _set_vdi_info ( session , vdi_ref , disk_type , vdi_label , disk_type , instance ) return { 'uuid' : vdi_uuid , 'ref' : vdi_ref }
move and possibly link vhds via the xapi plugin .