Welcome to the Proxmox forum, maximcpp!
It depends on what you mean with restricting access to one or two nodes. In general, there's no general solution for this currently, since VMs are viewed as independent objects (except if they're limited in hardware capabilities, e.g. because of non-resource mapped PCI passthroughs), which can be migrated between nodes. What is you exact use case?