
Virtualizing Your Network
This is a guide on virtualizing your network.
Virtualization
The basic idea behind virtualization is to use software to simulate the
existence of hardware. This powerful idea enables you to run more than one
independent computer system on a single physical computer system.
Suppose that your organization requires a total of 12 servers to meet its needs.
You could run each of these 12 servers on a separate computer, in which case you
would have 12 computers in your server room, or you could use virtualization to
run these 12 servers on just 2 computers. In effect, each of those computers
would simulate 6 separate computer systems, each running one of your servers.
Each of the simulated computers is called a virtual machine. For all intents and
purposes, each virtual machine appears to be a complete, self-contained computer
system with its own processor, memory, disk drives and so on.
Like a real computer, each virtual machine requires an operating system to do
productive work. In a typical network server environment, each virtual machine
runs its own copy of Windows server. The operating system has no idea that its
running on a virtual machine rather than on a real machine.
Here are a few terms you need to be familiar with if you expect to discuss
virtualization intelligently:
Host the actual physical computer on which one or more virtual machines
run
Bare metal another term for the host computer that runs one or more virtual
machines
Guest another term for a virtual machine running on a host
Guest OS an operating system that runs within a virtual machine.
Hypervisor the virtualization operating system that creates and runs virtual
machines.
Hardware A layer of of software that acts as a go-between to separate actual
hardware from the software that interacts with it.
Hypervisors
At the core of virtualization is a hypervisor, a layer of software that manages
the creation and execution of virtual machines. A hypervisor provides several
core functions:
1. It provides a hardware abstraction layer, which virtualizes all the hardware
resources of the host computer on which it runs.
2. It creates pools of these abstracted hardware resources that can be allocated
to virtual machines.
3. It creates virtual machines.
4. It manages the execution of its virtual machines, allocating host hardware
resources as needed to each virtual machine and starting and stopping virtual
machines when requested by users.
5. It ensures that each virtual machine is completely isolated from all other
virtual machines, so that if a problem develops in one virtual machine, none of
the other virtual machines is affected.
6. It manages communication among the virtual machines over virtual networks,
enabling the virtual machines to connect with each other and with a physical
network that reaches beyond the host.
There are two basic types of hypervisors:
1. Type-1: A type-1 hypervisor runs directly on the host computer, with no
intervening operating system. This is the most efficient type of hypervisor
because it has direct access to the hardware resources of the host system. The
two best known examples are VMware's ESXi and Hyper-V.
2. A type-2 hypervisor runs as an application within an operating system that
runs directly on the host computer. Type-2 hypervisors are less efficient than
type-1 hypervisors because when you use a type-2 hypervisor, you add an
additional layer of hardware abstraction.
For production use, you should always use type-1 hypervisors because they are
much more efficient than type-2 hypervisors.
Virtual Disks
Computers are not the only things that are virtualized in a virtual environment.
In addition to creating virtual computers, virtualization also creates virtual
disk storage. Disk virtualization lets you combine a variety of physical disk
storage devices to create pools of disk storage that you can then parcel out to
your virtual machines as needed.
Virtualization of disk storage is nothing new. In fact, there are actually
several layers of virtualization involved in an actual storage environment. At
the lowest level are the actual physical disk drives. Physical disk drives are
usually bundled together in arrays of individual drives. This bundling is a type
of virtualization in that it creates the image of a single large disk drive that
is not really there. For example, four 2 TB disk drives might be combined in an
array to create a single 8TB disk drive.
Note that disk arrays are usually used to provide data protection through
redundancy. This is commonly called RAID, which stands for redundant array of
independent disks.
One common form of RAID, called RAID-10, lets you create mirrored pairs of disk
drives so that data is always written to both of the drives in a mirror pair.
So, if one of the drives in a mirror pair fails, the other drive can carry the
load. With RAID-10, the usable capacity of the complete array is equal to
one-half of the total capacity of the drives in the array.
Another common form of RAID is RAID-5, in which disk drives are combined and one
of the drives in the group is used for redundancy. Then, if any of the drives in
the array fails, the remaining drives can be used to re-create the data that was
on the drive that failed. The total capacity of a RAID-5 array is equal to the
sum of the capacities of the individual drives minus one of the drives. For
example, an array of four 2TB drives in a RAID-5 configuration has a total
usable capacity of 6TB.
In a typical virtual environment, the host computers can be connected to disk
storage in several distinct ways:
1. Local disk storage: In local disk storage, disk drives are mounted directly
on the host computer and are connected to the host computer via its internal
disk drive controllers.
2. Storage area network: In a SAN, disk drives are contained in a separate
device that is connected to the host via a high-speed controller. The difference
between a SAN and local storage is that the SAN is a separate device. Its high
speed connection to the host is often just as fast as the internal connection of
local disk storage, but the SAN includes a separate storage controller that is
responsible for managing the disk drives.
A typical SAN can hold a dozen or more disk drives and can allow high speed
connections to more than one host. A SAN can often be expanded by adding one or
more expansion chassis, which can contain a dozen ore more disk drives each. So,
a single SAN can manage hundreds of terabytes of disk data.
3. Networked Attached Storage(NAS): This type of storage is similar to a SAN but
instead of connecting to the hosts via a high speed controller, a NAS connects
to the host computers via standard ethernet connections and TCP/IP. NAS is the
least expensive of all forms of disk storage, but it is also the slowest.
Regardless of the way the storage is attached to the host, the hypervisor
consolidates its storage and creates virtual pools of disk storage, typically
called data stores. For example, a hypervisor that has access to three 2TB
RAID-5 disk arrays might consolidate them to create a single 6TB data store.
From this data store, you can create volumes, which are essentially virtual disk
drives that can be allocated to a particular virtual machine. Then, when an
operating system is installed in a virtual machine, the operating system can
mount the virtual machine's volumes to create drives that the operating system
can access.
For example, let us consider a virtual machine that runs Windows server. If you
were to connect to the virtual machine, log in, and use Windows Explorer to look
at the disk storage that is available to the machine, you might see a C: drive
with a capacity of 100GB. That C: drive is actually a 100GB volume that is
created by the hypervisor and attached to the virtual machine. The 100GB volume
is allocated from a data store, which might be 4TB in size. The data store is
created from disk storage contained in a SAN attached to the host, which might
be made up of a RAID-10 array consisting of four 2TB physical disk drives.
So, you can see that there are at least four layers of virtualization required
to make the raw storage available on the physical disk drives available to the
guest operating system:
1. Physical disk drives are aggregated using RAID-10 to create a unified disk
image that has built-in redundancy. RAID-10 is the first layer of
virtualization. This layer is managed entirely by the SAN.
2. The storage available on the SAN is abstracted by the hypervisor to create
data stores. This is a second layer of virtualization.
3. Portions of a data store are used to create volumes that are then presented
to virtual machines. Volumes represent a third layer of virtualization.
4. The guest operating system sees the volumes as if they are physical devices,
which can be mounted and then formatted to create usable disk storage accessible
to the user. This is the fourth layer of virtualization.
Although it may seem overly complicated, these layers of virtualization give you
a lot of flexibility when it comes to storage management. New disk arrays can be
added to a SAN, or a new NAS can be added to the network, and then new data
stores can be created from them without disrupting existing data stores.
Volumes can be moved from one data store to another without disrupting the
virtual machines they are attached to. In fact, you can increase the size of a
volume on the fly, and the virtual machine will immediately see the increased
storage capacity of its disk drives, without even requiring so much as a reboot.
Network Virtualization
When you create one or more virtual machines on a host system, you need to
provide a way for those virtual machines to communicate not only with each other
but also with the other physical computers on your network.
To enable such connections, you must create a virtual network within your
virtualization environment. The virtual network connects the virtual machines to
each other and to the physical network.
To create a virtual network, you must create a virtual switch, which connects
the virtual machines to each other and to a physical network via the host
computer's network interfaces. Like a physical switch, a virtual switch has
ports. When you create a virtual switch, you connect the virtual switch to one
or more of the host computer's network interfaces. These interfaces are then
connected with network cable to physical switches, which effectively connects
the virtual switch to the physical network.
Then, when you create virtual machines, you connect each virtual machine to a
port on the virtual switch. When all the virtual machines are connected to the
switch, the vm's can communicate with each other via the switch. And they can
communicate with devices on the physical network via the connections through
the host computer's network interfaces.
Benefits of Virtualization
You might suspect that virtualization is inefficient because a real computer is
inherently faster than a simulated computer. Although it is true that real
computers are faster then simulated computers, virtualization technology has
become so advanced that the performance penalty for running on a virtualized
machine rather than a real machine is only a few percent.
The small amount of overhead imposed by virtualization is usually more than made
up for by the simple fact that even the most heavily used servers spend most of
their time twiddling their digital thumbs, waiting for something to do. In fact,
many servers spend nearly all their time doing nothing. As computers get faster
and faster, they spend even more of their time with nothing to do.
Virtualization is a great way to put all this unused processing power to good
use. Besides this basic efficiency benefit, virtualization has several
compelling benefits:
1. Hardware Cost: You typically can save a lot of money by reducing hardware
costs when you use virtualization.
2. Energy Costs: Many organizations have found that going virtual has reduced
their overall electricity consumption for server computers by 80 percent.
3. Reduced Downtime: Virtual environments typically have less than nonvirtual
environments.
4. Recoverability: One of the biggest benefits of virtualization is not the cost
savings, but the ability to recover quickly from hardware failures.
5. Disaster Recovery: Besides the benefit of recoverability when hardware
failures occur, an even bigger benefit of virtualization comes into play in a
true disaster recovery situation.
Choosing Hosts
Having made the decision to virtualize your servers, you are next faced with
the task of selecting the host computers on which you will run your virtual
servers. The good news is that you need to purchase fewer servers than if you
use physical servers. The not so good news is that you need to purchase really
good servers to act as hosts, because each host will support multiple virtual
servers.
1. If possible, purchase at least two hosts, and make sure that each host is
independently capable of running all your virtual servers.
2. Add up the amount of memory you intend to allocate for each server to
determine the amount of ram for each host.
3. Do a similar calculation for processor cores
4. Get the best network connections you can afford.
5. Provide redundancy in the host's subcomponents.
Hyper-V
Virtualization is a complex subject, and mastering the ins and outs of working
with a full-fledged virtualization system like VMware Infrastructure is a deep
topic. You can try the free Hyper-V from Microsoft, though.
Although Hyper-V is built into all modern versions of Windows, Hyper-V is not a
type-2 hypervisor that runs as an application within Windows. Instead, hyper-V
is a true type-1 hypervisor that runs directly on the host computer hardware.
This is true even for the Hyper-V versions that are included with desktop
versions of Windows.
In Hyper-V, each virtual machine runs within an isolated space called a
partition. Each partition has access to its own processor, ram, disk, network,
and other virtual resources.
There are two types of partitions in hyper-V: a parent partition and one or more
child partitions. The parent partition is a special partition that hosts the
Windows operating system that Hyper-V is associated with. Child partitions host
additional virtual machines that you create as needed.
When you activate the Hyper-V feature, the hypervisor is installed and the
existing Windows operating system is moved into a virtual machine that runs in
the parent partition. Then, whenever you start the host computer, the hypervisor
is loaded, the parent partition is created, and Windows is started in a virtual
machine within the parent partition.
Although it may appear that the hypervisor is running within Windows, actually
the reverse is true: Windows is running within the hypervisor.
In addition to the Windows operating system, the parent partition runs software
that enables the management of virtual machines on the hypervisor. This includes
creating new virtual machines, starting and stopping virtual machines, changing
the resources allocated to existing virtual machines, and moving virtual
machines from one host to another.
Hyper-V Virtual Disks
Every Hyper-V virtual machine must have at least one virtual disk associated
with it. A virtual disk is nothing more than a disk that resides in the file
system of the host operating system. The file has one of two file extensions,
depending on which of two data formats you choose for the virtual disk.
.vhd: older format that has a max disk size of 2TB
.vhdx: newer format that can support virtual disks up to 64TB
For either of these virtual disk formats, Hyper-V lets you create two different
types of virtual disks:
1. Fixed-size disk: A virtual disk whose disk space is preallocated to the full
size of the drive when you create the disk.
2. Dynamic expanding disk: A virtual disk that has a max disk space, but that
actually consumes only the amount of disk space that is required to hold the
data on the disk.
Do not be confused by the names fixed size and dynamically expanding. Both types
of disk can be expanded later if you run out of space. The main difference is
whether the max amount of disk space allowed for the drive is allocated when the
drive is first created or as needed when data is added to the drive. Allocating
the space when the drive is created results in better performance for the drive,
because Hyper-V does not have to grab more disk space every time data is added
to the drive. Both types of drives can be expanded later if necessary.
Enabling Hyper-V
Hyper-V is not enabled when you install Windows, you must first enable this
feature before you can use Hyper-V.
To enable Hyper-V on a server version of Windows, call up the Server Manager and
open the Add Roles and Features Wizard. Then enable the Hyper-V role. When you
complete the Wizard, Hyper-V will install the Type-1 hypervisor and move the
existing Windows Server operating system into the parent partition. You can then
start building virtual machines.
To enable Hyper-V on a desktop version on Windows:
1. open the control panel
2. choose programs and features
3. click 'turn Windows features on or off'
4. select the Hyper-V feature and click ok
5. when prompted, restart the computer
Managing Hyper-V
To manage Hyper-V, you use the Hyper-V Manager. To start this program, click the
start button, type Hyper-V, and choose Hyper-V manager. The Hyper-V Manager
window is divided into 5 panes:
1. Navigation
2. Virtual Machines
3. Checkpoints
4. Virtual Machine Summary pane
5. Actions
Creating a Virtual Switch
Before you start creating virtual machines in hyper-V, you should create a
virtual switch so that your virtual machines can communicate with each other and
with the outside world. To do that, you use the Virtual Switch manager. Here are
the steps:
1. In Hyper-V manager, click Virtual Switch manager
2. Select the type of virtual switch you want to create. An External switch is
the usual option.
3. Click create virtual switch
4. Type a name for the new virtual switch in the name field
5. Select the physical network adapter you want to bind the virtual switch to.
6. If your network has multiple vlans, click the enable virtual lan
identification management operating system check box and enter the vlan ID for
the vlan you want this switch to connect to.
7. Click Ok
Creating a Virtual Disk
Before you create a virtual machine, it is best to first create a virtual disk
for the machine to use. Note that you can create a virtual disk at the same time
that you create a virtual machine. However, creating the virtual disk first
gives you more flexibility. So, i recommend you create virtual disks and virtual
machines separately.
1. In hyper-V manager, click New and choose Hard Disk
2. Click Next
3. choose .vhdx disk format
4. Select the disk type you want to use. I prefer fixed size for the performance
5. Click next
6. Specify the name and location of the new disk
7. Click next
8. Specify the max size for the disk drive
9. Click next
10. Click Finish
Creating a Virtual Machine
After you have created a virtual disk, creating a virtual machine to use it is a
straight forward affair.
1. From hyper-V Manager, choose New and then choose Virtual machine
2. Click Next
3. Enter the name you want to use for your virtual machine
4. Specify the location of the virtual machine's configuration file
5. Click Next
6. Specify the generation you want to use for the new virtual machine. Use
Generation 2.
7. Click Next
8. Indicate the amount of ram you want to allocate for the new machine. Increase
it and select dynamic memory.
9. Click next
10. Select the virtual switch you want to use
11. Click Next
12. Click browse and select the virtual disk you created earlier
13. Click Next
14. Click Finish
Installing an Operating System
After you have created a virtual machine, the next step is to configure it to
install an operating system. You need installation media in the form of an .iso
file, then:
1. From Hyper-V Manager, choose the new virtual machine and click Settings
2. Click SCSI Controller in the Hardware list. Then select DVD Drive, and click
Add.
3. Click the image file options, click Browse, and select the .iso file that
contains the operating system's installation program.
4. Click Ok
5. With the new virtual machine still selected, click connect
6. Click Connect
7. Click Start
8. When prompted to press a key ti boot from CD or DVD, press any key
9. Follow the instructions of the installation program to install the operating
system.