#NEWLINE# def copy_virtual_disk( session , dc_ref , source , dest ) : #NEWLINE# #INDENT# 'Copy a sparse virtual disk to a thin virtual disk.\n\n    This is also done to generate the meta-data file whose specifics\n    depend on the size of the disk, thin/thick provisioning and the\n    storage adapter type.\n\n    :param session: - session for connection\n    :param dc_ref: - data center reference object\n    :param source: - source datastore path\n    :param dest: - destination datastore path\n    :returns: None\n    ' #NEWLINE# LOG . debug ( 'Copying Virtual Disk %(source)s to %(dest)s' , { #NEWLINE# #INDENT# 'source' : source , #NEWLINE# 'dest' : dest , #NEWLINE# #UNINDENT# } ) #NEWLINE# vim = session . vim #NEWLINE# vmdk_copy_task = session . _call_method ( vim , 'CopyVirtualDisk_Task' , vim . service_content . virtualDiskManager , sourceName = source , sourceDatacenter = dc_ref , destName = dest ) #NEWLINE# session . _wait_for_task ( vmdk_copy_task ) #NEWLINE# LOG . debug ( 'Copied Virtual Disk %(source)s to %(dest)s' , { #NEWLINE# #INDENT# 'source' : source , #NEWLINE# 'dest' : dest , #NEWLINE# #UNINDENT# } )