This document describes how to create and delete sole-tenant node groups. If you haven't created a sole-tenant node template yet, you must do so before you can create a node group.
Node groups are zonal resources that inherit properties from the node template they are based on. When you create a node group, you must specify configuration such as the number of nodes and maintenance settings.
Create a sole-tenant node group
To create a sole-tenant node group, use one of the following methods:
Console
In the Google Cloud console, go to the Sole-tenant nodes page.
Click Create node group to begin creating a node group.
Specify a Name for the node group.
Specify the Region for the node group to display the available node templates in that region.
Specify the Zone within the region to create the node group in.
Specify the Node template to create the node group or click Create node template to create a new sole-tenant node template. The selected node template is applied to the node group.
Choose one of the following for the Autoscaling mode for the node group autoscaler:
Off: Manually manage the size of the node group.
On: Have nodes automatically added to or removed from the node group.
Only scale out: Add nodes to the node group when extra capacity is required.
Specify the Number of nodes for the group. If you enable the node group autoscaler, specify a range for the size of the node group. You can manually change the values later.
Set the Maintenance policy of the sole-tenant node group in the Configure Maintenance Settings section to one of the following values. The maintenance policy lets you configure the behavior of VMs on the node group during host maintenance events. For more information, see Maintenance policies:
- Default
- Restart in place
- Migrate within node group
You can choose between regular maintenance windows and advanced maintenance control to handle maintenance for your sole-tenant node group, as follows:
Maintenance Window: Select the time period during which you want planned maintenance events to happen for the nodes in the sole-tenant node groups.
Opt-in for advanced maintenance control for sole-tenancy: Advanced maintenance control for sole-tenancy lets you control planned maintenance events for sole-tenant node groups and minimize maintenance-related disruptions. To opt-in for advanced maintenance control, click the Opt-in for advanced maintenance control for sole-tenancy toggle to the on position. If you choose to use this option for node maintenance, the Maintenance window field is disabled, and maintenance occurs as configured in advanced maintenance control.
Note that advanced maintenance control only supports the Default maintenance policy.
Configure the share settings by specifying one of the following in Configure share settings:
- To share the node group with all projects in your organization, choose Share this node group with all projects within the organization.
- To share the node group with specific projects within your organization, choose Share this node group with selected projects within the organization.
If you don't want to share the node group, choose Do not share this node group with other projects. For more information about sharing node groups, see Share sole-tenant node groups.
Click Create to finish creating the node group.
gcloud
Run the gcloud compute sole-tenancy node-groups create command command to create a node group based on a previously created node template:
gcloud compute sole-tenancy node-groups create GROUP_NAME \ --node-template=TEMPLATE_NAME \ --target-size=TARGET_SIZE \ [--zone=ZONE \] [--maintenance-policy=MAINTENANCE_POLICY \] [--maintenance-window-start-time=START_TIME \] [--autoscaler-mode=AUTOSCALER_MODE \ --min-nodes=MIN_NODES \ --max-nodes=MAX_NODES]
Replace the following:
GROUP_NAME: the name for the new node group.TEMPLATE_NAME: the name of the node template to use to create this group.TARGET_SIZE: the number of nodes to create in the group.ZONE: the zone to create the node group in. This must be the same region as the node template on which you are basing the node group.MAINTENANCE_POLICY: the maintenance policy for the node group. For more information, see Maintenance policies. This must be one of the following values:defaultrestart-in-placemigrate-within-node-group
Alternately, you can opt in for advanced maintenance control for the sole-tenant node group, using the
--maintenance-intervalflag. For more information, see Enable advanced maintenance control on a sole-tenant node.START_TIME: the start time in GMT for the maintenance window for the VMs in this node group. Set to one of:00:00,04:00,08:00,12:00,16:00, or20:00. If not set, the node group does not have a set maintenance window.AUTOSCALER_MODE: the autoscaler policy for the node group. This must be one of:off: manually manage the size of the node group.on: have nodes automatically added to or removed from the node group.only-scale-out: add nodes to the node group when extra capacity is required.
MIN_NODES: the minimim size of the node group. The default value is0and must be an integer value less than or equal toMAX_NODES.MAX_NODES: the maximum size of the node group. This must be less than or equal to100and greater than or equal toMIN_NODES. Required ifAUTOSCALER_MODEis not set tooff.
REST
Use the
nodeGroups.insert method
to create a node group based on a previously created node
template:
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/nodeGroups?initialNodeCount=TARGET_SIZE
{
"nodeTemplate": "regions/REGION/nodeTemplates/TEMPLATE_NAME",
"name": "GROUP_NAME",
"maintenancePolicy": MAINTENANCE_POLICY,
"maintenanceWindow": {
"startTime": "START_TIME"
},
"autoscalingPolicy": {
"mode": AUTOSCALER_MODE,
"minNodes": MIN_NODES,
"maxNodes": MAX_NODES
},
}
Replace the following:
PROJECT_ID: the project ID.ZONE: the zone to create the node group in. This must be in the same region as the node template on which you are basing the node group.TARGET_SIZE: the number of nodes to create in the group.REGION: the region to create the node group in. You must have a node template in the selected region.TEMPLATE_NAME: the name of the node template to use to create this group.GROUP_NAME: the name for the new node group.MAINTENANCE_POLICY: the maintenance policy for the node group. This must be one of the following values:DEFAULTRESTART_IN_PLACEMIGRATE_WITHIN_NODE_GROUP
Alternately, you can opt-in for advanced maintenance control for the sole-tenant node group, using the
maintenanceIntervalfield. For more information, see Enable advanced maintenance control on a sole-tenant node.START_TIME: the start time in GMT for the maintenance window for the VMs in this node group. Set to one of:00:00,04:00,08:00,12:00,16:00, or20:00. If not set, the node group does not have a set maintenance window.AUTOSCALER_MODE: the autoscaler policy for the node group. This must be one of the following values:OFF: manually manage the size of the node group.ON: have nodes automatically added to or removed from the node group.ONLY_SCALE_OUT: add nodes to the node group when extra capacity is required.
MIN_NODES: the minimim size of the node group. The default is0and must be an integer value less than or equal toMAX_NODES.MAX_NODES: the maximum size of the node group. This must be less than or equal to100and greater than or equal toMIN_NODES. Required ifAUTOSCALER_MODEis not set toOFF.
Delete a node group
If you need to delete a sole-tenant node group, first remove any VMs from the node group.
Console
Go to the Sole-tenant nodes page.
Click the Name of the node group to delete.
For each node in the node group, click the node's name and delete individual VM instances on the node details page, or follow the standard procedure to delete an individual VM. To delete VMs in a managed instance group, delete the managed instance group.
After deleting all VM instances running on all nodes of the node group, return to the Sole-tenant nodes page.
Click Node groups.
Select the name of the node group you need to delete.
Click Delete.
gcloud
List running VM instances on nodes in the node group by using the
gcloud compute sole-tenancy node-groups list-nodescommand:gcloud compute sole-tenancy node-groups list-nodes GROUP_NAME \ --zone=ZONE
Replace the following:
GROUP_NAME: name of the node groupZONE: zone of the node group
If there are any VMs running on the node group, follow the procedure to delete an individual VM or the procedure to delete a managed instance group.
After deleting all VMs running on all nodes of the node group, delete the node group by using the
gcloud compute sole-tenancy node-groups deletecommand:gcloud compute sole-tenancy node-groups delete GROUP_NAME \ --zone=ZONE
Replace the following:
GROUP_NAME: the name of the node groupZONE: the zone of the node group
REST
List running VM instances on nodes in the node group by using the
nodeGroups.listNodesmethod:POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/nodeGroups/GROUP_NAME/listNodesReplace the following:
PROJECT_ID: the project IDZONE: the zone of the node groupGROUP_NAME: the group for which to list the VMs
If there are any VMs running on the node group, follow the procedure to delete an individual VM or the procedure to delete a managed instance group.
After deleting all VMs running on all nodes of the node group, delete the node group by using the
nodeGroups.deletemethod:DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/nodeGroups/GROUP_NAME
Replace the following:
PROJECT_ID: the project IDZONE: the zone of the node groupGROUP_NAME: the name of the node group to delete
What's next
- For information about sole-tenant node pricing, see Sole-tenant nodes pricing.
For information about how to enable autoscaling on sole-tenant node groups, see Node group autoscaler.
For more information about bringing existing licenses to Google Cloud, see Bring existing licenses.
For more information about sole-tenant nodes, see Sole-tenant nodes.