'Creates a database entry for the given inputs and returns details.
Accesses the database and creates a new entry for the to be created
volume using the given volume properties which are extracted from the
input kwargs.'

def execute(self, context, **kwargs):

    volume_type = kwargs.pop('volume_type')
    volume_type_id = (volume_type['id'] if volume_type else None)
    volume_properties = {'size': 0, 'user_id': context.user_id, 'project_id': context.project_id, 'status': 'managing', 'attach_status': fields.VolumeAttachStatus.DETACHED, 'display_description': kwargs.pop('description'), 'display_name': kwargs.pop('name'), 'host': kwargs.pop('host'), 'cluster_name': kwargs.pop('cluster_name'), 'availability_zone': kwargs.pop('availability_zone'), 'volume_type_id': volume_type_id, 'metadata': (kwargs.pop('metadata') or {}), 'bootable': kwargs.pop('bootable')}
    volume = objects.Volume(context=context, **volume_properties)
    volume.create()
    return {'volume_properties': volume_properties, 'volume': volume}
