Azure vs GCP part 11: Virtual Machine (GCP)
Kenichiro Nakamura Mar 13
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 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
Same as Azure I really cannot list all the features, but you shall find what you need for most purpose, such as:
- Persistent Disk
- Load balancing and Scaling
- VM Management
- Integration with other services
- Customization, etc.
I use Full .NET application to test this out, as Visual Studio integration recognize it and let me use Windows image for 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.
2. Search "ASP.NET" and select "ASP.NET Framework" image.
3. Click "Launch on compute engine".
4. Enter required field. Make sure you enable HTTP port and WebDeploy for firewall. Then click "OK".
5. Deployment Manager shows the progress. Wait until the deployment completed. This may take a bit of time.
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).
2. Select Web API template and click OK. This template already include API, so I just use it.
3. Right click the project and click "Publish to Google Cloud".
4. Select "Compute Engine".
5. Select the VM you want to deploy to, and click "Manage Windows credential".
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.
7. Click "Publish".
8. Wait until deploy complete. Once completed, go to "/api/values" to see it returns result.
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.
3. Go to Compute Engine to see the internal IP of the VM.
Firewall Rules specified when provisioning the VM goes to Firewall rules section in VPC Network.
You can find created External IP in External IP addresses.
GCE provides "Snapshot" feature to backup the VM.
1. Go to "Compute Engine" | "Snapshots". Click "Create snapshot.
2. Specify options and click "Create".
In the next article, I will look into how to scale VM environment.