VMware Cloud Foundation

 View Only
  • 1.  API - Stretched cluster in VCF

    Posted Jan 22, 2025 09:55 AM
      |   view attached
    Dear all, good morning. I am reviewing the following documentation to tighten a consolidated VCF.
    https://developer.broadcom.com/xapis/vmware-cloud-foundation-api/latest/clusters/#_usecase_stretchCluster
     
    Point 6 describes how the cluster is tightened via API, but there is something I am not understanding. My question is whether I should modify the code when my "NSX Overlay Host" segment already has a DHCP for the TEPs and if it is necessary to create a new "uplink profile" and a new "network profile" for the AZ2 nodes.
     
    I appreciate that you can help me.
    I add a piece of information, I have two distributed virtual switches with 2 dual port NICs.
    And I attach the code.
    Thank you very much.

    Attachment(s)

    txt
    Stretched-API.txt   2 KB 1 version


  • 2.  RE: API - Stretched cluster in VCF

    Broadcom Employee
    Posted Jan 23, 2025 07:19 AM
    Edited by Marek Zdrojewski Jan 23, 2025 07:20 AM

    Hi Guillermo,

    If you want to use DHCP, you simply remove the the 'ipAddressPoolName' under 'nsxHostSwitchConfigs' and the entire section for 'ipAddressPoolsSpec' under 'nsxClusterSpec' in your JSON.

    Btw, why do you want to use DHCP for the TEP's? Static NSX IP pool simplifies the deployment by removing dependency on external DHCP server(s). 


    If I recall correctly, the uplink and network profiles are mandatory in the JSON but you'll have to test it. Once you have your JSON file finished, always validate it first with SDDC Manager or with curl command from your example. It will verify if the syntax and code is correct or if there is a section missing.

    For the 2 distributed switches, you can separate the vmnics and switches in the JSON like this:

    {
    				"hostname": "sfo02-m01-esx01.sfo.rainpole.io",
    				"hostNetworkSpec": {
    					"networkProfileName": "sfo-m01-az2-nsx-np01",
    					"vmNics": [
    						{
    							"id": "vmnic0",
    							"uplink": "uplink1",
    							"vdsName": "sfo-m01-cl01-vds01"
    						},
    						{
    							"id": "vmnic1",
    							"uplink": "uplink2",
    							"vdsName": "sfo-m01-cl01-vds01"
    						},
    						{
    							"id": "vmnic2",
    							"uplink": "uplink1",
    							"vdsName": "sfo-m01-cl01-vds02"
    						},
    						{
    							"id": "vmnic3",
    							"uplink": "uplink2",
    							"vdsName": "sfo-m01-cl01-vds02"
    						}
    					]
    				},




  • 3.  RE: API - Stretched cluster in VCF

    Posted Jan 23, 2025 03:42 PM
    Thanks Marek! Good afternoon! 
    Look, we chose to deploy the NSX Host Overlay segment from the DHCP "bring-up" because we get an error when we try to extend the cluster. This happened to us with another client, so we decided to have DHCP for this one. Complete the code by adding the 4 nodes that I need to add.
     
    This is how the corrected code turned out:
    $ curl 'https://sfo-vcf01.rainpole.io/v1/clusters/2d54bb6c-637a-49a4-a94c-622671d0ab32/validations' -i -X POST \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Bearer etYWRta....' \
        -d '{
      "clusterStretchSpec" : {
        "hostSpecs" : [ {
          "id" : "657dbbb1-8806-4080-abb2-69d1e12d32e6",NODO 1
          "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
          "username" : "root",
          "hostNetworkSpec" : {
            "vmNics" : [ {
              "id" : "vmnic0",
              "vdsName" : "sfo-w01-cl02-vds01",
              "uplink" : "uplink1"
            }, {
              "id" : "vmnic1",
              "vdsName" : "sfo-w01-cl02-vds01",
              "uplink" : "uplink2"
            }, {
              "id" : "vmnic2",
              "vdsName" : "sfo-w01-cl02-vds02",
              "uplink" : "uplink1"
            }, {
              "id" : "vmnic3",
              "vdsName" : "sfo-w01-cl02-vds02",
              "uplink" : "uplink2"
            }, ],
            "networkProfileName" : "az2-sub-tnp"
          }
        }, {
          "id" : "657dbbb1-8806-4080-abb2-69d1e12d32e6",NODO 2
          "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
          "username" : "root",
          "hostNetworkSpec" : {
            "vmNics" : [ {
              "id" : "vmnic0",
              "vdsName" : "sfo-w01-cl02-vds01",
              "uplink" : "uplink1"
            }, {
              "id" : "vmnic1",
              "vdsName" : "sfo-w01-cl02-vds01",
              "uplink" : "uplink2"
            }, {
              "id" : "vmnic2",
              "vdsName" : "sfo-w01-cl02-vds02",
              "uplink" : "uplink1"
            }, {
              "id" : "vmnic3",
              "vdsName" : "sfo-w01-cl02-vds02",
              "uplink" : "uplink2"
            }, ],
            "networkProfileName" : "az2-sub-tnp"
          }
        }, {
          "id" : "657dbbb1-8806-4080-abb2-69d1e12d32e6",NODO 3
          "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
          "username" : "root",
          "hostNetworkSpec" : {
            "vmNics" : [ {
              "id" : "vmnic0",
              "vdsName" : "sfo-w01-cl02-vds01",
              "uplink" : "uplink1"
            }, {
              "id" : "vmnic1",
              "vdsName" : "sfo-w01-cl02-vds01",
              "uplink" : "uplink2"
            }, {
              "id" : "vmnic2",
              "vdsName" : "sfo-w01-cl02-vds02",
              "uplink" : "uplink1"
            }, {
              "id" : "vmnic3",
              "vdsName" : "sfo-w01-cl02-vds02",
              "uplink" : "uplink2"
            }, ],
            "networkProfileName" : "az2-sub-tnp"
          }
        }, {
          "id" : "657dbbb1-8806-4080-abb2-69d1e12d32e6",NODO 4
          "licenseKey" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
          "username" : "root",
          "hostNetworkSpec" : {
            "vmNics" : [ {
              "id" : "vmnic0",
              "vdsName" : "sfo-w01-cl02-vds01",
              "uplink" : "uplink1"
            }, {
              "id" : "vmnic1",
              "vdsName" : "sfo-w01-cl02-vds01",
              "uplink" : "uplink2"
            }, {
              "id" : "vmnic2",
              "vdsName" : "sfo-w01-cl02-vds02",
              "uplink" : "uplink1"
            }, {
              "id" : "vmnic3",
              "vdsName" : "sfo-w01-cl02-vds02",
              "uplink" : "uplink2"
            }, ],
            "networkProfileName" : "az2-sub-tnp"
          }
        } ],
        "witnessSpec" : {
          "vsanIp" : "10.0.4.88",
          "fqdn" : "witness-vsan.sfo.rainpole.io",
          "vsanCidr" : "10.0.4.0/24"
        },
        "witnessTrafficSharedWithVsanTraffic" : false,
        "networkSpec" : {
          "nsxClusterSpec" : {
              "uplinkProfiles" : [ {
              "name" : "uplink-profile-1",
              "teamings" : [ {
                "policy" : "FAILOVER_ORDER",
                "activeUplinks" : [ "uplink-1" ],
                "standByUplinks" : [ "uplink-2" ]
              } ],
              "transportVlan" : 100
            } ]
          },
          "networkProfiles" : [ {
            "name" : "az2-sub-tnp",
            "description" : "AZ2 Sub-TNP",
            "nsxtHostSwitchConfigs" : [ {
              "vdsName" : "sfo-w01-cl02-vds01",
              "uplinkProfileName" : "uplink-profile-1",
              "vdsUplinkToNsxUplink" : [ {
                "vdsUplinkName" : "uplink1",
                "nsxUplinkName" : "uplink-1"
              }, {
                "vdsUplinkName" : "uplink2",
                "nsxUplinkName" : "uplink-2"
              } ]
            } ]
          } ]
        }
      }
    }'

    Is this ok? Look at the line:
     
    "ipAddressPoolsSpec" : [ { } ],
     
    I have deleted all the content, will this take me to DHCP by default?
    and to this line "ipAddressPoolName" : "ip-address-pool"
    I deleted it from the "nsxtHostSwitchConfigs" section

    On the other hand, I have been investigating and in theory it would not be necessary to create a "network profile" for AZ2, if the TEP network is extended. So you probably have to edit the "networkProfileName" part: "az2-sub-tnp"

    Thanks Marek!




  • 4.  RE: API - Stretched cluster in VCF

    Broadcom Employee
    Posted Jan 24, 2025 08:31 AM
    Edited by Marek Zdrojewski Jan 24, 2025 08:33 AM

    I cross-referenced to an example that I used in a lab and the JSON you provided should work (except for JSON syntax error with "NODO 1" etc.) :)

    I cannot confirm the actual values but did you already tried to validate the JSON by SDDC Manager? If so, what was the result?

    Cheers.




  • 5.  RE: API - Stretched cluster in VCF

    Posted Jan 24, 2025 08:50 AM
    Thank you very much, dear Marek, for your willingness. As soon as we do it on the client, I'll let you know the result.
     
    Regards!