VMware vSphere

 View Only
  • 1.  VM placement in stretched cluster when deployed

    Posted May 10, 2023 09:58 AM

    We have created a stretched cluster over 2 sites, backed by vSAN, all good so far. 

    Problems appear when we want to deploy a new vm with ansible. The playbook uses the cluster as a variable, not hosts, so it seems that vm placement is totally random. That is an issue as we want to deploy the vm's to only one of the sites. I know I can regulate this with drs rules, but there is no way to create rules on a vm before it is deployed? 

    Does anyone know how to make sure vm's only gets deployed to the hosts on a site of my choice? 



  • 2.  RE: VM placement in stretched cluster when deployed
    Best Answer

    Posted May 10, 2023 11:50 AM

    Hi,

    From the manual, you get:

    With Local Affinity, customers can use policies to keep data on a single  site. In this case Primary Failures to Tolerate (PFTT) = 0.

    This ensures that objects are not  replicated to the secondary site there by reducing the bandwidth required  between sites.

    Additionally, by using Affinity rules, customers can set  VM/VMDK assignments to specific hosts.

    For example, to test local affinity, you can set PFTT = 0, SFTT = 2,  FTM = RAID 5. The outcome of this test is that all IOs should be done  locally and not on the secondary site. This way, you can  seamlessly achieve host/disk protection for objects that do not require  site protection.

    A few housekeeping rules for local affinity:

    1. Affinity will only be available when Stretched Clusters is enabled
    2. DRS/HA rules should be aligned with Data Locality
    3. RAID 0 / RAID 1 are supported for Hybrid and RAID 0 / RAID 1 / RAID 5 / RAID 6 are supported for All Flash

    Honestly, I can't remember if, in the Fault Domain section, there is an option like VM Placement.

    But I am pretty sure that you can do this using VM Storage policy, using Single Site Storage Policy. With this you can create a Local Affinity.

    Hope this can help,