DEV Community

Cover image for Azure vs GCP part 11: Virtual Machine (GCP)
Kenichiro Nakamura
Kenichiro Nakamura

Posted on

Azure vs GCP part 11: Virtual Machine (GCP)

I tried Azure VM from application deployment views in last couple of articles. Now I do the same on GCP.

Google Compute Engine (GCE)

Though it's Google Cloud, it supports windows and Linux OS, with/without applications. I use full .NET application to try this Windows environment.

Types

Types is Size in Azure, and see this article for detail, but there are many purpose oriented size choices are available, such as High-CPU types, High/Mega-Memory types, and GPU, etc.

Regions/Zones and Price

There are tons of locations you can choose from and many pricing options to optimize the cost. As this is not marketing blog, I don't explain the detail. Check out Available regions and zone and Pricing

Other features

Same as Azure I really cannot list all the features, but you shall find what you need for most purpose, such as:

  • SSD
  • Persistent Disk
  • Load balancing and Scaling
  • IAM
  • VM Management
  • Monitoring
  • Integration with other services
  • Automation
  • Tools
  • Customization, etc.

Let's try

I use Full .NET application to test this out, as Visual Studio integration recognize it and let me use Windows image for VM.

Provision VM

I can deploy clean Windows Server and install IIS, ASP.NET or any other dependency by myself. Or, I can use an image with these dependencies installed by default. This time I use pre-configured image for ASP.NET.

1. Go to Cloud console and select "Cloud Launcher" from menu.

vm

2. Search "ASP.NET" and select "ASP.NET Framework" image.

vm

3. Click "Launch on compute engine".

vm

4. Enter required field. Make sure you enable HTTP port and WebDeploy for firewall. Then click "OK".

vm

5. Deployment Manager shows the progress. Wait until the deployment completed. This may take a bit of time.

vm

That's all for deploying VM.

Create an application and deploy.

1. Open Visual Studio 2017 and create new project. Select ASP.NET Web Application (.NET Framework).

app

2. Select Web API template and click OK. This template already include API, so I just use it.

app

3. Right click the project and click "Publish to Google Cloud".

app

4. Select "Compute Engine".

app

5. Select the VM you want to deploy to, and click "Manage Windows credential".

app

6. Click "Add credentials" and add new user. enter VM administrator's username and password. In my case, I let the wizard generate new password. It will show you the password later. Close the window.

app

7. Click "Publish".

app

8. Wait until deploy complete. Once completed, go to "/api/values" to see it returns result.

app

Tips

Unlike Azure, create the VM from template didn't create virtual network, but GCP prepare network settings by default.

Virtual Private Cloud (VPC) netrowk

According to this document, VPC network is

You can think of a VPC network the same way you'd think of a physical network, except that it is virtualized within GCP. A VPC network consists of virtual local subnet networks in data centers, all connected by a global wide area network. Networks are logically isolated from all other networks in GCP.

1. From menu, select VPC Network | VPC networks.

2. Check IP addresses ranges for Region where the VM is deployed.

vpc

3. Go to Compute Engine to see the internal IP of the VM.

vpc

Firewall Rules

Firewall Rules specified when provisioning the VM goes to Firewall rules section in VPC Network.

fw

External IP

You can find created External IP in External IP addresses.

ex

Backup

GCE provides "Snapshot" feature to backup the VM.

1. Go to "Compute Engine" | "Snapshots". Click "Create snapshot.

back

2. Specify options and click "Create".

In the next article, I will look into how to scale VM environment.

Ken

Top comments (0)