Add function to get partition index from vnode state