- Default plugins do not have a separate direct download available on VMware Customer Connect.
- If these plugins are disabled or deleted from Cloud Director the Cloud Director database will need to be restored from a backup taken before the plugins were deleted, Backup and Restore of Your VMware Cloud Director Appliance
- Alternatively, the deleted default plugin can be retrieved from one of the Cloud Director Cells in the cluster and re-uploaded as per the workaround below.
Workaround:
-
- The preinstalled default plugins can be retrieved for upload from a Cloud Director Cell by running the script, unpack_plugins.sh, attached to this KB.
- Even when the plugin has been deleted from Cloud Director it can still be retrieved from the same Cells for re-upload. Example steps are as follows:
1. Backup Cloud Director before making any changes, Backup and Restore of Your VMware Cloud Director Appliance
2. Download the script from this KB, unpack_plugins.sh, and upload it to the /tmp directory on one of the Cloud Director Cells in the cluster:
/tmp/unpack_plugins.sh
3. SSH to this Cloud Director Cell where the script has been uploaded.
4. Modify the script to make it executable:
chmod u+x /tmp/unpack_plugins.sh
5. Run the script to extract all of the default plugins which Cloud Director would install on initial setup or upgrade:
/tmp/unpack_plugins.sh
6. List the extracted plugins which have been extracted as ZIP files ready for upload to Cloud Director:
ls -l /tmp/cloud-director-solutions-1.0.0/AllPlugins
7. Download the ZIP from the Cloud Director Cell for the plugin which is to be re-uploaded.
8. Log into the Cloud Director Provider portal as a System Administrator.
9. Navigate to More, Customize Portal, and upload the plugin ZIP as per the documentation, Upload a Plug-in to Your VMware Cloud Director.
If the Customize Portal plugin is missing as it was deleted then uploading through the Cloud Director UI will not be available. Instead, the Customize Portal plugin must be re-uploaded using the Cloud Director API as follows:
- Extract the manifest.json file from the Customize Portal ZIP retrieved using the steps above and open it in a text editor.
- Take the version value from the manifest.json and populate the version field in the following JSON:
{
"pluginName": "Customize Portal",
"description": "Customize Portal is UI Plugin for UI Plugin management.",
"enabled": true,
"license": "MIT",
"link": "http://www.vmware.com",
"vendor": "VMware",
"version": "<PLUGIN_VERSION>",
"tenant_scoped": false,
"provider_scoped": true
}
For example, in a Cloud Director 10.5.1 environment the manifest.json would have "version": "4.0.0" and the so we would construct the JSON as follows:
{
"pluginName": "Customize Portal",
"description": "Customize Portal is UI Plugin for UI Plugin management.",
"enabled": true,
"license": "MIT",
"link": "http://www.vmware.com",
"vendor": "VMware",
"version": "4.0.0",
"tenant_scoped": false,
"provider_scoped": true
}
- Save this JSON as customize-portal.json and move it to a client machine which has curl or another REST API client installed.
- Move the Customize Portal ZIP to a client machine which has curl or another REST API client installed.
- From this client machine log in to Cloud Director as a System Administrator via the API and retrieve a session token.
- Using the JSON file from step 3 above, and the session token from step 4 above, send the following API call to Cloud Director to recreate the Customize Portal Extension:
curl -k -H 'Accept: application/json;version=<VCD_API_VERSION>' -H 'Content-Type: application/json' -H 'Authorization: Bearer <SESSION_TOKEN>' -X POST https://<VCD_URL>/cloudapi/extensions/ui -d @customize-portal.json
- This API call should result in a JSON response including a new "id": "urn:vcloud:uiPlugin:<PLUGIN_UUID>" which should be noted for use later on in this process:
{
"pluginName": "Customize Portal",
"vendor": "VMware",
"description": "Customize Portal is UI Plugin for UI Plugin management.",
"version": "<PLUGIN_VERSION>",
"license": "MIT",
"link": "http://www.vmware.com",
"tenant_scoped": false,
"provider_scoped": true,
"enabled": true,
"id": "urn:vcloud:uiPlugin:<PLUGIN_UUID>",
"plugin_status": "unavailable",
"resourcePath": ""
}
- Construct JSON for the plugin upload using the name and size of the Customize Plugin ZIP which is to be uploaded:
{
"fileName": "<FILE_NAME>",
"size": <FILE_SIZE>
}
For example we would create the following for the Customize Portal plugin for Cloud Director 10.5.1:
{
"fileName": "customize-portal_7991199_plugin.zip",
"size": 353472
}
- Save this JSON as customize-portal-resource.json and move it to a client machine which has curl or another REST API client installed.
- Using the JSON file from step 9 above, and the session token from step 4 above, send the following API call to Cloud Director to initiate the upload of the plugin:
curl -kv -H 'Accept: application/json;version=<VCD_API_VERSION>' -H 'Content-Type: application/json' -H 'Authorization: Bearer <SESSION_TOKEN>' -X POST https://<VCD_URL>/cloudapi/extensions/ui/<PLUGIN_UUID>/plugin -d @customize-portal-resource.json
- This PUT should result in a 204 response and response headers which include a Link header which contains the path to which the plugin file needs to be uploaded:
Link: <https://<VCD_URL>/transfer/<TRANSFER_UUID>/<FILE_NAME>>;rel="upload:default";type="application/octet-stream"
- Using this Link in step 11 above construct and run an API call to upload the Customize Portal plugin ZIP file:
curl -kv -H 'Accept: application/json;version=<VCD_API_VERSION>' -H 'Content-Type: application/zip' -H 'Content-Range: bytes 0-<FILE_SIZE>/<FILE_SIZE>' -H 'Authorization: Bearer <SESSION_TOKEN>' -X PUT https://<VCD_URL>/transfer/<TRANSFER_UUID>/<FILE_NAME> --data-binary @<FILE_NAME>
- With the plugin file uploaded perform a GET on the plugins to confirm Customize Portal is listed, enabled, and ready:
curl -k -H 'Accept: application/json;version=<VCD_API_VERSION>' -H 'Authorization: Bearer <SESSION_TOKEN>' -X GET https://<VCD_URL>/cloudapi/extensions/ui
In the JSON response the Customize Portal plugin should be similar to the following:
{
"pluginName": "Customize Portal",
"vendor": "VMware",
"description": "Customize Portal is UI Plugin for UI Plugin management.",
"version": "<PLUGIN_VERSION>",
"license": "MIT",
"link": "http://www.vmware.com",
"tenant_scoped": false,
"provider_scoped": true,
"enabled": true,
"id": "urn:vcloud:uiPlugin:<PLUGIN_UUID>",
"plugin_status": "ready",
"resourcePath": "/tenant/System/uiPlugins/<PLUGIN_UUID>/<RESOURCE_UUID>"
}
- The final step is to log in to the Cloud Director Provider portal as a System Administrator to confirm the plugin is now available.