#NEWLINE# def _create_volume( self , deployer ) : #NEWLINE# #INDENT# '\n        Create the volume using the backend API. This method will create the\n        volume with a profile if the metadata on the volume suggests that we\n        should.\n\n        We should consider splitting this into two separate IStateChanges,\n        one for creating a volume with a profile, and one for creating a\n        volume without a profile.\n\n        :param deployer: The deployer to use to create the volume.\n\n        :returns: The created ``BlockDeviceVolume``.\n        ' #NEWLINE# api = deployer . block_device_api #NEWLINE# profile_name = self . metadata . get ( PROFILE_METADATA_KEY ) #NEWLINE# size = allocated_size ( allocation_unit = api . allocation_unit ( ) , requested_size = self . maximum_size ) #NEWLINE# if profile_name : #NEWLINE# #INDENT# return deployer . profiled_blockdevice_api . create_volume_with_profile ( dataset_id = self . dataset_id , size = size , profile_name = profile_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return api . create_volume ( dataset_id = self . dataset_id , size = size )