A system administrator whose authority extends to more than one vCloud Director server group can configure those server groups as an association of vCloud Director sites.
To create an association between two sites (we'll call them Site-A and Site-B here), you must be a system administrator at both sites so that you can log in to each site to retrieve the information required to associate the site with another site, then make a POST request to each site supplying the other site's association information.
The process of associating two sites can be logically decomposed into two complementary pairing operations. The first operation (in this example) pairs Site-A with Site-B. You must then go on to pair Site-B with Site-A. Until both pairings are complete, the heartbeat process reports that the association is incomplete, and even if you include multisite=global in the Accept header of a login request, the returned x-vcloud-authorization header contains only a single value, valid for the current site.
1 | Log in to Site-A and retrieve its site association data. Site association data is contained in the SiteAssociations element of the Site object. GET https://Site-A.example.com/api/site ... <Site name="Site-A" id="urn:vcloud:site:94b78377-a3f8-4970-8e44-662d209f35f7" href="https://Site-A.example.com/api/site"> ... <Link rel="down" href="https://Site-A.example.com/api/site/associations" ... /> ... </Site> The SiteAssociations element includes a link of the form: <Link rel="down" href="https://Site-A.example.com/api/site/associations/localAssociationData"/> Make a GET request to this link to retrieve the SiteAssociationMember element that contains the information required when associating this site with another site. GET https://Site-A.example.com/api/site/associations/localAssociationData ... <SiteAssociationMember ...> <Link ...> ... <RestEndpoint>https://Site-A.example.com/api</RestEndpoint> <RestEndpointCertificate>-----BEGIN CERTIFICATE----- MIIDDTCCAfWgAwIBAgI...Ix0eSE= -----END CERTIFICATE----- </RestEndpointCertificate> <SiteId>urn:vcloud:site:94b78377-a3f8-4970-8e44-662d209f35f7</SiteId> <SiteName>Site-A</SiteName> <PublicKey>-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhki...QQIDAQAB -----END PUBLIC KEY----- </PublicKey> </SiteAssociationMember> Save this response. You'll need it in Step 3. |
2 | Log in to Site-B and retrieve itsadd link for associations. This link is contained in the SiteAssociations element of the Site object . GET https://Site-B.example.com/api/site ... <Site name="Site-B" ... <Link rel="down" href="https://Site-B.example.com/api/site/associations" ... /> ... </Site> Retrieve the SiteAssociations to see this link. GET https://Site-B.example.com/api/site/associations ... <SiteAssociations ... <Link rel="add" href="https://Site-B.example.com/api/site/associations" ... /> ... </Site> |
3 | POST the SiteAssociationMember response body you retrieved in Step 1 to the siteAssociations link for Site-B. You can include the entire response body. Any Link elements from the response body are ignored in a request. For brevity, this example omits the Link elements. POST https://Site-B.example.com/api/site/associations content-type: application/vnd.vmware.admin.siteAssociation+xml ... <SiteAssociationMember ...> <RestEndpoint>https://Site-A.example.com/api</RestEndpoint> <RestEndpointCertificate>-----BEGIN CERTIFICATE----- MIIDDTCCAfWgAwIBAgI...Ix0eSE= -----END CERTIFICATE----- </RestEndpointCertificate> <SiteId>urn:vcloud:site:94b78377-a3f8-4970-8e44-662d209f35f7</SiteId> <SiteName>Site-A</SiteName> <PublicKey>-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhki...QQIDAQAB -----END PUBLIC KEY----- </PublicKey> </SiteAssociationMember> |