Lab Guide-Create a GCE instance
Step 1: Select the VM instance
• Select the project in which you want to create an instance.
• Navigate to the left panel and select compute engine.
• On selecting Compute Engine different compute option list for IaaS will be
displayed, select VM instances to launch virtual machine instance.
Step 2: Configure VM instance
1. Name the instance, as shown below:
2. Choose region and zone where you want to instantiate.
3. Select the hardware configuration based on application requirement .The
below snapshot will help you to understand the selection of instance type and
family based on business requirement :
4. In next option select the boot disk image. It contains a root file system and
OS that will run on your instances. As no custom image is created so far, we
will choose from public image list as shown below:
5. Allow HTTP and HTTPS traffic. To allow the instance to receive HTTP and
HTTPS traffic, check the specific firewall rule.
Step 3: Configure Management, disk, networking, and SSH keys
Expand "Management, disk, networking, SSH keys" for additional configuration as
shown below:
• Description: Describe your instances that can be documented. Description
can be related to the application on top of which the instances are built.
• Label: It is the key-value pair that can be used to group the instance based
on staging, deployment and development separately.
• Automation: Provide the configuration scripts in Automation: Start-up
section. Panchama wants the VM to have an Apache server in its instance boot. The below
script updates the instance and install Apache server :
#! /bin/bash
apt-get update
apt-get install -y apache2
• Metadata: These are the unique information of an instance ex: External IP
address, which exists in key: value pair. Metadata can be used in startup and
shutdown scripts and are stored in a metadata server that can be queried within the
instance. Google set default metadata entries, however, in the below screenshot
we have set user-defined metadata.
• Disk: As the boot disk is attached to the instance if you wish GCP to delete
the disk once the instance is deleted you can check the option as shown below.
Step 4: Configure Networking
Navigate to "Networking" for additional configuration as shown below:
• Network: The network traffic that the instance can access. GCP sets a default
network.
• Subnetwork: An IPv4 address is assigned to the instance from the subnetwork's
range using which they can communicate with other instances. We will study in
detail about subnetwork in subsequent modules.
• Network tags: Adding tag to the network is useful as the same tag can be
used to apply firewall rules. We have added "server-1" for the tag value as
shown below:
• Internal IP: Internal IP is automatically generated and assigned to an
instance when created. It is unique to a virtual private network(VPN). VPN will
be discussed in next section.
• External IP: External IPs are used to communicate with internet or services
in other network. It is of two types:
Static external IP: It is assigned to the project and remain attached to the
stopped instance as well until released
Ephemeral external IP: It remain attached to VM until it is stopped or restarted
• IP forwarding: It lets the instance to route the packets. You can set it on to
enable forwarding.
• SSH Keys: GCP creates a default key-pair for the instance, however if you
wish to generate and apply for instance you can define it here. We will proceed
with default key-pair.
Step 5: Verify the launched instance
Once instance is created you can see the green check which proves that
the instance is created successfully.
No comments:
Post a Comment