Creating a VMware Engine private cloud
A private cloud is an isolated VMware stack that consists of ESXi hosts, vCenter, vSAN, NSX-T, and HCX. You manage private clouds through the Google Cloud VMware Engine portal. When you create a private cloud, you get a single vSphere cluster and all the management VMs that are created in that cluster.
VMware Engine deploys management components in the network that you select for vSphere/vSAN subnets. The network IP address range is divided into different subnets during the deployment.
Before you begin
Before performing the tasks on this page, perform the following prerequisite steps.
- Allocate a unique IP address range for vSphere/vSAN subnets of the private
cloud you want to create.
- Minimum CIDR range prefix: /24
- Maximum CIDR range prefix: /21
- If you want global address resolution using Cloud DNS, then enable the Cloud DNS API and complete Cloud DNS setup before you create your private cloud.
The vSphere/vSAN subnet address space must not overlap with any network that will communicate with the private cloud, such as on-premises networks and Google Cloud Virtual Private Cloud (VPC) networks. For more information about vSphere or vSAN subnets, see VLANs and subnets on VMware Engine.
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.
Create a private cloud
Console
- Access the Google Cloud VMware Engine portal.
- On the Resources page, click Create private cloud.
- Select a location for your private cloud.
- Select the number of nodes for the private cloud. For production workloads, create your private cloud with at least 3 nodes. VMware Engine deletes private clouds that contain only 1 node after 60 days.
- Optional: Click the Customize Cores toggle if you want to reduce the number of available cores for each node in the management cluster. For details, see Custom core counts.
- Enter a CIDR range for the VMware management network. For information about restrictions on this range, see the Before you begin section.
- Enter a CIDR range for the HCX deployment network, which is used for deploying HCX components. Make sure that the CIDR range doesn't overlap with any of your on-premises or cloud subnets. The CIDR range must be /27 or higher.
- Select Review and Create.
- Review the settings. To change any settings, click Back.
- Click Create to begin provisioning the private cloud.
As VMware Engine creates your new private cloud, it deploys a number of VMware components and divides the provided IP address range into subnets. Private cloud creation can take 30 minutes to 2 hours. After the provisioning is complete, you receive an email.
gcloud
[Optional] List the available regions and zones for your project.
gcloud vmware locations list --project=PROJECT_ID
Create a network for your private cloud. The network name must be in the format REGION-default.
gcloud vmware networks create REGION-default --type=LEGACY --location=REGION --description="Legacy network created using gcloud vmware"
The request returns an operation ID.
Check the status of the operation. When the operation returns as
DONE
, check the response to see if the operation was successful.gcloud vmware operations describe OPERATION_ID \ --location REGION
Replace
OPERATION_ID
with the ID from the previous step.Next, create a three-node private cloud.
gcloud vmware private-clouds create PC_NAME \ --location=ZONE --cluster=CLUSTER_NAME\ --node-type-config=standard-72,count=3 \ --management-range=192.168.0.0/24 \ --vmware-engine-network=NETWORK_NAME
Replace the following:
PC_NAME
: the name for the private cloudZONE
: the zone for the private cloudCLUSTER_NAME
: the name for the new cluster in this private cloudNETWORK_NAME
: the network name for this cloud
The request returns an operations ID you can use to check the progress of the operation.
Check the status of the operation. When the operation returns as
DONE
, check the response to see if the operation was successful.gcloud vmware operations describe OPERATION_ID \ --location REGION
Replace
OPERATION_ID
with the ID from the previous step.Connect the VMware Engine Network to your VPC by setting up private services access.
Retrieve the vCenter and NSX-T credentials.
gcloud vmware private-clouds vcenter credentials describe \ --private-cloud=PC_NAME --location=ZONE
gcloud vmware private-clouds nsx credentials describe \ --private-cloud=PC_NAME --location=ZONE
API
Create a legacy network. The network name must be in the format
REGION-default
.curl -X POST -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json; charset=utf-8" https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/vmwareEngineNetworks?vmwareEngineNetworkId=REGION-default -d "{"type": "legacy"}"
Replace the following:
TOKEN
: the authorization token for this request.PROJECT_ID
: the project for this request.REGION
: the region to create this network in.
The request returns an operations ID you can use to check the progress of the operation.
Check the status of the operation. When the operation returns as
DONE
, check the response to see if the operation was successful.curl -X GET -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json; charset=utf-8" https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/operations/OPERATION_ID
Replace
OPERATION_ID
with the ID from the previous step.Create a three-node private cloud.
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 -d "{ "networkConfig":{ "vmwareEngineNetwork":"projects/PROJECT_ID/locations/REGION/vmwareEngineNetworks/REGION-default", "managementCidr":"10.241.0.0/22" }, "managementCluster":{ "clusterId": "CLUSTER_NAME", "nodeTypeConfigs": { "standard-72": { "nodeCount": 3 } } } }"
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 cloudREGION
: the region of the network for this private cloudCLUSTER_NAME
: the name for the new cluster in this private cloud
The request returns an operations ID you can use to check the progress of the operation.
Check the status of the operation. When the operation returns as
DONE
, check the response to see if the operation was successful.curl -X GET -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json; charset=utf-8" https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/operations/OPERATION_ID
Replace
OPERATION_ID
with the ID from the previous step.Connect the VMware Engine Network to your VPC by setting up private services access.
Retrieve the vCenter and NSX-T credentials.
curl -X GET -H "Authorization: Bearer \"TOKEN"\" -H "Content-Type: application/json; charset=utf-8" "https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/ZONE/privateClouds/my-private-cloud:showVcenterCredentials"
curl -X GET -H "Authorization: Bearer \"TOKEN"\" -H "Content-Type: application/json; charset=utf-8" "https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/ZONE/privateClouds/my-private-cloud:showNsxCredentials"
Python
Create a legacy network.
Create a three-node private cloud.
The
create_private_cloud
function returns an operations object you can use to check the progress of the operation.Check the status of the operation. Fetch current information about an Operation.
You can use
.result()
member method of the operation object to wait for it to complete.Connect the VMware Engine Network to your VPC by setting up private services access.
Retrieve the vCenter and NSX-T credentials.