When creating a VM, I'm presented with how many sockets and how many cores per socket. If I want a total of 4 CPUs, does it make any difference whether I get them by having two sockets, each with two cores, or by having one socket with four cores?
There's no difference regarding performance. This feature was mainly introduced to be able to assign multi-core vCPUs to guest operating systems which have a limit on supported CPUs. Another use-case could be licensing, where teh software is licensed by CPU sockets. However you need to be careful with licensing, as some vendors license the sockets on the host rather than the ones presented to the VM.
There are also technical implications regarding CPU scheduling:
It makes NO difference, If you are able to assign multi cores.
In contrary, it makes a slight difference in very high CPU utilized virtual machines if you can match the virtual socket and core counts to NUMA nodes in your server. If you have a busy host, say a four socket four core server, and you have two virtual machines running identical workloads, one configured with a single vsocket with four cores and the other with two vsocket two core configurations, my theory is that the two vsocket two core config would perform minutely better because vSphere would map the workloads to each of two NUMA nodes. I cannot confirm this, but am working on getting access to some big hardware so I can run tests like this. Our best practice is to try to pair the VM configuration to match the host configuration. An EMC engineer told me at VMworld last year that there were slight performance bumps by doing this.