Compute system provisioning
In this tutorial we will learn and understand about Compute system provisioning.
Virtual machine instances
Compute Engine instances can run the public images for Linux and Windows Server that Google provides as well as private custom images that you can create or import from your existing systems. You can also deploy Docker containers, which are automatically launched on instances running the Container-Optimized OS public image.
Instances and projects
Each instance belongs to a Google Cloud Console project, and a project can have one or more instances. However, when you create an instance in a project, you specify the zone, operating system, and machine type of that instance. When you delete an instance, it is removed from the project.
Instances and storage options
By default, each Compute Engine instance has a small boot persistent disk that contains the operating system. When applications running on your instance require more storage space. Then, you can add additional storage options to your instance.
Instances and networks
Each network interface of a Compute Engine instance is associated with a subnet of a unique VPC network. For more information about VPCs, see VPC network overview and VPC quotas.
Instances and containers
Compute Engine instances support a declarative method for launching your applications using containers. When creating a VM or an instance template, you can provide a Docker image name and launch configuration. Compute Engine will take care of the rest including supplying an up-to-date Container-Optimized OS image with Docker installed and launching your container when the VM starts up.
Creating a sole-tenant node template
Sole-tenant node templates are regional resources that specify properties for sole-tenant node groups. You must create a node template before you create a node group.
- Firstly, in the Google Cloud Console, go to the Sole-tenant nodes page.
- Secondly, click Node templates.
- Thirdly, click Create node template to begin creating a sole-tenant node template.
- Then, specify a Name for the node template.
- After that, specify a Region to create the node template in. You can use the node template to create node groups in any zone of this region.
- Next, specify the Node type for each sole-tenant node in the node group to create based on this node template.
- Optionally add Node affinity labels. Affinity labels let you logically group nodes and node groups. Further, when provisioning VMs, you can specify affinity labels on the VMs to schedule VMs on a specific set of nodes or node groups.
- Lastly, click Create to finish creating your node template.
Creating a sole-tenant node group
With the previously created sole-tenant node template, create a sole-tenant node group. However, a sole-tenant node group inherits properties specified by the sole-tenant node template and has additional values that you must specify.
- Firstly, in the Google Cloud Console, go to the Sole-tenant nodes page.
- Secondly, click Create node group to begin creating a node group.
- Thirdly, specify a Name for the node group.
- Fourthly, specify the Region for the node group to display the available node templates in that region.
- Then, specify the Zone within the region to create the node group in.
- After that, specify the Node template to create the node group from. The selected node template is applied to the node group.
- Choose one of the following for the Autoscaling mode for the node group autoscaler:
- Don’t configure autoscale
- Autoscale
- Autoscale only out
- Now, specify the Number of nodes for the group. If you enable the node group autoscaler, either specify a range for the size of the node group, or, specify the number of nodes for the group.
- After that, specify the Maintenance policy for the sole-tenant node group to one of the following values. The maintenance policy lets you configure the behavior of VMs on the node group during host maintenance events.
- Default
- Restart in place
- Migrate within node group
- Lastly, click Create to finish creating the node group.
Provisioning a sole-tenant VM
After creating a node group based on a previously created node template, you can provision individual VMs on a sole-tenant node group. However, to provision a VM on a specific node or node group that has affinity labels that match those you previously assigned to the node template. Then, follow the standard procedure for creating a VM instance, and assign affinity labels to the VM.
- Firstly, in the Google Cloud Console, go to the Sole-tenant nodes page.
- Secondly, click Node groups.
- Thirdly, click the Name of the node group to provision a VM instance on. Then, to provision a VM on a specific sole-tenant node, click the name of the specific sole-tenant node to provision the VM.
- Fourthly, click Create instance to provision a VM instance on this node group, note the values automatically applied for the Name, Region, and Zone, and modify those values as necessary.
- After that, select a Machine configuration by specifying the Machine family, Series, and Machine type.
- Modify the Boot disk, Firewall, and other settings as necessary.
- Now, click Sole Tenancy, note the automatically assigned Node affinity labels, and use Browse to adjust as necessary.
- Click Management, and for On host maintenance, choose one of the following:
- Migrate VM instance (recommended)
- Terminate
- Choose one of the following for the Automatic restart:
- On (recommended)
- Off
- Lastly, click Create to finish creating your sole-tenant VM.
Deleting a node group
If you need to delete a sole-tenant node group, first remove any VMs from the node group.
- Firstly, go to the Sole-tenant nodes page.
- Secondly, click the Name of the node group to delete.
- Thirdly, 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. However, to delete instances in a managed instance group, delete the managed instance group.
- Next, after deleting all VM instances running on all nodes of the node group, return to the Sole-tenant nodes page.
- Then, click Node groups.
- After that, select the name of the node group you need to delete.
- Lastly, click Delete.
Reference: Google Documentation, Doc 2