Last week internally we had a debate about the overhead of a swap file in a stretched cluster. With the ability to have a double protection (across site and within a site) the question was what the overhead for a swap file would be. You can imagine that for a stretched cluster you set your VMs to have RAID-1 across site and RAID-1 within or RAID-5 within the site. (Depending on whether you have all-flash or not.) So the question is, how many copies of the swap file would you end up with?
The swap file with vSAN is a special object. Regardless of how the policy you associate with the VM, it is always created as a RAID-1 object. This goes for a normal cluster as well as a stretched cluster. That means that the Swap object will always consist of 3 components. Two of those are data components and one of them is a witness.
In the first screenshot you see a VM which is called R1+R1. This VM has Primary Failures To Tolerate (PFTT) set to 1 and Secondary Failures To Tolerate (SFTT) set to 1. The swap however, as it is a special object, is created with PFTT=1 and SFTT=0 as the screenshot shows. It has 1 data component in each site, and a witness in the witness site.
Same applies for the situation when PFTT=1 and SFTT=1 but the failure tolerance method selected is RAID-5. In that case the swap file is also PFTT=1 and SFTT=0 as shown in the screenshot below.
And of course I also double checked through RVC:
vsan.object_info . bf7fdc59-dd62-2983-ee34-02002304a139 DOM Object: bf7fdc59-dd62-2983-ee34-02002304a139 (v5, owner: 10.162.39.160, proxy owner: None, policy: hostFailuresToTolerate = 1, forceProvisioning = 1, proportionalCapacity = 100, CSN = 2) RAID_1 Component: bf7fdc59-86bc-4884-d236-02002304a139 (state: ACTIVE (5), host: 10.162.39.160, md: mpx.vmhba1:C0:T1:L0, ssd: mpx.vmhba1:C0:T4:L0, votes: 1, usage: 4.1 GB, proxy component: false) Component: bf7fdc59-1830-4b84-5138-02002304a139 (state: ACTIVE (5), host: 10.162.37.120, md: mpx.vmhba1:C0:T2:L0, ssd: mpx.vmhba1:C0:T4:L0, votes: 1, usage: 4.1 GB, proxy component: false) Witness: bf7fdc59-6f4a-4d84-725b-02002304a139 (state: ACTIVE (5), host: 10.162.59.195, md: mpx.vmhba1:C0:T1:L0, ssd: mpx.vmhba1:C0:T4:L0, votes: 1, usage: 0.0 GB, proxy component: false)
So this means the overhead of swap is always “only” 100%. However, you can of course create “thin swapfiles” when you are not over-provisioning on memory and avoid that cost completely!
Karem says
Great subject