Post

GCP - Google Cloud Computing - Compute Engine


Google Cloud Computing - Compute Engine


Screen Shot 2022-08-14 at 23.53.19

Screen Shot 2021-06-27 at 1.25.24 AM

basic

Compute Engine

  • Infrastructure as a Service
  • A managed environment

    for deploying virtual machines

    • run thousands of virtual CPUs on a system that is designed to be fast and to offer consistent performance.
  • Fully customizable VMs
    • Compute Engine offers virtual machines that run on GCP
    • create and run virtual machines on Google infrastructure.
    • run virtual machines on demand in the Cloud.
      • select predefined VM configurations
      • create customized configurations
  • no upfront investments
  • Lift and shift
  • choice:
    • have complete control over your infrastructure
      • maximum flexibility
      • for people who prefer to manage those server instances themselves.
      • customize operating systems and even run applications that rely on a mix of operating systems.
    • best option if other computing options don't support your applications or requirements
      • easily lift and shift your on-premises workloads into GCP without rewriting the applications or making any changes.

compute options

Screen Shot 2021-06-27 at 11.26.51 PM

Screen Shot 2021-06-27 at 11.30.34 PM

Screen Shot 2021-06-27 at 11.31.34 PM

Screenshot 2024-08-07 at 11.52.50

Screenshot 2024-08-07 at 11.53.04


create a virtual machine instance

  • by Google Cloud Platform console or the GCloud command line tool.
SSD
  • standard, SSD, or local SSD.
    • the standard spinning hard disk drives or HDDs, or flash memory solid state drives SSDs.
    • Both of these options provide the same amount of capacity in terms of disk size when choosing a persistent disk.
  • Therefore, the question really is about performance versus cost
  • standard disks
    • higher amount of capacity for your dollar.
  • SSDs
    • higher number of IOPS per dollar
  • local SSDs
    • even higher throughput and lower latency than SSD persistent disks because they’re attached to the physical hardware.
    • but data on local SSD persists only until stop or delete the instance.
    • Typically is used as a swap disk just like a RAM disc.
    • But if you need more capacity, you can store those on a local SSD.
  • one instances with up to 8 separate 375 GB local SSD partitions for total of 3 TB of local SSD space for each instance.
  • Standard and non-local SSD disks can be sized up to 64 TB for each instance. The performance of these disks scales with each GB of space allocated.
OS
  • Linux and Windows Server images provided by Google or customized versions of these images
  • import images for many of the physical servers.
Machine type OS
  • Linux and Windows Server images provided by Google or customized versions of these images
  • import images for many of the physical servers.
Machine type
  • how much memory and virtual CPUs
  • range from very small to very large indeed.
  • can make a custom VM.
Processing power
  • machine learning and data processing that can take advantage of GPUs, many GCP zones have GPU’s available for you.
  • Just like physical computers need disks, so do VM.

Virtual machines need block storage

  • (2 main choices)
    1. 2 persistent storage
    • standard or SSD.
    • offer network stores that can scale up to 64 terabytes
    • can easily take snapshots of the disks for backup and mobility
      1. attach a local SSD
    • If application needs high-performance scratch space
    • enable very high input/output operations per second
  • to store data of permanent value somewhere else
    • local SSDs content doesn’t last past when the VM terminates.
    • persistent disks can.
boot image.
  • choose a boot image.
    • GCP offers lots of versions of Linux and Windows
    • can import the own images too.
VM startup scripts
  • let the VMs come up with certain configurations
    • like installing software packages on first boot.
  • pass GCP VM startup scripts to do so.
    • can also pass in other kinds of metadata too.
snapshot
  • Once the VMs are running
  • take a durable snapshot of their disks.
  • keep these as backups or use when need to migrate a VM to another region.
grained control of costs
  • per second billing
    • GCP enables fine grained control of costs of Compute Engine resources by providing per second billing.
    • helps reduce the costs when deploying compute resources for short periods of time
      • such as batch processing jobs
preemptible VMs instances 抢先的
  • provide significantly cheaper pricing for the workloads that can be interrupted safely
    • have a workload that no human being is sitting around waiting to finish
    • such as batch job analyzing large dataset
  • benefit:
    • save money
    • cost less per hour but can be terminated by Google Cloud at any time.
  • different from an ordinary Compute Engine VM in only one respect.
    • given compute engine permission to terminate it if it’s resources are needed elsewhere.
    • make sure the job able to be stopped and restarted.
  • can’t convert a non-preemptible instance into a preemptible one.
    • must be made at VM creation.
  • choose the machine properties of the instances
    • such as the number of virtual CPUs and the amount of memory
    • by using a set of predefined machine types
    • or by creating the own custom machine types.
    • the maximum number of virtual CPUs and the VM was 96 and the maximum memory size was in beta at 624 gigabytes.
    • huge VMs are great for workloads like in-memory databases and CPU intensive analytics
    • but most GCP customers start off with scaling out not scaling up.
Auto scaling
  • add and take away VMs from the application based on load metrics.
  • place the Compute Engine workloads behind global load balancers that support autoscaling

  • balancing the incoming traffic across the VMs
    • Google VPC supports several different kinds of load balancing
managed instance groups
  • define resources that are automatically deployed to meet demand
Availability policies
  • If a VM is stopped (outage or a hardware failure), the automatic restart feature starts it back up. Is this the behavior you want? Are the applications idempotent (written to handle a second startup properly)?
  • During host maintenance, the VM is set for live migration. However, you can have the VM terminated instead of migrated.

VM access and lifecycle

Screen Shot 2021-06-27 at 1.39.29 AM

Screen Shot 2021-06-27 at 1.41.00 AM

Screen Shot 2021-06-27 at 1.42.10 AM

Screen Shot 2021-06-27 at 1.48.25 AM

Screen Shot 2021-06-27 at 1.51.58 AM


price

Screen Shot 2021-06-27 at 11.32.27 PM

Screenshot 2024-08-07 at 11.49.42

  1. bills by the second
    • with a one-minute minimum for virtual machine usage.
  2. Sustained-use discounts
    • apply automatically to virtual machines that run for more than 25% of a month.
  3. Committed-use discounts
    • for stable and predictable workloads.
  4. Preemptible and Spot VMs

    • can be used to save money for certain workloads

    • Preemptible and spot VMs have the same performance as ordinary VMs of the same machine type.

    • Preemptible 可優先的 VMs can run for up to 24 hours, while Spot VMs have no maximum runtime.

    • Screenshot 2024-08-07 at 11.50.07

    • Screenshot 2024-08-07 at 11.50.15

    • Screen Shot 2021-06-27 at 11.39.50 PM

Screen Shot 2021-06-27 at 11.40.30 PM

Screen Shot 2021-06-27 at 11.41.41 PM


images

Screen Shot 2021-06-27 at 11.48.19 PM

Screen Shot 2021-06-27 at 11.49.56 PM


boot disk

Screen Shot 2021-06-27 at 11.56.32 PM

Screen Shot 2021-06-27 at 11.59.10 PM

Screen Shot 2021-06-28 at 12.00.49 AM

Screen Shot 2021-06-28 at 12.01.07 AM

Screen Shot 2021-06-28 at 12.01.30 AM

Screen Shot 2021-06-28 at 12.03.00 AM


Common Compute Engine actions

Screen Shot 2021-06-28 at 12.36.17 AM

Screen Shot 2021-06-28 at 12.37.06 AM

Screen Shot 2021-06-28 at 12.37.33 AM

Screen Shot 2021-06-28 at 12.37.50 AM

Screen Shot 2021-06-28 at 12.38.35 AM


disk snapshiots

Screen Shot 2021-06-28 at 12.38.53 AM

Screen Shot 2021-06-28 at 12.40.06 AM

.

This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.