Virtualization

Steven J Zeil

Last modified: Dec 9, 2020
Contents:

Abstract

Virtualization refers to the use of software to simulate portions of a computer system.

1 Virtualization

Virtualization presents the simulation of a guest machine via special software running on a host machine.

 

Forms of virtualization:

1.1 Full Virtualization

a.k.a., emulation

 


 

These include the first virtualization systems (IBM 1966), often used to avoid/delay porting large application systems.

More modern instances:

1.2 Paravirtualization

a.k.a., OS-assisted virtualization, a.k.a., hypervisors

Architectures:

1.2.1 Hosted Paravirtualization

a.k.a., type 2 hypervisor, client hypervisor

Runs the simulation as a host OS application.

 

1.2.2 Hypervisor Paravirtualization

a.k.a. type 1 hypervisor, bare metal hypervisor

The simulator is a “thin” OS sitting on top of the hardware.

 

1.3 Containers

 

Instances:

1.3.1 DockerFiles

Docker containers are defined in a dockerfile, e.g.:

Dockerfile

FROM nginx:1.10
RUN apt-get clean && apt-get update && apt-get install -y nano spawn-fcgi fcgiwrap wget curl libxml2-dev libxslt1-dev
RUN [ "apt-get", "install", "-qy", "--force-yes", \
      "perl", \
      "build-essential", \
      "cpanminus", \
      "libxml-libxslt-perl" \
      ]
RUN ["cpanm", "CGI"]
RUN ["cpanm", "LockFile::Simple"]
RUN sed -i 's/www-data/nginx/g' /etc/init.d/fcgiwrap
RUN chown nginx:nginx /etc/init.d/fcgiwrap
COPY ./vhost.conf /etc/nginx/conf.d/default.conf
COPY ./htpasswd /etc/nginx/htpasswd
WORKDIR /var/www
CMD /etc/init.d/fcgiwrap start \
    && nginx -g 'daemon off;'

1.3.2 Docker Compose

The Docker Compose facility allows you to launch a collection of separate virtual machines, each providing a specialized service, and connect them together, e.g.,

docker-compose.yml

version: '3'
services:
    web:
        container_name: web_cgi_server
        build:
            context: .

        volumes:
            - ./../build/website:/var/www
            - ./../build/log:/var/log/nginx/web
        ports:
            - "8081:80"

This launches web_cgi_server (defined in the DockerFile just shown)

1.3.3 Infrastructure as Data

Remember that “Infrastructure as Data” was one of the defining principles of DevOps.