Set CPU affinity for specific VM on vmware ESXI using govc CLI

Solution 1:

I didn't figure out how to do it through govc CLI, but I figured out you can add sched.cpu.affinity = 2-8,9 to your VMX file in your ESXi datastore, and it will set the CPU affinity for that specific VM accordingly. In the example above, it would mean CPUs 2 through 8 and CPU 9 would have the affinity set for this specific VM.