'Create a new volume snapshot.
:param volume: Volume to create a snapshot for
:type volume: class:`StorageVolume`
:return: The newly created volume snapshot.
:rtype: :class:`VolumeSnapshot`'

def create_volume_snapshot(self, volume, name):

    attr = {'name': name}
    res = self.connection.request(('/v2/volumes/%s/snapshots' % volume.id), data=json.dumps(attr), method='POST')
    data = res.object['snapshot']
    return self._to_volume_snapshot(data=data)
