Use the key word WITH once at the top. If any of your Common Table Expressions (CTE) are recursive (rCTE) you have to add the keyword RECURSIVE at the top once also, even if not all CTEs are recursive:
WITH RECURSIVE
cte1 AS (...) -- can still be non-recursive
, cte2 AS (SELECT ...
UNION ALL
SELECT ...) -- recursive term
, cte3 AS (...)
SELECT ... FROM cte3 WHERE ...
with RECURSIVE local as(select sum(cast(capacity as bigint))*0.2 as reserve from public.vpx_datastore d where d.id in ('23016','23217')
and d.name like 'ds%' and d.name not like '%HDD'),
shared as (select count(id)*858993459200 as reserve from public.vpx_datastore d where d.id in ('23016','23217')
and d.name like 'Cml%')
select * from local