0% found this document useful (0 votes)
6 views

Assignment22

Uploaded by

Fareeha Butt
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Assignment22

Uploaded by

Fareeha Butt
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

ASSIGNMENT NO 2

SUBMITTED TO: Mam Sana Waheed.

SUMTITTED BY: Haniya.

SUBJECT: Virtual Systems and Services.

TOPIC: Understanding Containers and Virtual Machines.

DEPARTMENT: IT.

SEMESTER: 7TH.

DATE: 07-November-2024
Questions:
1. Explain Containers in Detail:
 Containers
Containers work as small, portable “boxes” or “packages”. Containers don’t need a full
operating system in each box. In a container, there is everything that an app needs to run
like its code, libraries, and dependencies and everything is packed inside a portable box.
When you take this box to another computer it does not need its own Operating system
infact it borrows the OS of the host computer.

 Core Components of Containerized Environment


a. Docker
It is a tool for creating, managing, and running containers. It provides an easy way to package an
app with everything it needs to run.
b. Container Image
It is like a “Blueprint” or “Template”. Its file contains everything needed to run an application i.e.
code, libraries, and dependencies. The container is launched from that image.
c. Container Runtime
Container Runtime is a subset of Docker. It runs a container. It loads the container image, starts the
container, and keeps it running. It brings a container to life on a computer and handles the
interaction between the container and the host machine's OS. It makes sure the container is running
without interfering with other containers running on the same host computer

 Working on Container
Namespaces and cgroups are two technologies that containers use to make separate settings
on the same operating system. This lets different containers run on their own without
messing with each other.
A Docker software is installed on the computer and then the container image of an app is created in a
file using the Docker software.
The file is then transferred to the other computer that already has installed the Docker software on it
and then the container image is loaded using container runtime which makes a perfect environment on
the container for the app to run and it uses the same operating system as the Host computer.

 Container using the same OS kernel


In a containerized system, the host OS and kernel are shared by all the containers that run
on it. The kernel is the most important part of the operating system. It controls system
resources and lets hardware and software talk to each other.
Because containers share the host OS kernel, they are light. This is because each
container doesn't need its own full OS.

 Containers benefits
Lightweight: Containers share the host OS kernel, which makes them smaller and faster
to start compared to virtual machines (VMs).
Portability: Containers encapsulate all dependencies and configurations, allowing
applications to run consistently across different environments without needing their own
OS.
Isolation: Each container runs in its own separate environment, which keeps apps and
their dependencies from running into problems with each other.
Scalability: Containers can be easily increased and decreased on demand, making it simple
to handle varying workloads.

 Popular containerization platforms and typical use cases.


1. Kubernets
Microservices Management: When a company switches from a standard monolithic
program (where everything is strongly connected) to a microservices method, it can
separate each service into its own container. As demand changes, Kubernetes makes sure
that these services can talk to each other and handle problems. This lets developers focus
on building features instead of managing infrastructure.
2. OpenShift
Developer-Friendly: OpenShift has tools and processes that are easy for developers to
use. This makes it easier for development teams to make, test, and release containerized
apps. It works with many systems, computer languages, and tools.
3. Docker
Accelerating App Development with Docker Containers: Docker speeds up the process of
making apps by creating a uniform setting for creation, testing, and release. Isolated and
separate containers are also helpful for developers because they let them work on projects
at the same time and help new team members get started faster.

2. Explain Virtual Machines in Detail


 Virtual Machines
A Virtual Machine (VM) is a piece of software that acts like a real computer. The
operating system and programs run on it just like they would on a real computer, but in a
virtualized setting. Virtual machines (VMs) use the tools of a host machine, but they
work on their own, so more than one VM can run on the same real computer.

 How they work


VMs are created through a process called virtualization, which allows one physical
machine to host multiple virtual machines.
The physical machine is referred to as the "host," while the VM is known as the "guest."
The guest operates in an isolated environment and can run its own OS.
VMs share the host’s CPU, memory, storage, and network resources, but each VM has its
own dedicated virtual hardware (like virtual CPU, virtual RAM) and it does not share the
host’s OS.
 Role of Hypervisor
Hypervisors allow users to create, start, stop, and manage VMs.
They allocate resources (CPU, memory, storage) to each VM and ensure that they run
efficiently without interfering with each other.
Hypervisors provide isolation between VMs, ensuring that the actions of one VM do not
affect others.
Examples of hypervisor can be VMware and VirtualBox etc.

 Features of Virtual Machines


Isolation: Each VM runs in its isolated environment, which means that software crashes
or security breaches in one VM do not impact others.
Ability to Run Different Operating Systems: VMs can run various operating systems on
a single physical machine. For example, a host running Windows can have VMs running
Linux, macOS, or other versions of Windows.
Resource Allocation: VMs allow dynamic allocation of resources. Users can allocate
specific amounts of CPU, memory, and storage to each VM based on its needs.
Snapshots and Cloning: VMs can take snapshots (saving the current state), allowing users
to go back to that state later. Cloning allows the creation of identical copies of a VM for
testing or scaling purposes.

 Examples of VM Software and Use Cases


a. VMware
Use Case: An enterprise can use VMware to run multiple applications on a single
physical server, reducing hardware costs and improving resource utilization.
b. VirtualBox
Use Case: Developers use VirtualBox to test applications on different operating systems
without needing multiple physical machines.

3. Comparison Table
Containers Virtual Machines (VMs)

Architecture Share the host OS kernel Full OS with dedicated resources

Performance Lightweight, minimal resource More resource-intensive due to full


consumption OS environments
Compatibility Limited to the host OS’s kernel Run on any OS

Scalability Easily scalable due to low Scalability depends on available


overhead resources
Portability High portability across platforms Portable but requires a compatible
hypervisor
Cost Cost-effective due to shared Higher cost from full OS
resources environments
Speed Fast startup time Slower startup due to full OS boot-
up
Resource Usage Low, efficient High, due to full OS resource
requirements
Overheard Low Higher overhead due to hypervisor
management

4. Two scenarios where using containers would be most advantageous


and two scenarios where using virtual machines (VMs) would be more
appropriate.
 Scenarios Where Using Containers Would Be Most Advantageous
a. Microservices Architecture: A website for shopping that has different
sections for services like logging in users, managing goods, and taking
payments. The system is more stable and adaptable because each service can
be set up, grown, or changed on its own.
b. Continuous Integration and Continuous Deployment (CI/CD) Pipelines: A
development team can integrate Docker with their CI/CD pipelines, enabling
quick testing and deployment of containerized applications with minimal setup
and faster turnaround times.

 Scenarios Where Using Virtual Machines (VMs) Would Be More Appropriate


c. Running Multiple Operating Systems on One Physical Server: An
organization needs to run both Windows and Linux applications on the same
physical server. Using VMs, they can create a Windows VM and a Linux VM,
ensuring compatibility and isolation for each environment.
d. Applications Requiring High Isolation and Security: A financial service
provider hosts applications that process sensitive customer data. Using VMs
can provide a more secure environment, as each application runs in a separate
OS, making it harder for vulnerabilities in one application to affect others.

You might also like