Delete a private cloud
A private cloud consists of one or more vSphere clusters. When you delete a private cloud, all clusters and their nodes are deleted.
Before you begin
Deleting a private cloud deletes the entire private cloud. All components of the private cloud are deleted, including all of the private cloud nodes. If you want to keep any of the data, back up the data to on-premises storage or other storage.
The components of a private cloud include:
- Nodes
- Virtual machines
- Management VLANs and subnets
- Workload subnets
- All user data stored on the private cloud
- All firewall rule attachments to a subnet
gcloud and API requirements
To use the gcloud
command line tool or the API to manage your VMware Engine
resources, we recommend configuring the tools as described below.
gcloud
Set your default project ID:
gcloud config set project PROJECT_ID
Set a default region and/or zone:
gcloud config set compute/region REGION
gcloud config set compute/zone ZONE
For more information on the gcloud vmware
tool,
reviewing the Cloud SDK reference docs.
API
API examples in this documentation set use the cURL
command-line tool to
query the API. A valid access token is required as part of the cURL
request.
There are many ways to get a valid access token; the following steps use the
gcloud
tool to generate a access token:
Login to Google Cloud
gcloud auth login
Generate access token and export to TOKEN
export TOKEN=`gcloud auth print-access-token`
Verify that TOKEN is set properly
echo $TOKEN Output: TOKEN
Now, use the authorization token in your requests to the API. For example:
curl -X GET -H "Authorization: Bearer \"$TOKEN\"" -H "Content-Type: application/json; charset=utf-8" https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations
Python
Python code samples in this documentation use the VMware Engine library to communicate with the API. To be able to use this approach, the library needs to be installed and the Application Default Credentials should be configured.
Download and install the Python library
pip install google-cloud-vmwareengine
Configure the ADC information by executing those command in your shell
gcloud auth application-default login
or use a Service Account key file
export GOOGLE_APPLICATION_CREDENTIALS="FILE_PATH"
For more information about the library, visit the reference page or view code samples on GitHub.
Delete a private cloud
Console
- Access the VMware Engine portal.
- Open the Resources page.
- Select the private cloud you want to delete.
- On the summary page, click Delete this Private Cloud.
- On the confirmation page, you're prompted to verify all of the results of the delete action. Read these carefully and continue with the deletion only if you're ready to accept the results. When you are ready to accept the results, select all of the checkboxes.
- Enter a number of hours to wait before running the deletion (1‑8 hours). Within that period, you can cancel the deletion by clicking Cancel.
- To verify that you know which private cloud you are deleting, enter the name of the private cloud to delete.
- Click Delete to mark the private cloud for deletion.
The deletion process starts after the specified delay, in hours, and runs to completion.
gcloud
gcloud vmware private-clouds delete PC_NAME \ --location=ZONE [--delay-hours=HOURS]
Replace the following:
PC_NAME
: the name for the private cloudZONE
: the zone for this private cloudHOURS
: the numbers of hours to delay this request. By default, this is set to 3 hours, but you can set this from 0 to 8 hours. Setting this value to 0 means the deletion request will start immediately.
API
curl -X DELETE -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json; charset=utf-8" https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/ZONE/privateClouds?privateCloudId=PC_NAME&mps;delayHours=HOUR
Replace the following:
TOKEN
: the authorization token for this request.PROJECT_ID
: the project for this requestZONE
: the zone for the private cloudPC_NAME
: the name for the private cloudHOUR
: the number of hours to delay this request; the default is 3. You can set an hour between 0 to 8. Setting this value to 0 starts the deletion request immediately.
Python
Deleting a private cloud with the VMWare Engine library is a one-step process compared to using Cloud Console. Be very careful when calling private cloud deletion methods.
Cancel deletion of a private cloud
You can cancel the deletion of a private cloud within the wait period. Use the following steps.
Console
- Access the VMware Engine portal
- Open the Resources page.
- Select the private cloud that you have marked for deletion.
- On the summary page, click Cancel deletion to cancel the deletion of the private cloud.
gcloud
gcloud vmware private-clouds undelete PC_NAME \ --location=ZONE
Replace the following:
PC_NAME
: the name for the private cloudZONE
: the zone for this private cloud
API
curl -X POST -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json; charset=utf-8" https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/ZONE/privateClouds?privateCloudId=PC_NAME:undelete
Replace the following:
TOKEN
: the authorization token for this request.PROJECT_ID
: the project for this requestZONE
: the zone for the private cloudPC_NAME
: the name for the private cloud