def attach_cd(session, vm_ref, vdi_ref, userdevice):
 vbd_ref = create_vbd(session, vm_ref, None, userdevice, vbd_type='cd', read_only=True, bootable=True, empty=True, unpluggable=False)
 session.call_xenapi('VBD.insert', vbd_ref, vdi_ref)
 return vbd_ref

def attach_cd ( session , vm_ref , vdi_ref , userdevice ) : vbd_ref = create_vbd ( session , vm_ref , None , userdevice , vbd_type = 'cd' , read_only = True , bootable = True , empty = True , unpluggable = False ) session . call_xenapi ( 'VBD.insert' , vbd_ref , vdi_ref ) return vbd_ref
create an empty vbd .