'Create the volume using the backend API. This method will create the
volume with a profile if the metadata on the volume suggests that we
should.
We should consider splitting this into two separate IStateChanges,
one for creating a volume with a profile, and one for creating a
volume without a profile.
:param deployer: The deployer to use to create the volume.
:returns: The created ``BlockDeviceVolume``.'

def _create_volume(self, deployer):

    api = deployer.block_device_api
    profile_name = self.metadata.get(PROFILE_METADATA_KEY)
    size = allocated_size(allocation_unit=api.allocation_unit(), requested_size=self.maximum_size)
    if profile_name:
        return deployer.profiled_blockdevice_api.create_volume_with_profile(dataset_id=self.dataset_id, size=size, profile_name=profile_name)
    else:
        return api.create_volume(dataset_id=self.dataset_id, size=size)
