Setting up a Linux Instance on GCP
Contents
As this description shows the basic setup of a Linux instance in the GCP cloud, it does not list specific prerequisites. However, depending on the use case, the following prerequisites should be considered: To log in perform the following steps: A project organizes all your Google Cloud resources. To organize all resources for a certain application purpose, you can group them in their own project. So before you start creating resources, select or create the appropriate project. To select or create a project, select the project list from the top of the Google cloud console window, as shown below: Either select the correct project or create a new one by clicking on the NEW PROJECT button. Important rules for Google cloud instances with respect to network interfaces: Therefore the required VPCs and subnets must exist before the instance is created. To create additional VPCs (if required), perform the following steps. Step 1: Open the VPC network section by clicking on the Navigation menu, then selecting VPC network, and clicking on VPC networks - as illustrated below. This will open the VPC overview page with the already existing VPCs. If all required VPCs and subnets already exist, continue with creating the new VM instance. Otherwise, continue with step 2. Step 2: If you need to create a new VPC, click on CREATE VPC NETWORK at the top of the VPC overview list. This opens the VPC configuration window. Step 3: Create VPC and subnets. In the VPC configuration window, enter Click on Create at the bottom of the window to create the VPC. The new VPC should appear in the VPC overview list. Selecting the VPC in the overview list will open the detail information window. Example: Step 4: Create firewall rules for the VPC. With the detail information open, click on Firewall. This will allow you to define the required firewall rules for the VPC. An example of a small set of firewall rules that allow incoming SSH and ICMP is shown below: Step 1: Go to the VM instance overview page. Open the Navigation menu, click on Compute Engine and then on VM Instances as illustrated below: This will open the list of already existing VM instances. Step 2: Click on CREATE INSTANCE at the top of the overview list. This will open the VM creation window as shown below. Step 3: Configure the basic information of your new VM instance. In the main configuration window set the following information at a minimum: The following image illustrates the basic settings: Additional points to note: Step 4: Add you SSH key for remote access to the cloud instance. Open the advanced settings at the bottom of the VM creation window by clicking on Management, security, disks,... at the bottom of the page. The advanced settings allow you to create and add disks and network interfaces during the creation of a VM. Please note: network interfaces can only be added during the creation of a VM instance. The advanced settings also allow you to add your public SSH key for accessing the VM once started. To do this, You can collapse the section again by clicking on Less. Step 5: Optionally, configure additional NICs and/or IP forwarding To add an additional network interface, perform the following steps: After adding all the required information, click on Done. To enable IP forwarding, perform the following steps: Please note: you have to set up a firewall manually when you add additional network interfaces. See /wiki/spaces/DocCHSSP44xGCPGS/pages/13722878062 and the GCP documentation for more detail. Step 6: additional configuration for AutoVE setup. If the instance is launched from a Charon AL marketplace image and is planned to use AutoVE licensing (instead of the public license servers), you must add the corresponding information to the instance configuration before the first launch of the instance: The AutoVE license server information is entered as Custom Metadata. In the initial instance configuration window, go to the bottom where the NETWORKING, DISKS, SECURITY, MANAGEMENT... configuration section is located. Open it and select the Management section. Add the Custom Metadata as shown in the example below: Valid User Data configuration options: where Please note: at least one license server must be configured at initial launch to enable AutoVE mode. Otherwise, the instance will bind to one of the public license servers operated by Stromasys. Step 7: Create the VM. Once you filled in all the required data, create the VM by pressing the Create button at the bottom of the page: This will create the VM, start it and show it in the VM instances list. Step 8: Verify the settings of the newly created cloud instance. After successful creation, the new instance will be shown in the VM instances list: By clicking on it, you will see the details of the cloud instance, as shown in the example below:General Prerequisites
GCP Login and New Instance Launch
Logging in to GCP
Preparation
Select or Create Project
Create VPCs and Subnets for Instance
1460
bytes for Linux images and Windows Server images. During the creation of a VPC you can set the MTU to a different value (e.g., 1500). In your instance (especially, if it does not rely on DHCP), set the MTU to the same value as configured for the VPC to avoid the increased latency and packet overhead caused by fragmentation, or even connectivity problems. For an MTU size of 1460, client applications that communicate with GCP instances over UDP must have a maximum payload of 1432 bytes to avoid fragmentation.
In particular, ensure that the MTU used on any Linux interface dedicated to the emulator is not smaller than the MTU used by the legacy guest system. Failing to do so will cause network problems. For more information refer to the section Interface MTU Considerations in this guide.
Creating a New VM Instance
primary_server <ip-address>[:<port>]
backup_server <ip-address>[:<port>]
Initial Access to the Instance
Once you have access to the instance, you can create the access you require for your applications. This section just shows the basic steps for initial access to the instance.
SSH Interactive Access
To connect to the instance interactively, you must connect as the management user of your instance. Use the following command:
$ ssh -o ServerAliveInterval=30 -i
<path-to-your-private-key>
<management-user-name>
@
<cloudhost-IP-address>
The parameter ServerAliveInterval
will protect the connection from timing out.
Please note:
- Depending on the type of connection, you will have to use either the public IP address of the cloud system or its address in a customer-specific VPN.
- The private key used must correspond to the public key installed in the authorized_keys file of the cloud instance management user. This is usually done during initial cloud instance launch.
- The management user account normally allows sudo access to privileged commands (use sudo -i).
- If the instance was created using a Stromasys-provided AL or VE marketplace image, the management user for interactive login is the user sshuser.
File Transfer with SFTP
SFTP enables file transfers to and from the cloud instance. Use the management user of your instance. The security rules must allow SSH access to allow SFTP access to the cloud instance.
Please note: Depending on the type of connection, you will have to use either the public IP address of the cloud system or its address in a customer-specific VPN.
To connect to the instance, use the following command:
$ sftp -i
<path-to-your-private-key>
<management-user-name>
@
<cloudhost-IP-address>
Please note:
- Depending on the type of connection, you will have to use either the public IP address of the cloud system or its address in a customer-specific VPN.
- The private key used must correspond to the public key installed in the authorized_keys file of the cloud instance management user. This is usually done during initial cloud instance launch.
- If the instance was created using a Stromasys-provided AL or VE marketplace image, the management user for file transfer is the user charon.
- If the user charon is used to transfer files, the home directory for the file transfer will be /charon/storage.
© Stromasys, 1999-2024 - All the information is provided on the best effort basis, and might be changed anytime without notice. Information provided does not mean Stromasys commitment to any features described.