vCloud Director 9.7 Edge Cluster Placement

With the release of vCloud Director 9.7, there were two things that are related to Edge Placement:

  • The old process of doing Edge placement via the metadata (through the PvDC properties) is deprecated.
  • The new process is API driven.

The new way of assigning edge cluster placement suggests two things:

  • An edge cluster is defined as an entity via API, where the edge cluster resembles a resource pool (it could be the highest resource pool [Resources] as in the cluster itself, or it could be a newly created resource pool that will incorporate edge devices). If you have a single edge cluster, and you’ve done a proper design and sizing for it then you’d probably want to add [Resources] so that to make this step a less of an administration overhead.
  • An edge cluster is bound per OvDC, and this is typically for an OvDC that will have an Edge Gateway device (not all OvDCs might have one) and this is a task that you will be doing on the creation of an OvDC (most probably part of onboarding customers).

So what is needed:

  • You will need to have an edge cluster, configured for VXLAN and the VLAN backed port-groups residing there.
  • You will need to have a storage profile added to vCloud Director that can match the storage capabilities of the Edge Cluster.
  • You will need a vCD System Administrator access.
  • You will need PowerCLI.
  • The two API calls that we are keen to work with are EdgeClusters and networkProfile.
  • An authorization bearer, for me the fastest way to get it is by going to the API Explorer and try-out any GET operation then copy the bearer from it and use it with Postman for example.
  • An Organization with an Organization VDC created.

Configuration Iteration (Edge Clusters Creation):

  • Log in to your vCloud Director infrastructure (either a cell or the LB VIP).
  • Head to the API Explorer -> https://<Cell or VIP address>/api-explorer/provider/
  • Search for edgeClusters.
  • You will notice that for this API call we allowed to either GET or POST, if you want to modify an edge cluster you will need to look for the edgeCluster (without an s) API call and this one has PUT allowed to it.
  • So based on this, we will need to POST to https://<Cell or VIP address>/cloudapi/1.0.0/edgeClusters the following syntax:
{
  "id": "string", 
  "name": "string",
  "description": "string",
  "resourcePool": {
    "moref": "string",
    "name": "string",
    "vcId": "string"
  },
  "storageProfileName": "string"
}
  • id -> This is automatically generated, no need to include it in the body.
  • name -> This is written by us for example EdgeCluster-01.
  • description -> This is written by us for further details.
  • resourcePool -> moref and name can be retrieved via PowerCLI (MoRef id will also include the name so you will only need to copy this value which is resgroup-##):
Get-Cluster EdgeClusterName | Get-ResourcePool | ft Name, Id
  • vcId -> You will need to get this via an API call https://<Cell or VIP address>/api/admin/extension/vimServerReferences and look for the id of the vCenter Server managing this Edge Cluster which has been already added to vCloud Director.
    • From the GET result you will be looking for a value that looks like this “urn:vcloud:vimserver:626503a4-0416-1ad7-93d0-68263ddc4e92“.
  • Now that we have all of information needed, the JSON script body should look like this:
{
  "name": "EdgeCluster-01",
  "description": "It is I the EdgeCluster-01",
  "resourcePool": {
    "moref": "resgroup-49",
    "name": "Resources",
    "vcId": "urn:vcloud:vimserver:626503a4-0416-1ad7-93d0-68263ddc4e92"
  },
  "storageProfileName": "RAID1-FTT1-vSAN-Policy"
}
  • Once the call returns a 200 that it is okay, you can quickly run another GET against https://<Cell or VIP Address>/cloudapi/1.0.0/edgeClusters you should get this as a result (notice the newly created id for the Edge Cluster, copy it because you will need it):
{
  "resultTotal": 1,
  "pageCount": 1,
  "page": 1,
  "pageSize": 25,
  "values": [
    {
      "id": "urn:vcloud:edgeCluster:22a36c9d-103e-616b-deca-2ca7d28dce69",
      "name": "EdgeCluster-01",
      "description": "It is I the EdgeCluster-01",
      "resourcePool": {
        "moref": "resgroup-49",
        "name": "Resources",
        "vcId": "urn:vcloud:vimserver:626503a4-0416-1ad7-93d0-68263ddc4e92"
      },
      "storageProfileName": "RAID1-FTT1-vSAN-Policy"
    }
  ]
}

Configuration Iteration (Edge Clusters to OvDC Assignment):

  • Log in to your vCloud Director infrastructure (either a cell or the LB VIP).
  • Head to the API Explorer -> https://<Cell or VIP address>/api-explorer/provider/Search for networkProfile.
  • You will notice that for this API call there is no POST as this addresses an already created OvDC and we’re supposed to update this configuration for it via a PUT.
  • So based on this, we will need to PUT to https://<Cell or VIP address>/cloudapi/1.0.0/<OvDCId>/networkProfile via the following syntax:
{
  "primaryEdgeCluster": {
    "name": "string",
    "id": "string"
  },
  "secondaryEdgeCluster": {
    "name": "string",
    "id": "string"
  }
}
  • Before defining what is needed, notice that there is a Primary Edge Cluster and a Secondary Edge Cluster, and in the case both are defined for an OvDC, when you an Edge Gateway is created and HA is enabled for it the primary/active appliance will be deployed to the Primary Edge Cluster and the secondary/passive appliance will be deployed to the Secondary Edge Cluster, on the other hand if only a Primary Edge Cluster is defined the active and passive appliances will be deployed on the it.
  • OvDCId -> We can get this via PowerCLI:
Get-OrgVdc -Name <OvDC Name> | fl
  • OvDCId -> Extract the ID from the required OvDC and it should look something like this -> urn:vcloud:vdc:671196d2-5de9-1c7e-961c-b2168dd12e82
  • For the primaryEdgeCluster name and id we already have those from the previous edgeClusters POST that we did.
  • Now that we have all of the information needed, we will be doing a PUT to https://<Cell or VIP Address>/cloudapi/1.0.0/vdcs/urn:vcloud:vdc:671196d2-5de9-1c7e-961c-b2168dd12e82/networkProfile using the following JSON syntax:
{
  "primaryEdgeCluster": {
    "name": "EdgeCluster-01",
    "id": "urn:vcloud:edgeCluster:22a36c9d-103e-616b-deca-2ca7d28dce69"
  }
}
  • Once sent you should get a 200 response, if you do another GET call you should notice that the OvDC now has a Primary Edge Cluster and no Secondary Edge Cluster configured.

A couple of things before I wrap up:

  • Via the GUI you will not notice anything (only an OvDC configuration update the vCloud Director recent tasks).
  • You don’t have to add the Edge Cluster as an additional resource pool for the PvDC.
  • When you create the External Networks you will notice that at the end of the configuration dialogue that the external network is not applicable to any PvDC, this is normal and once you create an Edge Gateway device it will be created on the Primary Edge Cluster as configured.

Thank you for your time =),
(Abdullah)^2

5762 Total Views 1 Views Today

Abdullah

Knowledge is limitless.

2 Responses

  1. bharath says:

    Hi Daniel and Abhinav, To add edge cluster resource-pool resgroup-id using Api calls, by mistake I have updated wrong resgroup Id. Please guide me how to replace the resgroup Id or to delete it.

    Many blogs are available to POST the configuration but to DELETE or REPLACE..???

  2. bharath says:

    **********************
    {
    “name”: “US_Edge_Cluster”,
    “description”: “Deploy Edge from vcd”,
    “resourcePool”: {
    “moref”: “resgroup-115”,
    “vcId”: “urn:vcloud:vimserver:3b201833-43b2-4dce-aa71-8ceebe2a1f6e”
    },
    “storageProfileName”: “nfs_gold_Storage_Policy”
    }
    ********************************
    {
    “primaryEdgeCluster”: {
    “id”: “urn:vcloud:edgeCluster:45457882-ef7f-4dee-bad0-045aadc325f0”
    }
    }
    ********************************

    Instead of resgroup-72, i have added resgroup-115 by mistake. Please guide me how to correct it via API calls.

    ************************************

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.