'Create a volume (disk).
:param  size: Size of volume to create (in GB).
:type   size: ``int``
:param  name: Name of volume to create
:type   name: ``str``
:keyword  location: Location (zone) to create the volume in
:type     location: :class:`NodeLocation` or ``None``
:keyword  snapshot: Snapshot to create image from
:type     snapshot: :class:`Snapshot`
:return:  Storage Volume object
:rtype:   :class:`StorageVolume`'

def create_volume(self, size, name, location=None, snapshot=None):

    disk_param = {'name': name, 'size': int(size), 'datacenter_id': int(location.id)}
    if snapshot:
        op = self.connection.request('hosting.disk.create_from', disk_param, int(snapshot.id))
    else:
        op = self.connection.request('hosting.disk.create', disk_param)
    if self._wait_operation(op.object['id']):
        disk = self._volume_info(op.object['disk_id'])
        return self._to_volume(disk)
    return None
