3.virtualization
3.virtualization
Virtualization
Virtualization is not a new thing in IT industry. Virtualization gained huge momentum because of
Vmware as it has solved the problem of running multiple OS and apps on one physical computer.
But that is just the tip of the iceberg, Vmware and other virtualization vendors has given great
features like Clustering of Virtualized Physical machines, pooling compute resources, storage
pooling, High availability, Live migration of virtual machine and so much more.
In this chapter we will understand virtualization, its benefits and how to use it for our DevOps day
to day operations.
Applications runs on servers. We deploy one application per server because we want our
applications to be isolated. For example, if we need web app, db app and few backend apps.
We may end up having multiple physical system each running a single instance of that app.
So, every time we need a new app to run we buy servers, install OS and setup our app on that.
And most of the time nobody knew the performance requirements of the new application!
This meant IT had to make guesses when choosing the model and size of
servers to buy.
As a result, IT did the only reasonable thing - it bought big fast servers with lots of resiliency.
After all, the last thing anyone wanted - including the business - was under-powered servers.
Most part of the time these physical server’s computer resource will be underutilized as low as 5-
10% of their potential capacity. A tragic waste of company capital and resources.
• Partitioning
• Isolation
• Encapsulation
• Move and copy virtual machines as easily as moving and copying files
• Hardware Independence
• Microsoft Hyper-V
• VMware ESX/ESXi.
• Xen Hypervisors
These hypervisors are used to run production grade virtual machines that gives great performance.
Type 1 hypervisors can be grouped together(clustered) and manged centrally by a software like
Vmware Vcenter for Esxi.
• Vmware server/workstation/player
• Oracle virtualbox
T
o
g
i
v
e
y
o
u
a
n
Just to give you an idea, what VirtualBox might look like later, after you have created many
machines, here's another example:
1. The VM name will later be shown in the VM list of the VirtualBox Manager window, and it
will be used for the VM's files on disk. Even though any name could be used, keep in mind
that once you have created a few VMs, you will appreciate if you have given your VMs
rather informative names; "ubuntu" would thus be less useful than "Windows XP SP2 with
OpenOffice".
2. For “Operating System Type”, select the operating system that you want to install later.
3. On the next page, select the memory (RAM)that VirtualBox should allocate every time the
virtual machine is started. The amount of memory given here will be taken away from your
host machine and presented to the guest operating system, which will report this size as the
(virtual) computer's installed RAM.
• The drop-down list presented in the window contains all disk images which are currently
remembered by VirtualBox, probably because they are currently attached to a virtual
machine (or have been in the past).
• Alternatively, you can click on the small folder button next to the drop-down list to bring up
a standard file dialog, which allows you to pick any disk image file on your host disk.
• Most probably, if you are using VirtualBox for the first time, you will want to create a new
disk image. Hence, press the "New" button.
• This brings up another window, the “Create New Virtual Disk Wizard”, which helps you
create a new disk image file in the new virtual machine's folder.
VirtualBox supports two types of image files:
• Dynamically allocated file will only grow in size when the guest actually stores data on
its virtual hard disk. It will therefore initially be small on the host hard drive and only
later grow to the size specified as it is filled with data.
• A fixed-size file will immediately occupy the file specified, even if only a fraction of
the virtual hard disk space is actually in use. While occupying much more space, a
fixed-size file incurs less overhead and is therefore slightly faster than a dynamically
allocated file.
Snapshots
With snapshots, you can save a particular state of a virtual machine for later use. At any later time,
you can revert to that state, even though you may have changed the VM considerably since then.
To take snapshot of a machine right click on the vm and click on snapshot.
When you want to restore machine from snapshot, find the snapshot location on your filesystem and
simply double click on it.
Full clone: In this mode, all depending disk images are copied to the new VM folder. The clone can
fully operate without the source VM.
Linked clone: In this mode, new differencing disk images are created where the parent disk images
are the source disk images. If you selected the current state of the source VM as clone point, a new
snapshot will be created implicitly.
Virtualbox gives you many more features which is out of the scope of this tutorial to cover.
Creating one single vm with the OS and application setup is time consuming process. You may not
have great deal of issue with it if we are talking about one or two vm’s but being a devops you may
need to setup lot of vm’s on regular basis. You may test your script or automation tool execution on
variety of applications and for that you may have to setup multiple vm’s. One of your job is to
research on tools, lots of tools and to learn and implement those tools you would be setting up lot of
vm’s and even share the same setup with your team.
To get around this very problem of setting up vm’s manually we can automate vm setup and
management process. This is the place where I introduce to a VM lifecycle automation tool known
as Vagrant.
Visualpath Training & Consulting.
Flat no: 205, Nilgiri Block,Aditya Enclave, Ameerpet, Hyderabad, Phone No: - +91-970 445 5959, 961 824 5689 E-
Mail ID : online.visualpath@gmail.com, Website : www.visualpath.in.