Swap [partition,file] on a Linux vm guest

I am building a Cloud-init template in XCP-ng. I want to be able to easily resize the root partition. I can put the swap partition before the root partition, or I can not have a swap partition and use a swap file. They are both stored on the same vdisk. Does it matter for Linux, as long as there is a swap area?

It doesn’t really matter either way. You can also not have a swap at all provided you size the VM memory correctly for the apps you’re going to run.