#NEWLINE# def create_snapshots( self , service_project_link , volume_ids , prefix = 'Cloned volume' ) : #NEWLINE# #INDENT# cinder = self . cinder_client #NEWLINE# logger . debug ( 'About to snapshot volumes %s' , ', ' . join ( volume_ids ) ) #NEWLINE# try : #NEWLINE# #INDENT# snapshot_ids = [ ] #NEWLINE# for volume_id in volume_ids : #NEWLINE# #INDENT# snapshot = self . create_snapshot ( volume_id , cinder ) #NEWLINE# service_project_link . add_quota_usage ( 'storage' , self . gb2mb ( snapshot . size ) ) #NEWLINE# snapshot_ids . append ( snapshot . id ) #NEWLINE# #UNINDENT# #UNINDENT# except ( cinder_exceptions . ClientException , keystone_exceptions . ClientException ) as e : #NEWLINE# #INDENT# logger . exception ( 'Failed to snapshot volumes %s' , ', ' . join ( volume_ids ) ) #NEWLINE# six . reraise ( OpenStackBackendError , e ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . info ( 'Successfully created snapshots %s for volumes.' , ', ' . join ( snapshot_ids ) ) #NEWLINE# #UNINDENT# return snapshot_ids