Cloud services and virtualization

Skip to content

This is a machine-translated text that may contain errors!

Cloud services and virtualization are closely linked: both are about using data resources without owning all the hardware yourself. But there are some important differences.

What is virtualization?

Virtualization means running multiple “virtual” machines on the same physical machine. Instead of having a separate physical server for the web server, one for the database, and one for the file server, you can run all three as virtual machines on the same machine.

The software that makes this possible is called a hypervisor:

Type Explanation Example
Type 1 (bare-metal) Runs directly on the hardware, without a regular OS underneath Proxmox, VMware ESXi
Type 2 (hosted) Runs on top of a regular operating system VirtualBox, VMware Workstation

Type 1 vs. Type 2

  • Type 1 is what we use in production and in the server room. Proxmox runs directly on the server.
  • Type 2 is what you use on your own PC for testing. VirtualBox runs on top of Windows or macOS.

What is a Virtual Machine (VM)?

A VM is an entire operating system that runs inside another. It has its own (virtual) memory, CPU, and disk, but shares the physical hardware with other VMs.

Benefits of VMs:

  • Isolation - Each VM is independent. If one VM crashes, the others are not affected.
  • Flexibility - You can run different operating systems on the same machine (e.g. Ubuntu and Windows Server).
  • Snapshot/backup - You can take a snapshot of a VM and roll back if something goes wrong.
  • Resource utilization - A physical machine with a lot of RAM and CPU can run many VMs.

What are Containers?

Containers are lighter than VMs. They share the operating system kernel with the host machine, but run in isolated environments.

Property VM Container
Size Large (entire OS) Small (just the application and dependencies)
Startup time Minutes Seconds
Isolation Strong (own OS) Good, but shares OS kernel
Use case When you need a completely separate OS Single applications and microservices
Example Proxmox VM, VirtualBox Docker, Podman

Når bruker vi hva?

  • Use a VM when you need a complete operating system, e.g., a Windows Server or a Linux server with full control.
  • Use a container when you only need to run an application, e.g., a web server, a database, or Grafana.

In practice, we often use both: VMs as hosts for Docker containers.

Cloud Services

Cloud services mean that someone else owns and operates the hardware, and you rent what you need over the internet. Instead of buying and maintaining a physical server, you pay to use a virtual machine in the cloud.

Service Models

There are three main models for cloud services:

Model Full name What you get What you manage yourself Example
IaaS Infrastructure as a Service Virtual machines, networking and storage OS, applications, setup Azure VM, AWS EC2
PaaS Platform as a Service A ready-made platform to run your code on Only the application Azure App Service, Heroku
SaaS Software as a Service Ready-made applications you use via the browser Nothing technical Microsoft 365, Google Docs

An easy way to remember it

  • IaaS = You rent an empty machine. You install and configure everything yourself.
  • PaaS = You rent a ready-made environment. You only need to add your code.
  • SaaS = You rent a ready-made app. You only need to log in and use it.

Delivery Models

Cloud services can be delivered in various ways:

Model Explanation Example
Public cloud Shared infrastructure available to everyone Azure, AWS, Google Cloud
Private cloud Dedicated infrastructure for an organization Proxmox in the server room at the school
Hybrid cloud Combination of public and private Some services locally, some in Azure

VPS: A Common Cloud Solution

A VPS (Virtual Private Server) is one of the most common IaaS solutions. You rent a virtual machine from a cloud provider and have full control over it, just as if you had your own server.

Typical use cases:

  • Running a web server
  • Setting up a VPN service
  • Hosting an application (e.g. Flask + database)
  • Testing things without risking your own hardware

Popular VPS providers:

Provider Advantages
Linode (Akamai) Simple, well-priced, good guides
DigitalOcean User-friendly, good documentation
Hetzner Affordable, European (GDPR-friendly)
Azure Integrated with the Microsoft ecosystem

Costs in the cloud

Cloud services cost money, and it can quickly become expensive if you are not careful. A VM running 24/7 costs more than one you turn off after use. Always check the prices and set up cost alerts.

Local vs. Cloud

Many companies use a combination of local servers and cloud services. Here are some factors to consider:

Factor Local (on-premises) Cloud
Control Full control over hardware and data Dependent on the provider
Cost Large investment upfront Ongoing monthly costs
Scalability Limited by physical hardware Can be scaled up and down as needed
Maintenance You have to fix everything yourself The provider handles the hardware
Privacy You know where the data is Data may be stored in other countries

Easy Task 1 - Run a VM on your own machine

Download VirtualBox (free) and try to install a Linux distribution, such as Ubuntu Desktop or Linux Mint.

  • How much RAM and CPU do you choose to allocate to the VM?
  • Do you notice that your PC becomes slower while the VM is running?
  • What happens if you try to give the VM more RAM than your machine has?

This gives a good feel for how VMs share the resources of the physical machine.

Easy Task 2 - Start a container with Docker

If you have Docker installed (or have access to a VM with Docker), try running:

docker run -d -p 8080:80 nginx
# Kjører en nginx-container i bakgrunnen og mapper port 8080 på verten til port 80 i containeren.
# Runs an nginx container in the background and maps port 8080 on the host to port 80 in the container.

Then visit http://localhost:8080 in your browser. You are now running a web server in a container! Compare how long this took to setting up an entire VM with Nginx.

Easy Task 3 - Which cloud services do you already use?

Think about which services you use in your daily life:

  • Microsoft 365 (Word, Teams, OneDrive) is SaaS
  • GitHub Pages for hosting a website is PaaS
  • If you create a VM in Proxmox at school, it is practically IaaS (just locally)

Can you categorize other services you use?

Easy Task 4 - Where is your data located?

Go to Microsoft Privacy Dashboard and see what Microsoft stores about you. Also, check the terms of a cloud service you use:

  • Where in the world is the data stored?
  • What happens to the data if you delete your account?
  • Do you own your data, or does the provider?

These questions are especially important in light of GDPR and privacy.

Summary

  • Virtualization allows you to run multiple services on the same hardware, either as VMs or containers
  • Cloud services mean that someone else owns the hardware, and you rent what you need
  • IaaS, PaaS and SaaS describe how much responsibility you have yourself
  • In practice, many use a hybrid solution with both on-premises and cloud-based services
  • The choice between on-premises and cloud is about control, cost, scalability and privacy